Go to the first, previous, next, last section, table of contents.
#include <libc/fd_props.h> int __set_fd_properties(int fd, const char *filename, int open_flags);
This is an internal function that stores information about the file descriptor
fd in a fd_properties
struct. It is called by open
and
its helper functions.
struct fd_properties { unsigned char ref_count; char *filename; unsigned long flags; fd_properties *prev; fd_properties *next; };
flags
can contain a combination of bits:
FILE_DESC_TEMPORARY
filename
when ref_count
becomes zero.
FILE_DESC_ZERO_FILL_EOF_GAP
write
and _write
to test for file offset greater than
EOF. Set by lseek
and llseek
.
FILE_DESC_DONT_FILL_EOF_GAP
FILE_DESC_PIPE
FILE_DESC_APPEND
For more information, see section __clear_fd_properties and section __dup_fd_properties.
Returns 0 on success. Returns -1 when unable to store the information.
not ANSI, not POSIX
Go to the first, previous, next, last section, table of contents.