영어에서 Fcntl 을 사용하는 예와 한국어로 번역
{-}
-
Colloquial
-
Ecclesiastic
-
Ecclesiastic
-
Programming
-
Computer
Fcntl- file control.
Solaris' libc handles fcntl(2) on sockets.
The fcntl() system call appeared in BSD 4.2.
(On some systems, this function is emulated using fcntl().).
Fcntl- The fcntl and ioctl system calls¶.
If the lock cannot be set, fcntl returns immediately with a value of -1.
Once we've described these features, we describe the dup, fcntl, and ioctl functions.
Depending on the value of cmd, fcntl() can take an additional third argument int arg.
Once we have described these features, we describe the dup, fcntl, and ioctl functions.
Flock(2) and fcntl(2) locks have different semantics with respect to forked processes and dup(2).
Some of these optional flags can be altered using fcntl after the file has been opened.
The new file descriptor is set to remain open across exec functions(see fcntl(2)).
For a complete description of these calls, see fcntl(2) and ioctl(2) Unix manual pages.
This method uses the fcntl(2) system call to lock a lock file(located by the LockFile directive).
If a shared or exclusive lock cannot be set, fcntl() returns immediately with EAGAIN.
Fcntl() performs one of the operations described below on the open file descriptor fd. The operation is determined by cmd.
Another approach to locking is to use POSIX record locks, implemented through fcntl(2) as a''discretionary lock''.
However, the semantics of System V and IEEE Std 1003.1-1988(“POSIX.1”) dictate that all fcntl(2) advisory record locks associated with a file for a given process are removed when any file descriptor for that file is closed by that process.
This entry records the file offset and the file status flags(modifiable via the fcntl() F_SETFL operation).
The new descriptor is set to remain open across execve(2)system calls; see close(2) and fcntl(2).
The error returned by dup2()is different from that returned by fcntl(…, F_DUPFD,…) when newfd is out of range.
The setsockopt(2) and getsockopt(2) calls are a side-effect of how Solaris' libc handles fcntl(2) on sockets.
Another approach to locking is to use POSIX record locks, implemented through fcntl(2) as a''discretionary lock''.