]> git.saurik.com Git - apple/xnu.git/blame - bsd/man/man2/fcntl.2
xnu-3248.20.55.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
39236c6e
A
187to the current file offset. Note that if the
188file offset is not backed by physical blocks
189we can return -1 as the offset. This is subject
190to change.
6d2010ae
A
191.It Dv F_LOG2PHYS_EXT
192Variant of F_LOG2PHYS that uses the passed in
193file offset and length.
91447636
A
194.It Dv F_FULLFSYNC
195Does the same thing as
196.Xr fsync 2
197then asks the drive to
198flush all buffered data to
199the permanent storage device
200.Fa ( arg
201is ignored).
2d21ac55
A
202This is currently implemented on HFS, MS-DOS (FAT),
203and Universal Disk Format (UDF) file systems.
204The operation may take quite a while to complete.
205Certain FireWire drives have also been known
206to ignore the request to flush their buffered data.
6d2010ae
A
207.It Dv F_SETNOSIGPIPE
208Determines whether a
209.Dv SIGPIPE
210signal will be generated when a write fails on a pipe or socket for
211which there is no reader. If
212.Fa arg
213is non-zero,
214.Dv SIGPIPE
215generation is disabled for descriptor
216.Fa fildes ,
217while an
218.Fa arg
219of zero enables it (the default).
220.It Dv F_GETNOSIGPIPE
221Returns whether a
222.Dv SIGPIPE
223signal will be generated when a write fails on a pipe or socket
224for which there is no reader. The semantics of the return value
225match those of the
226.Fa arg
227of
228.Dv F_SETNOSIGPIPE .
229.El
230.Pp
231The flags for the
232.Dv F_GETFD
233and
234.Dv F_SETFD
235commands are as follows:
236.Bl -tag -width FD_CLOEXECX -offset indent
237.It Dv FD_CLOEXEC
238Close-on-exec; the given file descriptor will be automatically
239closed in the successor process image when one of the
240.Xr execv 2
241or
242.Xr posix_spawn 2
243family of system calls is invoked.
9bccf70c
A
244.El
245.Pp
246The flags for the
247.Dv F_GETFL
248and
249.Dv F_SETFL
250commands are as follows:
251.Bl -tag -width O_NONBLOCKX -offset indent
252.It Dv O_NONBLOCK
253Non-blocking I/O; if no data is available to a
254.Xr read
255call, or if a
256.Xr write
257operation would block,
258the read or write call returns -1 with the error
259.Er EAGAIN .
260.It Dv O_APPEND
261Force each write to append at the end of file;
262corresponds to the
263.Dv O_APPEND
264flag of
265.Xr open 2 .
266.It Dv O_ASYNC
267Enable the
268.Dv SIGIO
269signal to be sent to the process group
270when I/O is possible, e.g.,
271upon availability of data to be read.
272.El
273.Pp
274Several commands are available for doing advisory file locking;
275they all operate on the following structure:
276.ne 7v
277.Bd -literal
278 struct flock {
279 off_t l_start; /* starting offset */
280 off_t l_len; /* len = 0 means until end of file */
281 pid_t l_pid; /* lock owner */
282 short l_type; /* lock type: read/write, etc. */
283 short l_whence; /* type of l_start */
284 };
285.Ed
286.Pp
287The commands available for advisory record locking are as follows:
288.Bl -tag -width F_SETLKWX
289.It Dv F_GETLK
290Get the first lock that blocks the lock description pointed to by the
291third argument,
292.Fa arg ,
293taken as a pointer to a
294.Fa "struct flock"
295(see above).
296The information retrieved overwrites the information passed to
297.Nm fcntl
298in the
299.Fa flock
300structure.
301If no lock is found that would prevent this lock from being created,
302the structure is left unchanged by this function call except for the
303lock type which is set to
304.Dv F_UNLCK .
305.It Dv F_SETLK
306Set or clear a file segment lock according to the lock description
307pointed to by the third argument,
308.Fa arg ,
309taken as a pointer to a
310.Fa "struct flock"
311(see above).
312.Dv F_SETLK
313is used to establish shared (or read) locks
314.Dv (F_RDLCK)
315or exclusive (or write) locks,
316.Dv (F_WRLCK) ,
317as well as remove either type of lock
318.Dv (F_UNLCK) .
319If a shared or exclusive lock cannot be set,
320.Nm fcntl
321returns immediately with
b0d623f7 322.Er EAGAIN .
9bccf70c
A
323.It Dv F_SETLKW
324This command is the same as
325.Dv F_SETLK
326except that if a shared or exclusive lock is blocked by other locks,
327the process waits until the request can be satisfied.
328If a signal that is to be caught is received while
329.Nm fcntl
330is waiting for a region, the
331.Nm fcntl
332will be interrupted if the signal handler has not specified the
333.Dv SA_RESTART
334(see
335.Xr sigaction 2 ) .
336.El
337.Pp
338When a shared lock has been set on a segment of a file,
339other processes can set shared locks on that segment
340or a portion of it.
341A shared lock prevents any other process from setting an exclusive
342lock on any portion of the protected area.
343A request for a shared lock fails if the file descriptor was not
344opened with read access.
345.Pp
346An exclusive lock prevents any other process from setting a shared lock or
347an exclusive lock on any portion of the protected area.
348A request for an exclusive lock fails if the file was not
349opened with write access.
350.Pp
351The value of
352.Fa l_whence
353is
354.Dv SEEK_SET ,
355.Dv SEEK_CUR ,
356or
357.Dv SEEK_END
358to indicate that the relative offset,
359.Fa l_start
360bytes, will be measured from the start of the file,
361current position, or end of the file, respectively.
362The value of
363.Fa l_len
364is the number of consecutive bytes to be locked.
365If
366.Fa l_len
367is negative, the result is undefined.
368The
369.Fa l_pid
370field is only used with
371.Dv F_GETLK
372to return the process ID of the process holding a blocking lock.
373After a successful
374.Dv F_GETLK
375request, the value of
376.Fa l_whence
377is
378.Dv SEEK_SET .
379.Pp
380Locks may start and extend beyond the current end of a file,
381but may not start or extend before the beginning of the file.
382A lock is set to extend to the largest possible value of the
383file offset for that file if
384.Fa l_len
385is set to zero. If
386.Fa l_whence
387and
388.Fa l_start
389point to the beginning of the file, and
390.Fa l_len
391is zero, the entire file is locked.
392If an application wishes only to do entire file locking, the
393.Xr flock 2
394system call is much more efficient.
395.Pp
396There is at most one type of lock set for each byte in the file.
397Before a successful return from an
398.Dv F_SETLK
399or an
400.Dv F_SETLKW
401request when the calling process has previously existing locks
402on bytes in the region specified by the request,
403the previous lock type for each byte in the specified
404region is replaced by the new lock type.
405As specified above under the descriptions
406of shared locks and exclusive locks, an
407.Dv F_SETLK
408or an
409.Dv F_SETLKW
410request fails or blocks respectively when another process has existing
411locks on bytes in the specified region and the type of any of those
412locks conflicts with the type specified in the request.
413.Pp
414This interface follows the completely stupid semantics of System V and
415.St -p1003.1-88
416that require that all locks associated with a file for a given process are
417removed when \fIany\fP file descriptor for that file is closed by that process.
418This semantic means that applications must be aware of any files that
419a subroutine library may access.
420For example if an application for updating the password file locks the
421password file database while making the update, and then calls
422.Xr getpwname 3
423to retrieve a record,
424the lock will be lost because
425.Xr getpwname 3
426opens, reads, and closes the password database.
427The database close will release all locks that the process has
428associated with the database, even if the library routine never
429requested a lock on the database.
430Another minor semantic problem with this interface is that
431locks are not inherited by a child process created using the
432.Xr fork 2
433function.
434The
435.Xr flock 2
436interface has much more rational last close semantics and
437allows locks to be inherited by child processes.
438.Xr Flock 2
439is recommended for applications that want to ensure the integrity
440of their locks when using library routines or wish to pass locks
441to their children.
442Note that
443.Xr flock 2
444and
445.Xr fcntl 2
446locks may be safely used concurrently.
447.Pp
448All locks associated with a file for a given process are
449removed when the process terminates.
450.Pp
451A potential for deadlock occurs if a process controlling a locked region
452is put to sleep by attempting to lock the locked region of another process.
453This implementation detects that sleeping until a locked region is unlocked
454would cause a deadlock and fails with an
455.Er EDEADLK
456error.
457.Pp
458The
459.Dv F_PREALLOCATE
460command operates on the following structure:
461.ne 7v
462.Bd -literal
463 typedef struct fstore {
464 u_int32_t fst_flags; /* IN: flags word */
465 int fst_posmode; /* IN: indicates offset field */
466 off_t fst_offset; /* IN: start of the region */
467 off_t fst_length; /* IN: size of the region */
468 off_t fst_bytesalloc; /* OUT: number of bytes allocated */
469 } fstore_t;
470.Ed
471.Pp
472The flags (fst_flags) for the
473.Dv F_PREALLOCATE
474command are as follows:
475.Bl -tag -width F_ALLOCATECONTIGX -offset indent
476.It Dv F_ALLOCATECONTIG
477Allocate contiguous space.
478.It Dv F_ALLOCATEALL
479Allocate all requested space or no space at all.
480.El
481.Pp
482The position modes (fst_posmode) for the
483.Dv F_PREALLOCATE
484command indicate how to use the offset field.
485The modes are as follows:
486.Bl -tag -width F_PEOFPOSMODEX -offset indent
487.It Dv F_PEOFPOSMODE
488Allocate from the physical end of file.
489.It Dv F_VOLPOSMODE
490Allocate from the volume offset.
491.El
492.Pp
493The
494.Dv F_RDADVISE
495command operates on the following structure
496which holds information passed from the
497user to the system:
498.ne 7v
499.Bd -literal
500 struct radvisory {
501 off_t ra_offset; /* offset into the file */
502 int ra_count; /* size of the read */
503 };
504.Ed
505.Pp
506The
507.Dv F_READBOOTSTRAP and F_WRITEBOOTSTRAP
508commands operate on the following structure.
509.ne 7v
510.Bd -literal
511 typedef struct fbootstraptransfer {
512 off_t fbt_offset; /* IN: offset to start read/write */
513 size_t fbt_length; /* IN: number of bytes to transfer */
514 void *fbt_buffer; /* IN: buffer to be read/written */
515 } fbootstraptransfer_t;
516.Ed
517.Pp
518The
519.Dv F_LOG2PHYS
6d2010ae 520command operates on the following structure:
9bccf70c
A
521.ne 7v
522.Bd -literal
523 struct log2phys {
6d2010ae
A
524 u_int32_t l2p_flags; /* unused so far */
525 off_t l2p_contigbytes; /* unused so far */
526 off_t l2p_devoffset; /* bytes into device */
9bccf70c
A
527 };
528.Ed
6d2010ae
A
529.Pp
530The
531.Dv F_LOG2PHYS_EXT
532command operates on the same structure as F_LOG2PHYS but treats it as an in/out:
533.ne 7v
534.Bd -literal
535 struct log2phys {
536 u_int32_t l2p_flags; /* unused so far */
537 off_t l2p_contigbytes; /* IN: number of bytes to be queried;
538 OUT: number of contiguous bytes allocated at this position */
539 off_t l2p_devoffset; /* IN: bytes into file;
540 OUT: bytes into device */
541 };
542.Ed
543.Pp
544If
545.Fa fildes
546is a socket, then the
547.Dv F_SETNOSIGPIPE
548and
549.Dv F_GETNOSIGPIPE
550commands are directly analogous, and fully interoperate with the
551.Dv SO_NOSIGPIPE
552option of
553.Xr setsockopt 2
554and
555.Xr getsockopt 2
556respectively.
9bccf70c
A
557.Sh RETURN VALUES
558Upon successful completion, the value returned depends on
559.Fa cmd
560as follows:
561.Bl -tag -width F_GETOWNX -offset indent
562.It Dv F_DUPFD
563A new file descriptor.
564.It Dv F_GETFD
565Value of flag (only the low-order bit is defined).
566.It Dv F_GETFL
567Value of flags.
568.It Dv F_GETOWN
569Value of file descriptor owner.
570.It other
571Value other than -1.
572.El
573.Pp
574Otherwise, a value of -1 is returned and
575.Va errno
576is set to indicate the error.
577.Sh ERRORS
2d21ac55
A
578The
579.Fn fcntl
580system call will fail if:
9bccf70c 581.Bl -tag -width Er
2d21ac55 582.\" ==========
b0d623f7 583.It Bq Er EAGAIN
9bccf70c
A
584The argument
585.Fa cmd
586is
587.Dv F_SETLK ,
588the type of lock
589.Fa (l_type)
590is a shared lock
591.Dv (F_RDLCK)
592or exclusive lock
593.Dv (F_WRLCK) ,
594and the segment of a file to be locked is already
595exclusive-locked by another process;
596or the type is an exclusive lock and some portion of the
597segment of a file to be locked is already shared-locked or
598exclusive-locked by another process.
b0d623f7 599.It Bq Er EACCESS
9bccf70c
A
600The argument
601.Fa cmd
602is either
603.Dv F_SETSIZE
604or
605.Dv F_WRITEBOOTSTRAP
606and the calling process does not have root privileges.
2d21ac55 607.\" ==========
9bccf70c
A
608.It Bq Er EBADF
609.Fa Fildes
610is not a valid open file descriptor.
611.Pp
612The argument
613.Fa cmd
614is
615.Dv F_SETLK
616or
617.Dv F_SETLKW ,
618the type of lock
619.Fa (l_type)
620is a shared lock
621.Dv (F_RDLCK) ,
622and
623.Fa fildes
624is not a valid file descriptor open for reading.
625.Pp
626The argument
627.Fa cmd
628is
629.Dv F_SETLK
630or
631.Dv F_SETLKW ,
632the type of lock
633.Fa (l_type)
634is an exclusive lock
635.Dv (F_WRLCK) ,
636and
637.Fa fildes
638is not a valid file descriptor open for writing.
639.Pp
640The argument
641.Fa cmd
642is
643.Dv F_PREALLOCATE
644and the calling process does not have
645file write permission.
646.Pp
647The argument
648.Fa cmd
649is
650.Dv F_LOG2PHYS
6d2010ae
A
651or
652.Dv F_LOG2PHYS_EXT
9bccf70c
A
653and
654.Fa fildes
655is not a valid file descriptor open for reading.
2d21ac55 656.\" ==========
9bccf70c
A
657.It Bq Er EDEADLK
658The argument
659.Fa cmd
660is
661.Dv F_SETLKW ,
662and a deadlock condition was detected.
2d21ac55 663.\" ==========
9bccf70c
A
664.It Bq Er EINTR
665The argument
666.Fa cmd
667is
668.Dv F_SETLKW ,
669and the function was interrupted by a signal.
2d21ac55 670.\" ==========
9bccf70c
A
671.It Bq Er EINVAL
672.Fa Cmd
673is
674.Dv F_DUPFD
675and
676.Fa arg
677is negative or greater than the maximum allowable number
678(see
679.Xr getdtablesize 2 ) .
680.Pp
681The argument
682.Fa cmd
683is
684.Dv F_GETLK ,
685.Dv F_SETLK ,
686or
687.Dv F_SETLKW
688and the data to which
689.Fa arg
690points is not valid, or
691.Fa fildes
692refers to a file that does not support locking.
693.Pp
694The argument
695.Fa cmd
696is
697.Dv F_PREALLOCATE
698and the
699.Fa fst_posmode
700is not a valid mode,
701or when
702.Dv F_PEOFPOSMODE
703is set and
704.Fa fst_offset
705is a non-zero value,
706or when
707.Dv F_VOLPOSMODE
708is set and
709.Fa fst_offset
710is a negative or zero value.
711.Pp
712The argument
713.Fa cmd
714is either
715.Dv F_READBOOTSTRAP
716or
717.Dv F_WRITEBOOTSTRAP
718and the operation was attempted on a non-HFS disk type.
2d21ac55
A
719.\" ==========
720.It Bq Er EMFILE
721.Fa Cmd
722is
723.Dv F_DUPFD
724and the maximum allowed number of file descriptors are currently
725open.
726.\" ==========
9bccf70c
A
727.It Bq Er EMFILE
728The argument
729.Fa cmd
730is
731.Dv F_DUPED
732and the maximum number of file descriptors permitted for the
733process are already in use,
734or no file descriptors greater than or equal to
735.Fa arg
736are available.
2d21ac55 737.\" ==========
9bccf70c
A
738.It Bq Er ENOLCK
739The argument
740.Fa cmd
741is
742.Dv F_SETLK
743or
744.Dv F_SETLKW ,
745and satisfying the lock or unlock request would result in the
746number of locked regions in the system exceeding a system-imposed limit.
2d21ac55
A
747.\" ==========
748.It Bq Er EOVERFLOW
749A return value would overflow its representation.
750For example,
751.Fa cmd
752is F_GETLK, F_SETLK, or F_SETLKW
753and the smallest (or, if l_len is non-zero, the largest) offset
754of a byte in the requested segment
755will not fit in an object of type off_t.
756.\" ==========
9bccf70c
A
757.It Bq Er ESRCH
758.Fa Cmd
759is
760.Dv F_SETOWN
761and
762the process ID given as argument is not in use.
763.El
764.Sh SEE ALSO
765.Xr close 2 ,
766.Xr execve 2 ,
767.Xr flock 2 ,
768.Xr getdtablesize 2 ,
769.Xr open 2 ,
6d2010ae
A
770.Xr pipe 2 ,
771.Xr socket 2 ,
772.Xr setsockopt 2 ,
9bccf70c
A
773.Xr sigaction 3
774.Sh HISTORY
775The
776.Fn fcntl
777function call appeared in
778.Bx 4.2 .