Page 754 CONFORMS TO SVID, AT&T, POSIX, X/OPEN, BSD 4.3 SEE ALSO fcntl(2), open(2), close(2). Linux 1.1.46, 21 August 1994 execveexecveExecute program SYNOPSIS #include <unistd.h> int execve (const char *filename, const char *argv [], const char *envp[]); DESCRIPTION execve() executes the program pointed to by filename. filename must be either a binary executable or a shell script starting with a line in the format #! interpreter [arg]. execve() does not return on success, and the text, data, bss, and stack of the calling process are overwritten by that of the program loaded. The program invoked inherits the calling process's PID, and any open file descriptors that are not set to close on exec. Signals pending on the parent process are cleared. If the current program is being ptraced, a SIGTRAP is sent to it after a successful execve(). RETURN VALUE On success, execve() does not return; on error _1 is returned and errno is set appropriately. ERRORS
CONFORMS TO SVID, AT&T, POSIX, X/OPEN, BSD 4.3 NOTES SUID and SGID processes can not be ptrace()'d SUID or SGID. Page 755 A maximum line length of 127 characters is allowed for the first line in a #! executable shell script. This may be circumvented by changing the max size of buf, in which case you will become bound by the 1024 byte size of a buffer, which is not easily worked around. SEE ALSO execl(3), fork(2) Linux 1.1.46, 21 August 1994 fcntlfcntlManipulate file descriptor SYNOPSIS #include <unistd.h> #include <fcntl.h> int fcntl(int fd,intcmd); int fcntl(int fd,intcmd,longarg); DESCRIPTION fcntl performs one of various miscellaneous operations on fd. The operation in question is determined by cmd:
Page 756 RETURN VALUE The return value depends on the operation:
On error, _1 is returned and errno is set appropriately. ERRORS
NOTES The errors returned by dup2 are different from those returned by F_DUPFD. CONFORMS TO SVID, AT&T, POSIX, X/OPEN, BSD 4.3 SEE ALSO dup2(2), open(2), socket(2). Linux, 26 September 1995 fdatasyncfdatasyncSynchronizes a file's in-core data with that on disk SYNOPSIS #include <unistd.h> #ifdef POSIX SYNCHRONIZED IO int fdatasync(int fd); #endif DESCRIPTION fdatasync flushes all data buffers of a file to disk (before the system call returns). It resembles fsync but is not required to update the metadata such as access time. Applications that access databases or log files often write a tiny data fragment (for example, one line in a log file) and then call fsync immediately in order to ensure that the written data is physically stored on the hard disk. Unfortunately, fsync will always initiate two write operations: one for the newly written data and another one in order to update the modification time stored in the inode. If the modification time is not a part of the transaction concept fdatasync can be used to avoid unnecessary inode disk write operations. RETURN VALUE On success, 0 is returned. On error, _1 is returned and errno is set appropriately. |