]> git.saurik.com Git - apple/xnu.git/blame - bsd/man/man2/fcntl.2
xnu-2050.48.11.tar.gz
[apple/xnu.git] / bsd / man / man2 / fcntl.2
CommitLineData
b0d623f7 1.\"
6d2010ae 2.\" Copyright (c) 2011 Apple Inc. All rights reserved.
b0d623f7
A
3.\"
4.\" @APPLE_LICENSE_HEADER_START@
5.\"
6.\" This file contains Original Code and/or Modifications of Original Code
7.\" as defined in and that are subject to the Apple Public Source License
8.\" Version 2.0 (the 'License'). You may not use this file except in
9.\" compliance with the License. Please obtain a copy of the License at
10.\" http://www.opensource.apple.com/apsl/ and read it before using this
11.\" file.
12.\"
13.\" The Original Code and all software distributed under the License are
14.\" distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17.\" FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18.\" Please see the License for the specific language governing rights and
19.\" limitations under the License.
20.\"
21.\" @APPLE_LICENSE_HEADER_END@
22.\"
23.\"
9bccf70c
A
24.\" $NetBSD: fcntl.2,v 1.6 1995/02/27 12:32:29 cgd Exp $
25.\"
26.\" Copyright (c) 1983, 1993
27.\" The Regents of the University of California. All rights reserved.
28.\"
29.\" Redistribution and use in source and binary forms, with or without
30.\" modification, are permitted provided that the following conditions
31.\" are met:
32.\" 1. Redistributions of source code must retain the above copyright
33.\" notice, this list of conditions and the following disclaimer.
34.\" 2. Redistributions in binary form must reproduce the above copyright
35.\" notice, this list of conditions and the following disclaimer in the
36.\" documentation and/or other materials provided with the distribution.
37.\" 3. All advertising materials mentioning features or use of this software
38.\" must display the following acknowledgement:
39.\" This product includes software developed by the University of
40.\" California, Berkeley and its contributors.
41.\" 4. Neither the name of the University nor the names of its contributors
42.\" may be used to endorse or promote products derived from this software
43.\" without specific prior written permission.
44.\"
45.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
46.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
47.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
48.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
49.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
51.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
53.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55.\" SUCH DAMAGE.
56.\"
57.\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94
58.\"
6d2010ae 59.Dd February 17, 2011
9bccf70c
A
60.Dt FCNTL 2
61.Os BSD 4.2
62.Sh NAME
63.Nm fcntl
64.Nd file control
65.Sh SYNOPSIS
66.Fd #include <fcntl.h>
67.Ft int
2d21ac55
A
68.Fo fcntl
69.Fa "int fildes"
70.Fa "int cmd"
71.Fa "..."
72.Fc
9bccf70c
A
73.Sh DESCRIPTION
74.Fn Fcntl
75provides for control over descriptors.
76The argument
2d21ac55 77.Fa fildes
9bccf70c
A
78is a descriptor to be operated on by
79.Fa cmd
80as follows:
81.Bl -tag -width F_WRITEBOOTSTRAPX
82.It Dv F_DUPFD
83Return a new descriptor as follows:
84.Pp
85.Bl -bullet -compact -offset 4n
86.It
87Lowest numbered available descriptor greater than or equal to
88.Fa arg .
89.It
90Same object references as the original descriptor.
91.It
92New descriptor shares the same file offset if the object
93was a file.
94.It
95Same access mode (read, write or read/write).
96.It
97Same file status flags (i.e., both file descriptors
98share the same file status flags).
99.It
100The close-on-exec flag associated with the new file descriptor
6d2010ae 101is cleared so that the descriptor remains open across an
9bccf70c 102.Xr execv 2
6d2010ae 103system call.
9bccf70c 104.El
6d2010ae
A
105.It Dv F_DUPFD_CLOEXEC
106Like
107.Dv F_DUPFD ,
108except that the close-on-exec flag associated with the new file descriptor
109is set.
9bccf70c 110.It Dv F_GETFD
6d2010ae
A
111Get the flags associated with the file descriptor
112.Fa fildes ,
113as described below
9bccf70c
A
114.Fa ( arg
115is ignored).
116.It Dv F_SETFD
6d2010ae
A
117Set the file descriptor flags to
118.Fa arg .
9bccf70c
A
119.It Dv F_GETFL
120Get descriptor status flags, as described below
121.Fa ( arg
122is ignored).
123.It Dv F_SETFL
124Set descriptor status flags to
125.Fa arg .
126.It Dv F_GETOWN
127Get the process ID or process group
128currently receiving
129.Dv SIGIO
130and
131.Dv SIGURG
132signals; process groups are returned
133as negative values
134.Fa ( arg
135is ignored).
136.It Dv F_SETOWN
137Set the process or process group
138to receive
139.Dv SIGIO
140and
141.Dv SIGURG
142signals;
143process groups are specified by supplying
144.Fa arg
145as negative, otherwise
146.Fa arg
147is interpreted as a process ID.
2d21ac55
A
148.It Dv F_GETPATH
149Get the path of the file descriptor
150.Fa Fildes .
151The argument must be a buffer of size
152.Sy MAXPATHLEN
153or greater.
9bccf70c 154.It Dv F_PREALLOCATE
b0d623f7
A
155Preallocate file storage space. Note: upon success,
156the space that is allocated can be the same size or
157larger than the space requested.
9bccf70c
A
158.It Dv F_SETSIZE
159Truncate a file without zeroing space.
160The calling process must have root privileges.
161.It Dv F_RDADVISE
162Issue an advisory read async with no copy to user.
163.It Dv F_RDAHEAD
164Turn read ahead off/on.
165A zero value in
166.Fa arg
167disables read ahead.
168A non-zero value in
169.Fa arg
170turns read ahead on.
171.It Dv F_READBOOTSTRAP
172Read bootstrap from disk.
173.It Dv F_WRITEBOOTSTRAP
174Write bootstrap on disk.
175The calling process must have root privileges.
176.It Dv F_NOCACHE
177Turns data caching off/on. A non-zero value in
178.Fa arg
179turns data caching off.
180A value of zero in
181.Fa arg
182turns data caching on.
183.It Dv F_LOG2PHYS
184Get disk device information.
185Currently this only includes the
186disk device address that corresponds
187to the current file offset.
6d2010ae
A
188.It Dv F_LOG2PHYS_EXT
189Variant of F_LOG2PHYS that uses the passed in
190file offset and length.
91447636
A
191.It Dv F_FULLFSYNC
192Does the same thing as
193.Xr fsync 2
194then asks the drive to
195flush all buffered data to
196the permanent storage device
197.Fa ( arg
198is ignored).
2d21ac55
A
199This is currently implemented on HFS, MS-DOS (FAT),
200and Universal Disk Format (UDF) file systems.
201The operation may take quite a while to complete.
202Certain FireWire drives have also been known
203to ignore the request to flush their buffered data.
6d2010ae
A
204.It Dv F_SETNOSIGPIPE
205Determines whether a
206.Dv SIGPIPE
207signal will be generated when a write fails on a pipe or socket for
208which there is no reader. If
209.Fa arg
210is non-zero,
211.Dv SIGPIPE
212generation is disabled for descriptor
213.Fa fildes ,
214while an
215.Fa arg
216of zero enables it (the default).
217.It Dv F_GETNOSIGPIPE
218Returns whether a
219.Dv SIGPIPE
220signal will be generated when a write fails on a pipe or socket
221for which there is no reader. The semantics of the return value
222match those of the
223.Fa arg
224of
225.Dv F_SETNOSIGPIPE .
226.El
227.Pp
228The flags for the
229.Dv F_GETFD
230and
231.Dv F_SETFD
232commands are as follows:
233.Bl -tag -width FD_CLOEXECX -offset indent
234.It Dv FD_CLOEXEC
235Close-on-exec; the given file descriptor will be automatically
236closed in the successor process image when one of the
237.Xr execv 2
238or
239.Xr posix_spawn 2
240family of system calls is invoked.
9bccf70c
A
241.El
242.Pp
243The flags for the
244.Dv F_GETFL
245and
246.Dv F_SETFL
247commands are as follows:
248.Bl -tag -width O_NONBLOCKX -offset indent
249.It Dv O_NONBLOCK
250Non-blocking I/O; if no data is available to a
251.Xr read
252call, or if a
253.Xr write
254operation would block,
255the read or write call returns -1 with the error
256.Er EAGAIN .
257.It Dv O_APPEND
258Force each write to append at the end of file;
259corresponds to the
260.Dv O_APPEND
261flag of
262.Xr open 2 .
263.It Dv O_ASYNC
264Enable the
265.Dv SIGIO
266signal to be sent to the process group
267when I/O is possible, e.g.,
268upon availability of data to be read.
269.El
270.Pp
271Several commands are available for doing advisory file locking;
272they all operate on the following structure:
273.ne 7v
274.Bd -literal
275 struct flock {
276 off_t l_start; /* starting offset */
277 off_t l_len; /* len = 0 means until end of file */
278 pid_t l_pid; /* lock owner */
279 short l_type; /* lock type: read/write, etc. */
280 short l_whence; /* type of l_start */
281 };
282.Ed
283.Pp
284The commands available for advisory record locking are as follows:
285.Bl -tag -width F_SETLKWX
286.It Dv F_GETLK
287Get the first lock that blocks the lock description pointed to by the
288third argument,
289.Fa arg ,
290taken as a pointer to a
291.Fa "struct flock"
292(see above).
293The information retrieved overwrites the information passed to
294.Nm fcntl
295in the
296.Fa flock
297structure.
298If no lock is found that would prevent this lock from being created,
299the structure is left unchanged by this function call except for the
300lock type which is set to
301.Dv F_UNLCK .
302.It Dv F_SETLK
303Set or clear a file segment lock according to the lock description
304pointed to by the third argument,
305.Fa arg ,
306taken as a pointer to a
307.Fa "struct flock"
308(see above).
309.Dv F_SETLK
310is used to establish shared (or read) locks
311.Dv (F_RDLCK)
312or exclusive (or write) locks,
313.Dv (F_WRLCK) ,
314as well as remove either type of lock
315.Dv (F_UNLCK) .
316If a shared or exclusive lock cannot be set,
317.Nm fcntl
318returns immediately with
b0d623f7 319.Er EAGAIN .
9bccf70c
A
320.It Dv F_SETLKW
321This command is the same as
322.Dv F_SETLK
323except that if a shared or exclusive lock is blocked by other locks,
324the process waits until the request can be satisfied.
325If a signal that is to be caught is received while
326.Nm fcntl
327is waiting for a region, the
328.Nm fcntl
329will be interrupted if the signal handler has not specified the
330.Dv SA_RESTART
331(see
332.Xr sigaction 2 ) .
333.El
334.Pp
335When a shared lock has been set on a segment of a file,
336other processes can set shared locks on that segment
337or a portion of it.
338A shared lock prevents any other process from setting an exclusive
339lock on any portion of the protected area.
340A request for a shared lock fails if the file descriptor was not
341opened with read access.
342.Pp
343An exclusive lock prevents any other process from setting a shared lock or
344an exclusive lock on any portion of the protected area.
345A request for an exclusive lock fails if the file was not
346opened with write access.
347.Pp
348The value of
349.Fa l_whence
350is
351.Dv SEEK_SET ,
352.Dv SEEK_CUR ,
353or
354.Dv SEEK_END
355to indicate that the relative offset,
356.Fa l_start
357bytes, will be measured from the start of the file,
358current position, or end of the file, respectively.
359The value of
360.Fa l_len
361is the number of consecutive bytes to be locked.
362If
363.Fa l_len
364is negative, the result is undefined.
365The
366.Fa l_pid
367field is only used with
368.Dv F_GETLK
369to return the process ID of the process holding a blocking lock.
370After a successful
371.Dv F_GETLK
372request, the value of
373.Fa l_whence
374is
375.Dv SEEK_SET .
376.Pp
377Locks may start and extend beyond the current end of a file,
378but may not start or extend before the beginning of the file.
379A lock is set to extend to the largest possible value of the
380file offset for that file if
381.Fa l_len
382is set to zero. If
383.Fa l_whence
384and
385.Fa l_start
386point to the beginning of the file, and
387.Fa l_len
388is zero, the entire file is locked.
389If an application wishes only to do entire file locking, the
390.Xr flock 2
391system call is much more efficient.
392.Pp
393There is at most one type of lock set for each byte in the file.
394Before a successful return from an
395.Dv F_SETLK
396or an
397.Dv F_SETLKW
398request when the calling process has previously existing locks
399on bytes in the region specified by the request,
400the previous lock type for each byte in the specified
401region is replaced by the new lock type.
402As specified above under the descriptions
403of shared locks and exclusive locks, an
404.Dv F_SETLK
405or an
406.Dv F_SETLKW
407request fails or blocks respectively when another process has existing
408locks on bytes in the specified region and the type of any of those
409locks conflicts with the type specified in the request.
410.Pp
411This interface follows the completely stupid semantics of System V and
412.St -p1003.1-88
413that require that all locks associated with a file for a given process are
414removed when \fIany\fP file descriptor for that file is closed by that process.
415This semantic means that applications must be aware of any files that
416a subroutine library may access.
417For example if an application for updating the password file locks the
418password file database while making the update, and then calls
419.Xr getpwname 3
420to retrieve a record,
421the lock will be lost because
422.Xr getpwname 3
423opens, reads, and closes the password database.
424The database close will release all locks that the process has
425associated with the database, even if the library routine never
426requested a lock on the database.
427Another minor semantic problem with this interface is that
428locks are not inherited by a child process created using the
429.Xr fork 2
430function.
431The
432.Xr flock 2
433interface has much more rational last close semantics and
434allows locks to be inherited by child processes.
435.Xr Flock 2
436is recommended for applications that want to ensure the integrity
437of their locks when using library routines or wish to pass locks
438to their children.
439Note that
440.Xr flock 2
441and
442.Xr fcntl 2
443locks may be safely used concurrently.
444.Pp
445All locks associated with a file for a given process are
446removed when the process terminates.
447.Pp
448A potential for deadlock occurs if a process controlling a locked region
449is put to sleep by attempting to lock the locked region of another process.
450This implementation detects that sleeping until a locked region is unlocked
451would cause a deadlock and fails with an
452.Er EDEADLK
453error.
454.Pp
455The
456.Dv F_PREALLOCATE
457command operates on the following structure:
458.ne 7v
459.Bd -literal
460 typedef struct fstore {
461 u_int32_t fst_flags; /* IN: flags word */
462 int fst_posmode; /* IN: indicates offset field */
463 off_t fst_offset; /* IN: start of the region */
464 off_t fst_length; /* IN: size of the region */
465 off_t fst_bytesalloc; /* OUT: number of bytes allocated */
466 } fstore_t;
467.Ed
468.Pp
469The flags (fst_flags) for the
470.Dv F_PREALLOCATE
471command are as follows:
472.Bl -tag -width F_ALLOCATECONTIGX -offset indent
473.It Dv F_ALLOCATECONTIG
474Allocate contiguous space.
475.It Dv F_ALLOCATEALL
476Allocate all requested space or no space at all.
477.El
478.Pp
479The position modes (fst_posmode) for the
480.Dv F_PREALLOCATE
481command indicate how to use the offset field.
482The modes are as follows:
483.Bl -tag -width F_PEOFPOSMODEX -offset indent
484.It Dv F_PEOFPOSMODE
485Allocate from the physical end of file.
486.It Dv F_VOLPOSMODE
487Allocate from the volume offset.
488.El
489.Pp
490The
491.Dv F_RDADVISE
492command operates on the following structure
493which holds information passed from the
494user to the system:
495.ne 7v
496.Bd -literal
497 struct radvisory {
498 off_t ra_offset; /* offset into the file */
499 int ra_count; /* size of the read */
500 };
501.Ed
502.Pp
503The
504.Dv F_READBOOTSTRAP and F_WRITEBOOTSTRAP
505commands operate on the following structure.
506.ne 7v
507.Bd -literal
508 typedef struct fbootstraptransfer {
509 off_t fbt_offset; /* IN: offset to start read/write */
510 size_t fbt_length; /* IN: number of bytes to transfer */
511 void *fbt_buffer; /* IN: buffer to be read/written */
512 } fbootstraptransfer_t;
513.Ed
514.Pp
515The
516.Dv F_LOG2PHYS
6d2010ae 517command operates on the following structure:
9bccf70c
A
518.ne 7v
519.Bd -literal
520 struct log2phys {
6d2010ae
A
521 u_int32_t l2p_flags; /* unused so far */
522 off_t l2p_contigbytes; /* unused so far */
523 off_t l2p_devoffset; /* bytes into device */
9bccf70c
A
524 };
525.Ed
6d2010ae
A
526.Pp
527The
528.Dv F_LOG2PHYS_EXT
529command operates on the same structure as F_LOG2PHYS but treats it as an in/out:
530.ne 7v
531.Bd -literal
532 struct log2phys {
533 u_int32_t l2p_flags; /* unused so far */
534 off_t l2p_contigbytes; /* IN: number of bytes to be queried;
535 OUT: number of contiguous bytes allocated at this position */
536 off_t l2p_devoffset; /* IN: bytes into file;
537 OUT: bytes into device */
538 };
539.Ed
540.Pp
541If
542.Fa fildes
543is a socket, then the
544.Dv F_SETNOSIGPIPE
545and
546.Dv F_GETNOSIGPIPE
547commands are directly analogous, and fully interoperate with the
548.Dv SO_NOSIGPIPE
549option of
550.Xr setsockopt 2
551and
552.Xr getsockopt 2
553respectively.
9bccf70c
A
554.Sh RETURN VALUES
555Upon successful completion, the value returned depends on
556.Fa cmd
557as follows:
558.Bl -tag -width F_GETOWNX -offset indent
559.It Dv F_DUPFD
560A new file descriptor.
561.It Dv F_GETFD
562Value of flag (only the low-order bit is defined).
563.It Dv F_GETFL
564Value of flags.
565.It Dv F_GETOWN
566Value of file descriptor owner.
567.It other
568Value other than -1.
569.El
570.Pp
571Otherwise, a value of -1 is returned and
572.Va errno
573is set to indicate the error.
574.Sh ERRORS
2d21ac55
A
575The
576.Fn fcntl
577system call will fail if:
9bccf70c 578.Bl -tag -width Er
2d21ac55 579.\" ==========
b0d623f7 580.It Bq Er EAGAIN
9bccf70c
A
581The argument
582.Fa cmd
583is
584.Dv F_SETLK ,
585the type of lock
586.Fa (l_type)
587is a shared lock
588.Dv (F_RDLCK)
589or exclusive lock
590.Dv (F_WRLCK) ,
591and the segment of a file to be locked is already
592exclusive-locked by another process;
593or the type is an exclusive lock and some portion of the
594segment of a file to be locked is already shared-locked or
595exclusive-locked by another process.
b0d623f7 596.It Bq Er EACCESS
9bccf70c
A
597The argument
598.Fa cmd
599is either
600.Dv F_SETSIZE
601or
602.Dv F_WRITEBOOTSTRAP
603and the calling process does not have root privileges.
2d21ac55 604.\" ==========
9bccf70c
A
605.It Bq Er EBADF
606.Fa Fildes
607is not a valid open file descriptor.
608.Pp
609The argument
610.Fa cmd
611is
612.Dv F_SETLK
613or
614.Dv F_SETLKW ,
615the type of lock
616.Fa (l_type)
617is a shared lock
618.Dv (F_RDLCK) ,
619and
620.Fa fildes
621is not a valid file descriptor open for reading.
622.Pp
623The argument
624.Fa cmd
625is
626.Dv F_SETLK
627or
628.Dv F_SETLKW ,
629the type of lock
630.Fa (l_type)
631is an exclusive lock
632.Dv (F_WRLCK) ,
633and
634.Fa fildes
635is not a valid file descriptor open for writing.
636.Pp
637The argument
638.Fa cmd
639is
640.Dv F_PREALLOCATE
641and the calling process does not have
642file write permission.
643.Pp
644The argument
645.Fa cmd
646is
647.Dv F_LOG2PHYS
6d2010ae
A
648or
649.Dv F_LOG2PHYS_EXT
9bccf70c
A
650and
651.Fa fildes
652is not a valid file descriptor open for reading.
2d21ac55 653.\" ==========
9bccf70c
A
654.It Bq Er EDEADLK
655The argument
656.Fa cmd
657is
658.Dv F_SETLKW ,
659and a deadlock condition was detected.
2d21ac55 660.\" ==========
9bccf70c
A
661.It Bq Er EINTR
662The argument
663.Fa cmd
664is
665.Dv F_SETLKW ,
666and the function was interrupted by a signal.
2d21ac55 667.\" ==========
9bccf70c
A
668.It Bq Er EINVAL
669.Fa Cmd
670is
671.Dv F_DUPFD
672and
673.Fa arg
674is negative or greater than the maximum allowable number
675(see
676.Xr getdtablesize 2 ) .
677.Pp
678The argument
679.Fa cmd
680is
681.Dv F_GETLK ,
682.Dv F_SETLK ,
683or
684.Dv F_SETLKW
685and the data to which
686.Fa arg
687points is not valid, or
688.Fa fildes
689refers to a file that does not support locking.
690.Pp
691The argument
692.Fa cmd
693is
694.Dv F_PREALLOCATE
695and the
696.Fa fst_posmode
697is not a valid mode,
698or when
699.Dv F_PEOFPOSMODE
700is set and
701.Fa fst_offset
702is a non-zero value,
703or when
704.Dv F_VOLPOSMODE
705is set and
706.Fa fst_offset
707is a negative or zero value.
708.Pp
709The argument
710.Fa cmd
711is either
712.Dv F_READBOOTSTRAP
713or
714.Dv F_WRITEBOOTSTRAP
715and the operation was attempted on a non-HFS disk type.
2d21ac55
A
716.\" ==========
717.It Bq Er EMFILE
718.Fa Cmd
719is
720.Dv F_DUPFD
721and the maximum allowed number of file descriptors are currently
722open.
723.\" ==========
9bccf70c
A
724.It Bq Er EMFILE
725The argument
726.Fa cmd
727is
728.Dv F_DUPED
729and the maximum number of file descriptors permitted for the
730process are already in use,
731or no file descriptors greater than or equal to
732.Fa arg
733are available.
2d21ac55 734.\" ==========
9bccf70c
A
735.It Bq Er ENOLCK
736The argument
737.Fa cmd
738is
739.Dv F_SETLK
740or
741.Dv F_SETLKW ,
742and satisfying the lock or unlock request would result in the
743number of locked regions in the system exceeding a system-imposed limit.
2d21ac55
A
744.\" ==========
745.It Bq Er EOVERFLOW
746A return value would overflow its representation.
747For example,
748.Fa cmd
749is F_GETLK, F_SETLK, or F_SETLKW
750and the smallest (or, if l_len is non-zero, the largest) offset
751of a byte in the requested segment
752will not fit in an object of type off_t.
753.\" ==========
9bccf70c
A
754.It Bq Er ESRCH
755.Fa Cmd
756is
757.Dv F_SETOWN
758and
759the process ID given as argument is not in use.
760.El
761.Sh SEE ALSO
762.Xr close 2 ,
763.Xr execve 2 ,
764.Xr flock 2 ,
765.Xr getdtablesize 2 ,
766.Xr open 2 ,
6d2010ae
A
767.Xr pipe 2 ,
768.Xr socket 2 ,
769.Xr setsockopt 2 ,
9bccf70c
A
770.Xr sigaction 3
771.Sh HISTORY
772The
773.Fn fcntl
774function call appeared in
775.Bx 4.2 .