| www.delorie.com/djgpp/doc/libc/libc_690.html | search |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#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.
The file name stored in fd_properties is the result
of the _truename function (see section _truename) on filename.
The open_flags are scanned and the temporary and append flags
are stored in the flags field in fd_properties.
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
FILE_DESC_DIRECTORY
The flags can be manipulated using
__set_fd_flags (see section __set_fd_flags),
__clear_fd_flags (see section __clear_fd_flags)
and __get_fd_flags (see section __get_fd_flags).
The file name can be retrieved using __get_fd_name
(see section __get_fd_name).
For more information, see __clear_fd_properties
(see section __clear_fd_properties) and __dup_fd_properties
(see section __dup_fd_properties).
Returns 0 on success. Returns -1 when unable to store the information.
| ANSI/ISO C | No |
| POSIX | No |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster | delorie software privacy |
| Copyright © 2004 | Updated Apr 2004 |