1 /* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
3 * GNU Library General Public License (LGPL) version 2 or later.
5 * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
10 #ifdef __STDIO_BUFFERS
12 /* Commit the data in the write buffer.
13 * Returns 0 on success, >0 (pending) on failure.
14 * Side effects are those of _stdio_WRITE
17 size_t attribute_hidden
__stdio_wcommit(register FILE * __restrict stream
)
21 __STDIO_STREAM_VALIDATE(stream
);
23 if ((bufsize
= __STDIO_STREAM_BUFFER_WUSED(stream
)) != 0) {
24 stream
->__bufpos
= stream
->__bufstart
;
25 __stdio_WRITE(stream
, stream
->__bufstart
, bufsize
);
28 return __STDIO_STREAM_BUFFER_WUSED(stream
);