Page 757 ERRORS
BUGS Currently (Linux 1.3.86) fdatasync is equivalent to fsync. CONFORMS TO POSIX.4 SEE ALSO fsync(2), B.O. Gallmeister, POSIX.4, O'Reilly, pp. 220_223, 343. Linux 1.3.86, 13 April 1996 flockflockApplies or removes an advisory lock on an open file SYNOPSIS #include <sys/file.h> int flock(int fd,intoperation); DESCRIPTION Apply or remove an advisory lock on an open file. The file is specified by fd. Valid operations are given here:
RETURN VALUE On success, 0 is returned. On error, _1 is returned and errno is set appropriately. ERRORS
NOTES Under Linux, flock is implemented as a call to fcntl. Please see fcntl(2) for more details on errors. SEE ALSO open(2), close(2), dup(2), execve(2), fcntl(2), fork(2) Linux 0.99.11, 22 July 1993 Page 758 fork, vforkfork, vforkCreates a child process SYNOPSIS #include <unistd.h> pid t fork(void); pid t vfork(void); DESCRIPTION fork creates a child process that differs from the parent process only in its PID and PPID, and in the fact that resource utilizations are set to 0. File locks and pending signals are not inherited. Under Linux, fork is implemented using copy-on-write pages, so the only penalties incurred by fork are the time and memory required to duplicate the parent's page tables and to create a unique task structure for the child. RETURN VALUE On success, the PID of the child process is returned in the parent's thread of execution, and a 0 is returned in the child's thread of execution. On failure, a _1 will be returned in the parent's context, no child process will be created, and errno will be set appropriately. ERRORS
BUGS Under Linux, vfork is merely an alias for fork. fork never returns the error ENOMEM. CONFORMS TO SVID, AT&T, POSIX, X/OPEN, BSD 4.3 SEE ALSO clone(2), execve(2), wait(2) Linux 1.2.9, 10 June 1995 fsyncfsyncSynchronizes a file's complete in-core state with that on disk SYNOPSIS #include <unistd.h> int fsync(int fd); DESCRIPTION fsync copies all in-core parts of a file to disk. In some applications, fdatasync is a more efficient alternative to fsync. RETURN VALUE On success, 0 is returned. On error, _1 is returned and errno is set appropriately. Page 759 ERRORS
CONFORMS TO POSIX.1b SEE ALSO bdflush(2), fdatasync(2), sync(2), update(8), sync(8) Linux 1.3.85, 13 April 1996 getdentsgetdentsGets directory entries SYNOPSIS #include <unistd.h> #include <linux/dirent.h> #include <linux/unistd.h> syscall3(int, getdents, uint, fd, struct dirent *, dirp, uint, count); int getdents(unsigned int fd, struct dirent *dirp, unsigned int count); DESCRIPTION getdents reads several dirent structures from the directory pointed at by fd into the memory area pointed to by dirp. The parameter count is the size of the memory area. The dirent structure is declared as follows: struct dirent { long d_ino; /* inode number */ off_t d_off; /* offset to next dirent */ unsigned short d_reclen; /* length of this dirent */ char d_name [NAME_MAX+1]; /* file name (null-terminated) */ } d_ino is an inode number. d_off is the distance from the start of the directory to the start of the next dirent. d_reclen is the size of this entire dirent. d_name is a null-terminated filename. This call supersedes readdir(2). RETURN VALUE On success, the number of bytes read is returned. On end of directory, 0 is returned. On error, _1 is returned and errno is set appropriately. ERRORS
SEE ALSO readdir(2), readdir(3) Linux 1.3.6, 22 July 1995 |