Lines Matching +full:- +full:a
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 <<fflush>>, <<fflush_unlocked>>---flush buffered file output
56 Additionally, if <[fp]> is a seekable input stream visiting a file
58 unread byte, useful for obeying POSIX semantics when ending a process
61 <<fflush_unlocked>> is a non-thread-safe version of <<fflush>>.
62 <<fflush_unlocked>> may only safely be used within a scope
64 function may safely be used in a multi-threaded program if and only
66 object, as is the case after a successful call to the flockfile() or
71 reentrant versions, where the extra argument <[reent]> is a pointer to
72 a reentrancy structure, and <[fp]> must not be NULL.
75 <<fflush>> returns <<0>> unless it encounters a write error; in that
82 <<fflush_unlocked>> is a BSD extension also provided by GNU libc.
98 /* Flush a single file, or (if fp is NULL) all files. */
111 flags = fp->_flags; in _sflush()
115 /* For a read stream, an fflush causes the next seek to be in _sflush()
116 unoptimized (i.e. forces a system-level seek). This conforms in _sflush()
118 fp->_flags |= __SNPT; in _sflush()
121 /* For a seekable stream with buffered read characters, we will attempt in _sflush()
122 a seek to the current position now. A subsequent read will then get in _sflush()
127 to miss a code scenario. */ in _sflush()
128 if ((fp->_r > 0 || fp->_ur > 0) && fp->_seek != NULL) in _sflush()
137 /* Save last errno and set errno to 0, so we can check if a device in _sflush()
138 returns with a valid position -1. We restore the last errno if in _sflush()
143 if (fp->_flags & __SOFF) in _sflush()
144 curoff = fp->_offset; in _sflush()
150 if (fp->_flags & __SL64) in _sflush()
151 curoff = fp->_seek64 (fp->_cookie, 0, SEEK_CUR); in _sflush()
154 curoff = fp->_seek (fp->_cookie, 0, SEEK_CUR); in _sflush()
155 if (curoff == -1L && _REENT_ERRNO(ptr) != 0) in _sflush()
164 fp->_flags |= __SERR; in _sflush()
168 if (fp->_flags & __SRD) in _sflush()
172 curoff -= fp->_r; in _sflush()
174 curoff -= fp->_ur; in _sflush()
178 if (fp->_flags & __SL64) in _sflush()
179 curoff = fp->_seek64 (fp->_cookie, curoff, SEEK_SET); in _sflush()
182 curoff = fp->_seek (fp->_cookie, curoff, SEEK_SET); in _sflush()
183 if (curoff != -1 || _REENT_ERRNO(ptr) == 0 in _sflush()
189 fp->_flags &= ~__SNPT; in _sflush()
191 fp->_r = 0; in _sflush()
192 fp->_p = fp->_bf._base; in _sflush()
193 if ((fp->_flags & __SOFF) && (curoff != -1 || _REENT_ERRNO(ptr) == 0)) in _sflush()
194 fp->_offset = curoff; in _sflush()
201 fp->_flags |= __SERR; in _sflush()
207 if ((p = fp->_bf._base) == NULL) in _sflush()
212 n = fp->_p - p; /* write this much */ in _sflush()
219 fp->_p = p; in _sflush()
220 fp->_w = flags & (__SLBF | __SNBF) ? 0 : fp->_bf._size; in _sflush()
224 t = fp->_write (fp->_cookie, (char *) p, n); in _sflush()
227 fp->_flags |= __SERR; in _sflush()
231 n -= t; in _sflush()
244 return (fp->_flags & __SWR) ? _sflush ( fp) : 0; in _sflushw()
260 called for the first time on a std stream. This std in fflush()
261 stream can belong to a reentrant struct that is not in fflush()
266 are two alternatives to fix this: 1) make a reentrant fflush in fflush()
268 and return immediately before performing a CHECK_INIT. Choice in fflush()
270 if (fp->_bf._base == NULL) in fflush()
276 if (!fp->_flags) in fflush()