Manual Pages for Linux CentOS command on man stdio_ext
MyWebUniversity

Manual Pages for Linux CentOS command on man stdio_ext

STDIOEXT(3) Linux Programmer's Manual STDIOEXT(3)

NAME fbufsize, flbf, fpending, fpurge, freadable, freading,

fsetlocking, fwritable, fwriting, flushlbf - interfaces to stdio FILE structure SYNOPSIS

#include

#include sizet fbufsize(FILE *stream); sizet fpending(FILE *stream); int flbf(FILE *stream); int freadable(FILE *stream); int fwritable(FILE *stream); int freading(FILE *stream); int fwriting(FILE *stream); int fsetlocking(FILE *stream, int type); void flushlbf(void); void fpurge(FILE *stream); DESCRIPTION Solaris introduced routines to allow portable access to the internals of the FILE structure, and glibc also implemented these. The fbufsize() function returns the size of the buffer currently used by the given stream. The fpending() function returns the number of bytes in the output

buffer. For wide-oriented streams the unit is wide characters. This

function is undefined on buffers in reading mode, or opened read-only.

The flbf() function returns a nonzero value if the stream is line- buffered, and zero otherwise. The freadable() function returns a nonzero value if the stream allows reading, and zero otherwise. The fwritable() function returns a nonzero value if the stream allows writing, and zero otherwise. The freading() function returns a nonzero value if the stream is

read-only, or if the last operation on the stream was a read operation, and zero otherwise. The fwriting() function returns a nonzero value if the stream is

write-only (or append-only), or if the last operation on the stream was a write operation, and zero otherwise. The fsetlocking() function can be used to select the desired type of locking on the stream. It returns the current type. The type argument can take the following three values: FSETLOCKINGINTERNAL Perform implicit locking around every operation on the given stream (except for the *unlocked ones). This is the default. FSETLOCKINGBYCALLER The caller will take care of the locking (possibly using flock‐ file(3) in case there is more than one thread), and the stdio routines will not do locking until the state is reset to FSET‐ LOCKINGINTERNAL. FSETLOCKINGQUERY Don't change the type of locking. (Only return it.)

The flushlbf() function flushes all line-buffered streams. (Presum‐ ably so that output to a terminal is forced out, say before reading keyboard input.) The fpurge() function discards the contents of the stream's buffer. ATTRIBUTES For an explanation of the terms used in this section, see attributes(7). ┌─────────────────────────────┬───────────────┬─────────────────────┐ │Interface │ Attribute │ Value │ ├─────────────────────────────┼───────────────┼─────────────────────┤

│fbufsize(), fpending(), │ Thread safety │ MT-Safe race:stream │ │fpurge(), fsetlocking() │ │ │ ├─────────────────────────────┼───────────────┼─────────────────────┤

│flbf(), freadable(), │ Thread safety │ MT-Safe │ │freading(), fwritable(), │ │ │ │fwriting(), flushlbf() │ │ │ └─────────────────────────────┴───────────────┴─────────────────────┘ SEE ALSO flockfile(3), fpurge(3) COLOPHON

This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can

be found at http://www.kernel.org/doc/man-pages/.

2013-06-21 STDIOEXT(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™