diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/sys/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/sys/Symbol.map | 3 | ||||
-rw-r--r-- | lib/libc/sys/close.2 | 1 | ||||
-rw-r--r-- | lib/libc/sys/closefrom.2 | 53 |
4 files changed, 58 insertions, 1 deletions
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index a238efc..7e65aa4 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -63,7 +63,7 @@ MAN+= abort2.2 accept.2 access.2 acct.2 adjtime.2 \ aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \ aio_suspend.2 aio_waitcomplete.2 aio_write.2 \ bind.2 brk.2 chdir.2 chflags.2 \ - chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 \ + chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 closefrom.2 \ connect.2 cpuset.2 cpuset_getaffinity.2 dup.2 execve.2 _exit.2 \ extattr_get_file.2 fcntl.2 fhopen.2 flock.2 fork.2 fsync.2 \ getdirentries.2 getdtablesize.2 \ diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map index 48ef400..9e19899 100644 --- a/lib/libc/sys/Symbol.map +++ b/lib/libc/sys/Symbol.map @@ -333,6 +333,7 @@ FBSD_1.0 { }; FBSD_1.1 { + closefrom; cpuset; cpuset_getid; cpuset_setid; @@ -472,6 +473,8 @@ FBSDprivate_1.0 { __sys_clock_settime; _close; __sys_close; + _closefrom; + __sys_closefrom; _connect; __sys_connect; _cpuset; diff --git a/lib/libc/sys/close.2 b/lib/libc/sys/close.2 index aef0379..524322b 100644 --- a/lib/libc/sys/close.2 +++ b/lib/libc/sys/close.2 @@ -120,6 +120,7 @@ before all pending data was delivered. .El .Sh SEE ALSO .Xr accept 2 , +.Xr closefrom 2 , .Xr execve 2 , .Xr fcntl 2 , .Xr flock 2 , diff --git a/lib/libc/sys/closefrom.2 b/lib/libc/sys/closefrom.2 new file mode 100644 index 0000000..ffaa001 --- /dev/null +++ b/lib/libc/sys/closefrom.2 @@ -0,0 +1,53 @@ +.\" Copyright (c) 2009 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin <jhb@FreeBSD.org> +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 12, 2009 +.Dt CLOSEFROM 2 +.Os +.Sh NAME +.Nm closefrom +.Nd delete open file descriptors +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft void +.Fn closefrom "int lowfd" +.Sh DESCRIPTION +The +.Fn closefrom +system call deletes all open file descriptors greater than or equal to +.Fa lowfd +from the per-process object reference table. +Any errors encountered while closing file descriptors are ignored. +.Sh SEE ALSO +.Xr close 2 +.Sh HISTORY +The +.Fn closefrom +function first appeared in +.Fx 8.0 . |