Advanced Programming in the UNIX® Environment

(lily) #1
ptg10805159

852 Function Prototypes Appendix A


int fcntl(intfd,intcmd,... /* intarg*/ );
<fcntl.h> p. 82
cmd:F_DUPFD, F_DUPFD_CLOEXEC, F_GETFD,
F_SETFD, F_GETFL, F_SETFL, F_GETOWN,
F_SETOWN, F_GETLK, F_SETLK, F_SETLKW
Returns: depends oncmdif OK,−1 on error

int fdatasync(intfd);
<unistd.h> p. 81
Returns: 0 if OK,−1 on error
Platforms: Linux 3.2.0, Solaris 10

void FD_CLR(intfd,fd_set *fdset);
<sys/select.h> p. 503

int FD_ISSET(intfd,fd_set *fdset);
<sys/select.h> p. 503
Returns: nonzeroiffdis in set, 0 otherwise

FILE *fdopen(intfd,const char *type);
<stdio.h> p. 148
type:"r", "w", "a", "r+", "w+", "a+"
Returns: file pointer if OK,NULLon error

DIR *fdopendir(intfd);
<dirent.h> p. 130
Returns: pointer if OK,NULLon error

void FD_SET(intfd,fd_set *fdset);
<sys/select.h> p. 503

void FD_ZERO(fd_set *fdset);
<sys/select.h> p. 503

int feof(FILE *fp);
<stdio.h> p. 151
Returns: nonzero(true) if end of file on stream,
0(false) otherwise

int ferror(FILE *fp);
<stdio.h> p. 151
Returns: nonzero(true) if error on stream, 0 (false) otherwise

int fexecve(intfd,char *constargv[], char *constenvp[]);
<unistd.h> p. 249
Returns:−1 on error, no return on success
Free download pdf