Query: dirfd
OS: opensolaris
Section: 3c
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
dirfd(3C) Standard C Library Functions dirfd(3C)NAMEdirfd - get directory stream file descriptorSYNOPSIS#include <dirent.h> int dirfd(DIR *dir);DESCRIPTIONThe dirfd() function returns the file descriptor associated with the directory stream dir. This file descriptor is the one used internally by the directory stream operations. See opendir(3C), closedir(3C), readdir(3C), rewind- dir(3C), seekdir(3C), telldir(3C). The file descriptor is automatically closed when closedir() is called for the directory stream dir or when one of the exec functions is called. See exec(2). The file descriptor can safely be used only by functions that do not depend on or alter the file position, such as fstat(2) and fchdir(2). Closing the file descriptor with close(2) or modifying the file position by means other than the directory stream operations listed above causes undefined behavior to occur when one of the directory stream operations is subsequently called with the directory stream dir.RETURN VALUESUpon successful completion, the dirfd() function returns an open file descriptor for the directory associated with the directory stream dir.ERRORSThere are no defined error returns. Passing an invalid directory stream as an argument to the dirfd() function results in undefined behav- ior.USAGEThe dirfd() function is intended to be used to obtain a file descriptor for use with the fchdir() function.ATTRIBUTESSee attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+SEE ALSOclose(2), exec(2), fchdir(2), fstat(2), closedir(3C), opendir(3C), readdir(3C), rewinddir(3C), seekdir(3C), telldir(3C), attributes(5) SunOS 5.11 24 Oct 2007 dirfd(3C)
Related Man Pages |
---|
dirfd(3) - osx |
dirfd(3) - minix |
dirfd(3) - v7 |
dirfd(3) - hpux |
dirfd(3) - ultrix |
Similar Topics in the Unix Linux Community |
---|
Passing a file descriptor |
Opendir |
Opendir |
How to get MD5 from a pipe stream and do not alter it? |