diff --git a/src/lib/libc/gen/alarm.3 b/src/lib/libc/gen/alarm.3 deleted file mode 100644 index e9be94f..0000000 --- a/src/lib/libc/gen/alarm.3 +++ /dev/null @@ -1,98 +0,0 @@ -.\" Copyright (c) 1980, 1991, 1993, 1994 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)alarm.3 8.2 (Berkeley) 4/19/94 -.\" $FreeBSD: src/lib/libc/gen/alarm.3,v 1.16 2002/12/18 13:33:02 ru Exp $ -.\" -.Dd April 19, 1994 -.Dt ALARM 3 -.Os -.Sh NAME -.Nm alarm -.Nd set signal timer alarm -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft unsigned int -.Fn alarm "unsigned int seconds" -.Sh DESCRIPTION -.Bf -symbolic -This interface is made obsolete by -.Xr setitimer 2 . -.Ef -.Pp -The -.Fn alarm -function sets a timer to deliver the signal -.Dv SIGALRM -to the calling process after the specified number of -.Fa seconds . -If an alarm has already been set with -.Fn alarm -but has not been delivered, another call to -.Fn alarm -will supersede the prior call. -The request -.Fn alarm "0" -voids the current -alarm and the signal SIGALRM will not be delivered. -.Pp -Due to -.Xr setitimer 2 -restriction the maximum number of -.Fa seconds -allowed is 100000000. -.Sh RETURN VALUES -The return value of -.Fn alarm -is the amount of time left on the timer from a previous call to -.Fn alarm . -If no alarm is currently set, the return value is 0. -.Sh SEE ALSO -.Xr setitimer 2 , -.Xr sigaction 2 , -.Xr sigpause 2 , -.Xr sigvec 2 , -.Xr signal 3 , -.Xr sleep 3 , -.Xr ualarm 3 , -.Xr usleep 3 -.\" .Sh STANDARDS -.\" The -.\" .Fn alarm -.\" function conforms to -.\" .St -p1003.1-90 . -.Sh HISTORY -An -.Fn alarm -function appeared in -.At v7 . diff --git a/src/lib/libc/gen/arc4random.3 b/src/lib/libc/gen/arc4random.3 deleted file mode 100644 index 3e2aaa3..0000000 --- a/src/lib/libc/gen/arc4random.3 +++ /dev/null @@ -1,107 +0,0 @@ -.\" $OpenBSD: arc4random.3,v 1.2 1997/04/27 22:40:25 angelos Exp $ -.\" Copyright 1997 Niels Provos -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by Niels Provos. -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. -.\" -.\" Manual page, using -mandoc macros -.\" $FreeBSD: src/lib/libc/gen/arc4random.3,v 1.16 2003/07/31 06:18:24 das Exp $ -.\" -.Dd April 15, 1997 -.Dt ARC4RANDOM 3 -.Os -.Sh NAME -.Nm arc4random , -.Nm arc4random_stir , -.Nm arc4random_addrandom -.Nd arc4 random number generator -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In stdlib.h -.Ft u_int32_t -.Fn arc4random "void" -.Ft void -.Fn arc4random_stir "void" -.Ft void -.Fn arc4random_addrandom "unsigned char *dat" "int datlen" -.Sh DESCRIPTION -The -.Fn arc4random -function uses the key stream generator employed by the -arc4 cipher, which uses 8*8 8 bit S-Boxes. -The S-Boxes -can be in about -.if t 2\u\s71700\s10\d -.if n (2**1700) -states. -The -.Fn arc4random -function returns pseudo-random numbers in the range of 0 to -.if t 2\u\s731\s10\d\(mi1, -.if n (2**32)\(mi1, -and therefore has twice the range of -.Xr rand 3 -and -.Xr random 3 . -.Pp -The -.Fn arc4random_stir -function reads data from -.Pa /dev/urandom -and uses it to permute the S-Boxes via -.Fn arc4random_addrandom . -.Pp -There is no need to call -.Fn arc4random_stir -before using -.Fn arc4random , -since -.Fn arc4random -automatically initializes itself. -.Sh EXAMPLES -The following produces a drop-in replacement for the traditional -.Fn rand -and -.Fn random -functions using -.Fn arc4random : -.Pp -.Dl "#define foo4random() (arc4random() % ((unsigned)RAND_MAX + 1))" -.Sh SEE ALSO -.Xr rand 3 , -.Xr random 3 , -.Xr srandomdev 3 -.Sh HISTORY -.Pa RC4 -has been designed by RSA Data Security, Inc. -It was posted anonymously -to the USENET and was confirmed to be equivalent by several sources who -had access to the original cipher. -Since -.Pa RC4 -used to be a trade secret, the cipher is now referred to as -.Pa ARC4 . diff --git a/src/lib/libc/gen/basename.3 b/src/lib/libc/gen/basename.3 deleted file mode 100644 index 374bac0..0000000 --- a/src/lib/libc/gen/basename.3 +++ /dev/null @@ -1,103 +0,0 @@ -.\" -.\" Copyright (c) 1997 Todd C. Miller -.\" 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. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED ``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 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. -.\" -.\" $OpenBSD: basename.3,v 1.12 2000/04/18 03:01:25 aaron Exp $ -.\" $FreeBSD: src/lib/libc/gen/basename.3,v 1.6 2002/12/18 13:33:02 ru Exp $ -.\" -.Dd August 17, 1997 -.Dt BASENAME 3 -.Os -.Sh NAME -.Nm basename -.Nd extract the base portion of a pathname -.Sh SYNOPSIS -.In libgen.h -.Ft char * -.Fn basename "const char *path" -.Sh DESCRIPTION -The -.Fn basename -function -returns the last component from the pathname pointed to by -.Fa path , -deleting any trailing -.Sq \&/ -characters. -If -.Fa path -consists entirely of -.Sq \&/ -characters, a pointer to the string -.Qq \&/ -is returned. -If -.Fa path -is a null pointer or the empty string, a pointer to the string -.Qq \&. -is returned. -.Sh RETURN VALUES -On successful completion, -.Fn basename -returns a pointer to the last component of -.Fa path . -.Pp -If -.Fn basename -fails, a null pointer is returned and the global variable -.Va errno -is set to indicate the error. -.Sh ERRORS -The following error codes may be set in -.Va errno : -.Bl -tag -width Er -.It Bq Er ENAMETOOLONG -The path component to be returned was larger than -.Dv MAXPATHLEN . -.El -.Sh WARNINGS -The -.Fn basename -function -returns a pointer to internal static storage space that will be overwritten -by subsequent calls. -.Sh SEE ALSO -.Xr basename 1 , -.Xr dirname 1 , -.Xr dirname 3 -.Sh STANDARDS -The -.Fn basename -function conforms to -.St -xpg4.2 . -.Sh HISTORY -The -.Fn basename -function first appeared in -.Ox 2.2 -and -.Fx 4.2 . -.Sh AUTHORS -Todd C. Miller diff --git a/src/lib/libc/gen/check_utility_compat.3 b/src/lib/libc/gen/check_utility_compat.3 deleted file mode 100644 index 0768d6d..0000000 --- a/src/lib/libc/gen/check_utility_compat.3 +++ /dev/null @@ -1,89 +0,0 @@ -.\" -.\" Copyright 2002 Massachusetts Institute of Technology -.\" -.\" Permission to use, copy, modify, and distribute this software and -.\" its documentation for any purpose and without fee is hereby -.\" granted, provided that both the above copyright notice and this -.\" permission notice appear in all copies, that both the above -.\" copyright notice and this permission notice appear in all -.\" supporting documentation, and that the name of M.I.T. not be used -.\" in advertising or publicity pertaining to distribution of the -.\" software without specific, written prior permission. M.I.T. makes -.\" no representations about the suitability of this software for any -.\" purpose. It is provided "as is" without express or implied -.\" warranty. -.\" -.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS -.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, -.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT -.\" SHALL M.I.T. 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: src/lib/libc/gen/check_utility_compat.3,v 1.2 2002/12/04 15:47:41 ru Exp $ -.\" -.Dd October 27, 2002 -.Os -.Dt CHECK_UTILITY_COMPAT 3 -.Sh NAME -.Nm check_utility_compat -.Nd "determine whether a utility should be compatible" -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft int -.Fn check_utility_compat "const char *utility" -.Sh DESCRIPTION -The -.Fn check_utility_compat -function checks whether -.Fa utility -should behave in a traditional -.Pq Fx 4.7 Ns -compatible -manner, or in accordance with -.St -p1003.1-2001 . -The configuration is given as a comma-separated list of utility names; -if the list is present but empty, all supported utilities assume their -most compatible mode. -The -.Fn check_utility_compat -function first checks for an environment variable named -.Ev _COMPAT_FreeBSD_4 . -If that environment variable does not exist, then -.Fn check_utility_compat -will attempt to read the contents of a symbolic link named -.Pa /etc/compat-FreeBSD-4-util . -If no configuration is found, compatibility mode is disabled. -.Sh RETURN VALUES -The -.Fn check_utility_compat -function returns zero if -.Fa utility -should implement strict -.St -p1003.1-2001 -behavior, and nonzero otherwise. -.Sh ERRORS -No errors are detected. -.Sh FILES -.Bl -tag -width ".Pa /etc/compat-FreeBSD-4-util" -.It Pa /etc/compat-FreeBSD-4-util -If present, a symbolic link whose expansion gives system-wide default settings -for the -.Fn check_utility_compat -function. -.El -.Sh HISTORY -The -.Fn check_utility_compat -function first appeared in -.Fx 5.0 . -.Sh AUTHORS -This manual page was written by -.An Garrett Wollman Aq wollman@FreeBSD.org . diff --git a/src/lib/libc/gen/clock.3 b/src/lib/libc/gen/clock.3 deleted file mode 100644 index cff60dc..0000000 --- a/src/lib/libc/gen/clock.3 +++ /dev/null @@ -1,80 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" the American National Standards Committee X3, on Information -.\" Processing Systems. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)clock.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/clock.3,v 1.11 2001/11/20 13:43:58 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt CLOCK 3 -.Os -.Sh NAME -.Nm clock -.Nd determine processor time used -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In time.h -.Ft clock_t -.Fn clock void -.Sh DESCRIPTION -The -.Fn clock -function -determines the amount of processor time used since the invocation of the -calling process, measured in -.Dv CLOCKS_PER_SEC Ns s -of a second. -.Sh RETURN VALUES -The -.Fn clock -function returns the amount of time used unless an error occurs, in which -case the return value is \-1. -.Sh SEE ALSO -.Xr getrusage 2 , -.Xr clocks 7 -.Sh STANDARDS -The -.Fn clock -function conforms to -.St -isoC . -However, -.St -susv2 -requires -.Dv CLOCKS_PER_SEC -to be defined as one million. -.Fx -does not conform to this requirement; -changing the value would introduce binary incompatibility -and one million is still inadequate on modern processors. diff --git a/src/lib/libc/gen/confstr.3 b/src/lib/libc/gen/confstr.3 deleted file mode 100644 index 65a005c..0000000 --- a/src/lib/libc/gen/confstr.3 +++ /dev/null @@ -1,135 +0,0 @@ -.\" Copyright (c) 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)confstr.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/confstr.3,v 1.13 2003/09/08 19:57:14 ru Exp $ -.\" -.Dd June 18, 2001 -.Dt CONFSTR 3 -.Os -.Sh NAME -.Nm confstr -.Nd get string-valued configurable variables -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft size_t -.Fn confstr "int name" "char *buf" "size_t len" -.Sh DESCRIPTION -This interface is specified by -.St -p1003.1-2001 . -A more flexible (but non-portable) interface is provided by -.Xr sysctl 3 . -.Pp -The -.Fn confstr -function provides a method for applications to get configuration -defined string values. -Shell programmers needing access to these parameters should use the -.Xr getconf 1 -utility. -.Pp -The -.Fa name -argument specifies the system variable to be queried. -Symbolic constants for each name value are found in the include file -.In unistd.h . -The -.Fa len -argument specifies the size of the buffer referenced by the -argument -.Fa buf . -If -.Fa len -is non-zero, -.Fa buf -is a non-null pointer, and -.Fa name -has a value, up to -.Fa len -\- 1 bytes of the value are copied into the buffer -.Fa buf . -The copied value is always null terminated. -.Pp -The available values are as follows: -.Pp -.Bl -tag -width 6n -.Pp -.It Li _CS_PATH -Return a value for the -.Ev PATH -environment variable that finds all the standard utilities. -.El -.Sh RETURN VALUES -If the call to -.Fn confstr -is not successful, \-1 is returned and -.Va errno -is set appropriately. -Otherwise, if the variable does not have a configuration defined value, -0 is returned and -.Va errno -is not modified. -Otherwise, the buffer size needed to hold the entire configuration-defined -value is returned. -If this size is greater than the argument -.Fa len , -the string in -.Fa buf -was truncated. -.Sh ERRORS -The -.Fn confstr -function may fail and set -.Va errno -for any of the errors specified for the library functions -.Xr malloc 3 -and -.Xr sysctl 3 . -.Pp -In addition, the following errors may be reported: -.Bl -tag -width Er -.It Bq Er EINVAL -The value of the -.Fa name -argument is invalid. -.El -.Sh SEE ALSO -.Xr getconf 1 , -.Xr pathconf 2 , -.Xr sysconf 3 , -.Xr sysctl 3 -.Sh HISTORY -The -.Fn confstr -function first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/gen/ctermid.3 b/src/lib/libc/gen/ctermid.3 deleted file mode 100644 index c36d55f..0000000 --- a/src/lib/libc/gen/ctermid.3 +++ /dev/null @@ -1,111 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)ctermid.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/ctermid.3,v 1.11 2003/09/08 19:57:14 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt CTERMID 3 -.Os -.Sh NAME -.Nm ctermid -.Nd generate terminal pathname -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In stdio.h -.Ft char * -.Fn ctermid "char *buf" -.Ft char * -.Fn ctermid_r "char *buf" -.Sh DESCRIPTION -The -.Fn ctermid -function generates a string, that, when used as a pathname, refers to -the current controlling terminal of the calling process. -.Pp -If -.Fa buf -is the -.Dv NULL -pointer, a pointer to a static area is returned. -Otherwise, the pathname is copied into the memory referenced by -.Fa buf . -The argument -.Fa buf -is assumed to be at least -.Dv L_ctermid -(as defined in the include -file -.In stdio.h ) -bytes long. -.Pp -The -.Fn ctermid_r -function -provides the same functionality as -.Fn ctermid -except that if -.Fa buf -is a -.Dv NULL -pointer, -.Dv NULL -is returned. -.Pp -The current implementation simply returns -.Ql /dev/tty . -.Sh RETURN VALUES -Upon successful completion, a -.Pf non- Dv NULL -pointer is returned. -Otherwise, a -.Dv NULL -pointer is returned and the global variable -.Va errno -is set to indicate the error. -.Sh ERRORS -The current implementation detects no error conditions. -.Sh SEE ALSO -.Xr ttyname 3 -.Sh STANDARDS -The -.Fn ctermid -function conforms to -.St -p1003.1-88 . -.Sh BUGS -By default the -.Fn ctermid -function -writes all information to an internal static object. -Subsequent calls to -.Fn ctermid -will modify the same object. diff --git a/src/lib/libc/gen/daemon.3 b/src/lib/libc/gen/daemon.3 deleted file mode 100644 index 04e0a51..0000000 --- a/src/lib/libc/gen/daemon.3 +++ /dev/null @@ -1,116 +0,0 @@ -.\" Copyright (c) 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)daemon.3 8.1 (Berkeley) 6/9/93 -.\" $FreeBSD: src/lib/libc/gen/daemon.3,v 1.14 2003/11/10 22:04:51 ghelmer Exp $ -.\" -.Dd June 9, 1993 -.Dt DAEMON 3 -.Os -.Sh NAME -.Nm daemon -.Nd run in the background -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In stdlib.h -.Ft int -.Fn daemon "int nochdir" "int noclose" -.Sh DESCRIPTION -The -.Fn daemon -function is for programs wishing to detach themselves from the -controlling terminal and run in the background as system daemons. -.Pp -Unless the argument -.Fa nochdir -is non-zero, -.Fn daemon -changes the current working directory to the root -.Pq Pa / . -.Pp -Unless the argument -.Fa noclose -is non-zero, -.Fn daemon -will redirect standard input, standard output, and standard error to -.Pa /dev/null . -.Sh RETURN VALUES -.Rv -std daemon -.Sh ERRORS -The -.Fn daemon -function may fail and set -.Va errno -for any of the errors specified for the library functions -.Xr fork 2 -and -.Xr setsid 2 . -.Sh SEE ALSO -.Xr fork 2 , -.Xr setsid 2 , -.Xr sigaction 2 -.Sh HISTORY -The -.Fn daemon -function first appeared in -.Bx 4.4 . -.Sh CAVEATS -Unless the -.Fa noclose -argument is non-zero, -.Fn daemon -will close the first three file descriptors and redirect them to -.Pa /dev/null . -Normally, these correspond to standard input, standard output, and -standard error. -However, if any of those file descriptors refer to something else, they -will still be closed, resulting in incorrect behavior of the calling program. -This can happen if any of standard input, standard output, or standard -error have been closed before the program was run. -Programs using -.Fn daemon -should therefore either call -.Fn daemon -before opening any files or sockets, or verify that any file -descriptors obtained have values greater than 2. -.Pp -The -.Fn daemon -function temporarily ignores -.Dv SIGHUP -while calling -.Xr setsid 2 -to prevent a parent session group leader's calls to -.Xr fork 2 -and then -.Xr _exit 2 -from prematurely terminating the child process. diff --git a/src/lib/libc/gen/devname.3 b/src/lib/libc/gen/devname.3 deleted file mode 100644 index 84627e9..0000000 --- a/src/lib/libc/gen/devname.3 +++ /dev/null @@ -1,87 +0,0 @@ -.\" Copyright (c) 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)devname.3 8.2 (Berkeley) 4/29/95 -.\" $FreeBSD: src/lib/libc/gen/devname.3,v 1.17 2003/09/12 21:54:10 ru Exp $ -.\" -.Dd July 18, 1999 -.Dt DEVNAME 3 -.Os -.Sh NAME -.Nm devname -.Nd get device name -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/stat.h -.In stdlib.h -.Ft char * -.Fn devname "dev_t dev" "mode_t type" -.Ft char * -.Fn devname_r "dev_t dev" "mode_t type" "char *buf" "int len" -.Sh DESCRIPTION -The -.Fn devname -function returns a pointer to the name of the block or character -device in -.Pa /dev -with a device number of -.Fa dev , -and a file type matching the one encoded in -.Fa type -which must be one of -.Dv S_IFBLK -or -.Dv S_IFCHR . -To find the right name, -.Fn devname -asks the kernel via the -.Va kern.devname -sysctl. -If it is unable to come up with a suitable name, -it will format the information encapsulated in -.Fa dev -and -.Fa type -in a human-readable format. -.Pp -.Fn devname -returns the name stored in a static buffer which will be overwritten -on subsequent calls. -.Fn devname_r -takes a buffer and length as argument to avoid this problem. -.Sh SEE ALSO -.Xr stat 2 -.Sh HISTORY -The -.Fn devname -function appeared in -.Bx 4.4 . diff --git a/src/lib/libc/gen/directory.3 b/src/lib/libc/gen/directory.3 deleted file mode 100644 index 6a35880..0000000 --- a/src/lib/libc/gen/directory.3 +++ /dev/null @@ -1,204 +0,0 @@ -.\" Copyright (c) 1983, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)directory.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/directory.3,v 1.13 2002/12/18 10:13:53 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt DIRECTORY 3 -.Os -.Sh NAME -.Nm opendir , -.Nm readdir , -.Nm readdir_r , -.Nm telldir , -.Nm seekdir , -.Nm rewinddir , -.Nm closedir , -.Nm dirfd -.Nd directory operations -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In dirent.h -.Ft DIR * -.Fn opendir "const char *filename" -.Ft struct dirent * -.Fn readdir "DIR *dirp" -.Ft int -.Fn readdir_r "DIR *dirp" "struct dirent *entry" "struct dirent **result" -.Ft long -.Fn telldir "DIR *dirp" -.Ft void -.Fn seekdir "DIR *dirp" "long loc" -.Ft void -.Fn rewinddir "DIR *dirp" -.Ft int -.Fn closedir "DIR *dirp" -.Ft int -.Fn dirfd "DIR *dirp" -.Sh DESCRIPTION -The -.Fn opendir -function -opens the directory named by -.Fa filename , -associates a -.Em directory stream -with it -and -returns a pointer to be used to identify the -.Em directory stream -in subsequent operations. The pointer -.Dv NULL -is returned if -.Fa filename -cannot be accessed, or if it cannot -.Xr malloc 3 -enough memory to hold the whole thing. -.Pp -The -.Fn readdir -function -returns a pointer to the next directory entry. It returns -.Dv NULL -upon reaching the end of the directory or detecting an invalid -.Fn seekdir -operation. -.Pp -The -.Fn readdir_r -function -provides the same functionality as -.Fn readdir , -but the caller must provide a directory -.Fa entry -buffer to store the results in. If the read succeeds, -.Fa result -is pointed at the -.Fa entry ; -upon reaching the end of the directory -.Fa result -is set to -.Dv NULL . -The -.Fn readdir_r -function -returns 0 on success or an error number to indicate failure. -.Pp -The -.Fn telldir -function -returns the current location associated with the named -.Em directory stream . -Values returned by -.Fn telldir -are good only for the lifetime of the -.Dv DIR -pointer, -.Fa dirp , -from which they are derived. If the directory is closed and then -reopened, prior values returned by -.Fn telldir -will no longer be valid. -.Pp -The -.Fn seekdir -function -sets the position of the next -.Fn readdir -operation on the -.Em directory stream . -The new position reverts to the one associated with the -.Em directory stream -when the -.Fn telldir -operation was performed. -.Pp -The -.Fn rewinddir -function -resets the position of the named -.Em directory stream -to the beginning of the directory. -.Pp -The -.Fn closedir -function -closes the named -.Em directory stream -and frees the structure associated with the -.Fa dirp -pointer, -returning 0 on success. -On failure, \-1 is returned and the global variable -.Va errno -is set to indicate the error. -.Pp -The -.Fn dirfd -function -returns the integer file descriptor associated with the named -.Em directory stream , -see -.Xr open 2 . -.Pp -Sample code which searches a directory for entry ``name'' is: -.Bd -literal -offset indent -len = strlen(name); -dirp = opendir("."); -while ((dp = readdir(dirp)) != NULL) - if (dp->d_namlen == len && !strcmp(dp->d_name, name)) { - (void)closedir(dirp); - return FOUND; - } -(void)closedir(dirp); -return NOT_FOUND; -.Ed -.Sh SEE ALSO -.Xr close 2 , -.Xr lseek 2 , -.Xr open 2 , -.Xr read 2 , -.Xr dir 5 -.Sh HISTORY -The -.Fn opendir , -.Fn readdir , -.Fn telldir , -.Fn seekdir , -.Fn rewinddir , -.Fn closedir , -and -.Fn dirfd -functions appeared in -.Bx 4.2 . diff --git a/src/lib/libc/gen/dirname.3 b/src/lib/libc/gen/dirname.3 deleted file mode 100644 index 5947140..0000000 --- a/src/lib/libc/gen/dirname.3 +++ /dev/null @@ -1,110 +0,0 @@ -.\" -.\" Copyright (c) 1997 Todd C. Miller -.\" 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. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED ``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 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. -.\" -.\" $OpenBSD: dirname.3,v 1.9 2000/04/18 03:01:25 aaron Exp $ -.\" $FreeBSD: src/lib/libc/gen/dirname.3,v 1.7 2002/12/27 12:15:28 schweikh Exp $ -.\" -.Dd August 17, 1997 -.Dt DIRNAME 3 -.Os -.Sh NAME -.Nm dirname -.Nd extract the directory part of a pathname -.Sh SYNOPSIS -.In libgen.h -.Ft char * -.Fn dirname "const char *path" -.Sh DESCRIPTION -The -.Fn dirname -function -is the converse of -.Xr basename 3 ; -it returns a pointer to the parent directory of the pathname pointed to by -.Fa path . -Any trailing -.Sq \&/ -characters are not counted as part of the directory -name. -If -.Fa path -is a null pointer, the empty string, or contains no -.Sq \&/ -characters, -.Fn dirname -returns a pointer to the string -.Qq \&. , -signifying the current directory. -.Sh RETURN VALUES -On successful completion, -.Fn dirname -returns a pointer to the parent directory of -.Fa path . -.Pp -If -.Fn dirname -fails, a null pointer is returned and the global variable -.Va errno -is set to indicate the error. -.Sh ERRORS -The following error codes may be set in -.Va errno : -.Bl -tag -width Er -.It Bq Er ENAMETOOLONG -The path component to be returned was larger than -.Dv MAXPATHLEN . -.El -.Sh WARNINGS -The -.Fn dirname -function -returns a pointer to internal static storage space that will be overwritten -by subsequent calls (each function has its own separate storage). -.Pp -Other vendor implementations of -.Fn dirname -may modify the contents of the string passed to -.Fn dirname ; -this should be taken into account when writing code which calls this function -if portability is desired. -.Sh SEE ALSO -.Xr basename 1 , -.Xr dirname 1 , -.Xr basename 3 -.Sh STANDARDS -The -.Fn dirname -function conforms to -.St -xpg4.2 . -.Sh HISTORY -The -.Fn dirname -function first appeared in -.Ox 2.2 -and -.Fx 4.2 . -.Sh AUTHORS -Todd C. Miller diff --git a/src/lib/libc/gen/dladdr.3 b/src/lib/libc/gen/dladdr.3 deleted file mode 100644 index 7c77704..0000000 --- a/src/lib/libc/gen/dladdr.3 +++ /dev/null @@ -1,127 +0,0 @@ -.\" -.\" Copyright (c) 1998 John D. Polstra -.\" 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: src/lib/libc/gen/dladdr.3,v 1.7 2002/12/18 10:13:53 ru Exp $ -.\" -.Dd February 5, 1998 -.Os -.Dt DLADDR 3 -.Sh NAME -.Nm dladdr -.Nd find the shared object containing a given address -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In dlfcn.h -.Ft int -.Fn dladdr "const void *addr" "Dl_info *info" -.Sh DESCRIPTION -The -.Fn dladdr -function -queries the dynamic linker for information about the shared object -containing the address -.Fa addr . -The information is returned in the structure specified by -.Fa info . -The structure contains at least the following members: -.Bl -tag -width "XXXconst char *dli_fname" -.It Li "const char *dli_fname" -The pathname of the shared object containing the address. -.It Li "void *dli_fbase" -The base address at which the shared object is mapped into the -address space of the calling process. -.It Li "const char *dli_sname" -The name of the nearest run-time symbol with a value less than or -equal to -.Fa addr . -When possible, the symbol name is returned as it would appear in C -source code. -.Pp -If no symbol with a suitable value is found, both this field and -.Va dli_saddr -are set to -.Dv NULL . -.It Li "void *dli_saddr" -The value of the symbol returned in -.Li dli_sname . -.El -.Pp -The -.Fn dladdr -function -is available only in dynamically linked programs. -.Sh ERRORS -If a mapped shared object containing -.Fa addr -cannot be found, -.Fn dladdr -returns 0. -In that case, a message detailing the failure can be retrieved by -calling -.Fn dlerror . -.Pp -On success, a non-zero value is returned. -.Sh SEE ALSO -.Xr rtld 1 , -.Xr dlopen 3 -.Sh HISTORY -The -.Fn dladdr -function first appeared in the Solaris operating system. -.Sh BUGS -This implementation is bug-compatible with the Solaris -implementation. In particular, the following bugs are present: -.Bl -bullet -.It -If -.Fa addr -lies in the main executable rather than in a shared library, the -pathname returned in -.Va dli_fname -may not be correct. The pathname is taken directly from -.Va argv[0] -of the calling process. When executing a program specified by its -full pathname, most shells set -.Va argv[0] -to the pathname. But this is not required of shells or guaranteed -by the operating system. -.It -If -.Fa addr -is of the form -.Va &func , -where -.Va func -is a global function, its value may be an unpleasant surprise. In -dynamically linked programs, the address of a global function is -considered to point to its program linkage table entry, rather than to -the entry point of the function itself. This causes most global -functions to appear to be defined within the main executable, rather -than in the shared libraries where the actual code resides. -.It -Returning 0 as an indication of failure goes against long-standing -Unix tradition. -.El diff --git a/src/lib/libc/gen/dlinfo.3 b/src/lib/libc/gen/dlinfo.3 deleted file mode 100644 index a799875..0000000 --- a/src/lib/libc/gen/dlinfo.3 +++ /dev/null @@ -1,282 +0,0 @@ -.\" -.\" Copyright (c) 2003 Alexey Zelkin -.\" 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: src/lib/libc/gen/dlinfo.3,v 1.8 2004/06/21 19:30:45 mpp Exp $ -.\" -.Dd February 14, 2003 -.Os -.Dt DLINFO 3 -.Sh NAME -.Nm dlinfo -.Nd information about dynamically loaded object -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In link.h -.In dlfcn.h -.Ft int -.Fn dlinfo "void * restrict handle" "int request" "void * restrict p" -.Sh DESCRIPTION -The -.Fn dlinfo -function provides information about dynamically loaded object. -The action taken by -.Fn dlinfo -and exact meaning and type of -.Fa p -argument depend on value of the -.Fa request -argument provided by caller. -.Pp -The -.Fa handle -argument is either the value returned from the -.Xr dlopen 3 -function call or special handle -.Dv RTLD_SELF . -If -.Fa handle -is the value returned from -.Xr dlopen 3 , -the information returned by the -.Fn dlinfo -function pertains to the specified object. -If handle is the special handle -.Dv RTLD_SELF , -the information returned pertains to the caller itself. -.Pp -Possible values for the -.Fa request -argument are: -.Bl -tag -width indent -.It Dv RTLD_DI_LINKMAP -Retrieve the -.Vt Link_map -.Pq Vt "struct link_map" -structure pointer for the specified -.Fa handle . -On successful return, the -.Fa p -argument is filled with the pointer to the -.Vt Link_map -structure -.Pq Fa "Link_map **p" -describing a shared object specified by the -.Fa handle -argument. -The -.Vt Link_map -structures are maintained as a doubly linked list by -.Xr ld.so 1 , -in the same order as -.Xr dlopen 3 -and -.Xr dlclose 3 -are called. -See -.Sx EXAMPLES , -example 1. -.Pp -The -.Vt Link_map -structure is defined in -.In link.h -and has the following members: -.Bd -literal -offset indent -caddr_t l_addr; /* Base Address of library */ -const char *l_name; /* Absolute Path to Library */ -const void *l_ld; /* Pointer to .dynamic in memory */ -struct link_map *l_next, /* linked list of mapped libs */ - *l_prev; -.Ed -.Bl -tag -width ".Va l_addr" -.It Va l_addr -The base address of the object loaded into memory. -.It Va l_name -The full name of the loaded shared object. -.It Va l_ld -The address of the dynamic linking information segment -.Pq Dv PT_DYNAMIC -loaded into memory. -.It Va l_next -The next -.Vt Link_map -structure on the link-map list. -.It Va l_prev -The previous -.Vt Link_map -structure on the link-map list. -.El -.It Dv RTLD_DI_SERINFO -Retrieve the library search paths associated with the given -.Fa handle -argument. -The -.Fa p -argument should point to -.Vt Dl_serinfo -structure buffer -.Pq Fa "Dl_serinfo *p" . -The -.Vt Dl_serinfo -structure must be initialized first with the -.Dv RTLD_DI_SERINFOSIZE -request. -.Pp -The returned -.Vt Dl_serinfo -structure contains -.Va dls_cnt -.Vt Dl_serpath -entries. -Each entry's -.Va dlp_name -field points to the search path. -The corresponding -.Va dlp_info -field contains one of more flags indicating the origin of the path (see the -.Dv LA_SER_* -flags defined in the -.In link.h -header file). -See -.Sx EXAMPLES , -example 2, for a usage example. -.It Dv RTLD_DI_SERINFOSIZE -Initialize a -.Vt Dl_serinfo -structure for use in a -.Dv RTLD_DI_SERINFO -request. -Both the -.Va dls_cnt -and -.Va dls_size -fields are returned to indicate the number of search paths applicable -to the handle, and the total size of a -.Vt Dl_serinfo -buffer required to hold -.Va dls_cnt -.Vt Dl_serpath -entries and the associated search path strings. -See -.Sx EXAMPLES , -example 2, for a usage example. -.It Va RTLD_DI_ORIGIN -Retrieve the origin of the dynamic object associated with the handle. -On successful return, -.Fa p -argument is filled with the -.Vt char -pointer -.Pq Fa "char *p" . -.El -.Sh EXAMPLES -Example 1: Using -.Fn dlinfo -to retrieve -.Vt Link_map -structure. -.Pp -The following example shows how dynamic library can detect the list -of shared libraries loaded after caller's one. -For simplicity, error checking has been omitted. -.Bd -literal -offset indent -Link_map *map; - -dlinfo(RTLD_SELF, RTLD_DI_LINKMAP, &map); - -while (map != NULL) { - printf("%p: %s\\n", map->l_addr, map->l_name); - map = map->l_next; -} -.Ed -.Pp -Example 2: Using -.Fn dlinfo -to retrieve the library search paths. -.Pp -The following example shows how a dynamic object can inspect the library -search paths that would be used to locate a simple filename with -.Xr dlopen 3 . -For simplicity, error checking has been omitted. -.Bd -literal -offset indent -Dl_serinfo _info, *info = &_info; -Dl_serpath *path; -unsigned int cnt; - -/* determine search path count and required buffer size */ -dlinfo(RTLD_SELF, RTLD_DI_SERINFOSIZE, (void *)info); - -/* allocate new buffer and initialize */ -info = malloc(_info.dls_size); -info->dls_size = _info.dls_size; -info->dls_cnt = _info.dls_cnt; - -/* obtain sarch path information */ -dlinfo(RTLD_SELF, RTLD_DI_SERINFO, (void *)info); - -path = &info->dls_serpath[0]; - -for (cnt = 1; cnt <= info->dls_cnt; cnt++, path++) { - (void) printf("%2d: %s\\n", cnt, path->dls_name); -} -.Ed -.Sh RETURN VALUES -The -.Fn dlinfo -function returns 0 on success, or \-1 if an error occurred. -Whenever an error has been detected, a message detailing it can -be retrieved via a call to -.Xr dlerror 3 . -.Sh SEE ALSO -.Xr rtld 1 , -.Xr dladdr 3 , -.Xr dlopen 3 , -.Xr dlsym 3 -.Sh HISTORY -The -.Fn dlinfo -function first appeared in the Solaris operating system. -In -.Fx , -it first appeared in -.Fx 4.8 . -.Sh AUTHORS -.An -nosplit -The -.Fx -implementation of the -.Fn dlinfo -function was originally written by -.An Alexey Zelkin -.Aq phantom@FreeBSD.org -and later extended and improved by -.An Alexander Kabaev -.Aq kan@FreeBSD.org . -.Pp -The manual page for this function was written by -.An Alexey Zelkin -.Aq phantom@FreeBSD.org . diff --git a/src/lib/libc/gen/dllockinit.3 b/src/lib/libc/gen/dllockinit.3 deleted file mode 100644 index 189803f..0000000 --- a/src/lib/libc/gen/dllockinit.3 +++ /dev/null @@ -1,115 +0,0 @@ -.\" -.\" Copyright (c) 1999, 2000 John D. Polstra -.\" 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: src/lib/libc/gen/dllockinit.3,v 1.13 2002/12/19 09:40:21 ru Exp $ -.\" -.Dd July 5, 2000 -.Os -.Dt DLLOCKINIT 3 -.Sh NAME -.Nm dllockinit -.Nd register thread locking methods with the dynamic linker -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In dlfcn.h -.Ft void -.Fn dllockinit "void *context" "void *(*lock_create)(void *context)" "void (*rlock_acquire)(void *lock)" "void (*wlock_acquire)(void *lock)" "void (*lock_release)(void *lock)" "void (*lock_destroy)(void *lock)" "void (*context_destroy)(void *context)" -.Sh DESCRIPTION -.Bf Sy -Due to enhancements in the dynamic linker, this interface is no longer -needed. It is deprecated and will be removed from future releases. -In current releases it still exists, but only as a stub which does nothing. -.Ef -.Pp -Threads packages can call -.Fn dllockinit -at initialization time to register locking functions for the dynamic -linker to use. This enables the dynamic linker to prevent multiple -threads from entering its critical sections simultaneously. -.Pp -The -.Fa context -argument specifies an opaque context for creating locks. The -dynamic linker will pass it to the -.Fa lock_create -function when creating the locks it needs. When the dynamic linker -is permanently finished using the locking functions (e.g., if the -program makes a subsequent call to -.Fn dllockinit -to register new locking functions) it will call -.Fa context_destroy -to destroy the context. -.Pp -The -.Fa lock_create -argument specifies a function for creating a read/write lock. It -must return a pointer to the new lock. -.Pp -The -.Fa rlock_acquire -and -.Fa wlock_acquire -arguments specify functions which lock a lock for reading or -writing, respectively. The -.Fa lock_release -argument specifies a function which unlocks a lock. Each of these -functions is passed a pointer to the lock. -.Pp -The -.Fa lock_destroy -argument specifies a function to destroy a lock. It may be -.Dv NULL -if locks do not need to be destroyed. The -.Fa context_destroy -argument specifies a function to destroy the context. It may be -.Dv NULL -if the context does not need to be destroyed. -.Pp -Until -.Fn dllockinit -is called, the dynamic linker protects its critical sections using -a default locking mechanism which works by blocking the -.Dv SIGVTALRM , -.Dv SIGPROF , -and -.Dv SIGALRM -signals. This is sufficient for many application level threads -packages, which typically use one of these signals to implement -preemption. An application which has registered its own locking -methods with -.Fn dllockinit -can restore the default locking by calling -.Fn dllockinit -with all arguments -.Dv NULL . -.Sh SEE ALSO -.Xr rtld 1 , -.Xr signal 3 -.Sh HISTORY -The -.Fn dllockinit -function first appeared in -.Fx 4.0 . diff --git a/src/lib/libc/gen/dlopen.3 b/src/lib/libc/gen/dlopen.3 deleted file mode 100644 index 3a3c878..0000000 --- a/src/lib/libc/gen/dlopen.3 +++ /dev/null @@ -1,360 +0,0 @@ -.\" This source code is a product of Sun Microsystems, Inc. and is provided -.\" for unrestricted use provided that this legend is included on all tape -.\" media and as a part of the software program in whole or part. Users -.\" may copy or modify this source code without charge, but are not authorized -.\" to license or distribute it to anyone else except as part of a product or -.\" program developed by the user. -.\" -.\" THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. -.\" SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY -.\" OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT -.\" EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS -.\" ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED -.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN -.\" NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, -.\" INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING -.\" FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. -.\" -.\" This source code is provided with no support and without any obligation on -.\" the part of Sun Microsystems, Inc. to assist in its use, correction, -.\" modification or enhancement. -.\" -.\" SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE -.\" INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS -.\" SOURCE CODE OR ANY PART THEREOF. -.\" -.\" Sun Microsystems, Inc. -.\" 2550 Garcia Avenue -.\" Mountain View, California 94043 -.\" -.\" Copyright (c) 1991 Sun Microsystems, Inc. -.\" -.\" @(#) dlopen.3 1.6 90/01/31 SMI -.\" $FreeBSD: src/lib/libc/gen/dlopen.3,v 1.28 2004/06/03 10:13:26 roam Exp $ -.\" -.Dd September 10, 2002 -.Os -.Dt DLOPEN 3 -.Sh NAME -.Nm dlopen , -.Nm dlsym , -.Nm dlfunc , -.Nm dlerror , -.Nm dlclose -.Nd programmatic interface to the dynamic linker -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In dlfcn.h -.Ft void * -.Fn dlopen "const char *path" "int mode" -.Ft void * -.Fn dlsym "void * restrict handle" "const char * restrict symbol" -.Ft dlfunc_t -.Fn dlfunc "void * restrict handle" "const char * restrict symbol" -.Ft const char * -.Fn dlerror "void" -.Ft int -.Fn dlclose "void *handle" -.Sh DESCRIPTION -These functions provide a simple programmatic interface to the services of the -dynamic linker. -Operations are provided to add new shared objects to a -program's address space, to obtain the address bindings of symbols -defined by such -objects, and to remove such objects when their use is no longer required. -.Pp -The -.Fn dlopen -function -provides access to the shared object in -.Fa path , -returning a descriptor that can be used for later -references to the object in calls to -.Fn dlsym -and -.Fn dlclose . -If -.Fa path -was not in the address space prior to the call to -.Fn dlopen , -it is placed in the address space. -When an object is first loaded into the address space in this way, its -function -.Fn _init , -if any, is called by the dynamic linker. -If -.Fa path -has already been placed in the address space in a previous call to -.Fn dlopen , -it is not added a second time, although a reference count of -.Fn dlopen -operations on -.Fa path -is maintained. -A null pointer supplied for -.Fa path -is interpreted as a reference to the main -executable of the process. -The -.Fa mode -argument -controls the way in which external function references from the -loaded object are bound to their referents. -It must contain one of the following values, possibly ORed with -additional flags which will be described subsequently: -.Bl -tag -width RTLD_LAZYX -.It Dv RTLD_LAZY -Each external function reference is resolved when the function is first -called. -.It Dv RTLD_NOW -All external function references are bound immediately by -.Fn dlopen . -.El -.Pp -.Dv RTLD_LAZY -is normally preferred, for reasons of efficiency. -However, -.Dv RTLD_NOW -is useful to ensure that any undefined symbols are discovered during the -call to -.Fn dlopen . -.Pp -One of the following flags may be ORed into the -.Fa mode -argument: -.Bl -tag -width RTLD_GLOBALX -.It Dv RTLD_GLOBAL -Symbols from this shared object and its directed acyclic graph (DAG) -of needed objects will be available for resolving undefined references -from all other shared objects. -.It Dv RTLD_LOCAL -Symbols in this shared object and its DAG of needed objects will be -available for resolving undefined references only from other objects -in the same DAG. -This is the default, but it may be specified -explicitly with this flag. -.It Dv RTLD_TRACE -When set, causes dynamic linker to exit after loading all objects -needed by this shared object and printing a summary which includes -the absolute pathnames of all objects, to standard output. -With this flag -.Fn dlopen -will return to the caller only in the case of error. -.El -.Pp -If -.Fn dlopen -fails, it returns a null pointer, and sets an error condition which may -be interrogated with -.Fn dlerror . -.Pp -The -.Fn dlsym -function -returns the address binding of the symbol described in the null-terminated -character string -.Fa symbol , -as it occurs in the shared object identified by -.Fa handle . -The symbols exported by objects added to the address space by -.Fn dlopen -can be accessed only through calls to -.Fn dlsym . -Such symbols do not supersede any definition of those symbols already present -in the address space when the object is loaded, nor are they available to -satisfy normal dynamic linking references. -.Pp -If -.Fn dlsym -is called with the special -.Fa handle -.Dv NULL , -it is interpreted as a reference to the executable or shared object -from which the call -is being made. -Thus a shared object can reference its own symbols. -.Pp -If -.Fn dlsym -is called with the special -.Fa handle -.Dv RTLD_DEFAULT , -the search for the symbol follows the algorithm used for resolving -undefined symbols when objects are loaded. -The objects searched are -as follows, in the given order: -.Bl -enum -.It -The referencing object itself (or the object from which the call to -.Fn dlsym -is made), if that object was linked using the -.Fl Wsymbolic -option to -.Xr ld 1 . -.It -All objects loaded at program start-up. -.It -All objects loaded via -.Fn dlopen -with the -.Dv RTLD_GLOBAL -flag set in the -.Fa mode -argument. -.It -All objects loaded via -.Fn dlopen -which are in needed-object DAGs that also contain the referencing object. -.El -.Pp -If -.Fn dlsym -is called with the special -.Fa handle -.Dv RTLD_NEXT , -then the search for the symbol is limited to the shared objects -which were loaded after the one issuing the call to -.Fn dlsym . -Thus, if the function is called from the main program, all -the shared libraries are searched. -If it is called from a shared library, all subsequent shared -libraries are searched. -.Dv RTLD_NEXT -is useful for implementing wrappers around library functions. -For example, a wrapper function -.Fn getpid -could access the -.Dq real -.Fn getpid -with -.Li dlsym(RTLD_NEXT, \&"getpid\&") . -(Actually, the -.Fn dlfunc -interface, below, should be used, since -.Fn getpid -is a function and not a data object.) -.Pp -If -.Fn dlsym -is called with the special -.Fa handle -.Dv RTLD_SELF , -then the search for the symbol is limited to the shared object -issuing the call to -.Fn dlsym -and those shared objects which were loaded after it. -.Pp -The -.Fn dlsym -function -returns a null pointer if the symbol cannot be found, and sets an error -condition which may be queried with -.Fn dlerror . -.Pp -The -.Fn dlfunc -function -implements all of the behavior of -.Fn dlsym , -but has a return type which can be cast to a function pointer without -triggering compiler diagnostics. -(The -.Fn dlsym -function -returns a data pointer; in the C standard, conversions between -data and function pointer types are undefined. -Some compilers and -.Xr lint 1 -utilities warn about such casts.) -The precise return type of -.Fn dlfunc -is unspecified; applications must cast it to an appropriate function pointer -type. -.Pp -The -.Fn dlerror -function -returns a null-terminated character string describing the last error that -occurred during a call to -.Fn dlopen , -.Fn dladdr , -.Fn dlinfo , -.Fn dlsym , -.Fn dlfunc , -or -.Fn dlclose . -If no such error has occurred, -.Fn dlerror -returns a null pointer. -At each call to -.Fn dlerror , -the error indication is reset. -Thus in the case of two calls -to -.Fn dlerror , -where the second call follows the first immediately, the second call -will always return a null pointer. -.Pp -The -.Fn dlclose -function -deletes a reference to the shared object referenced by -.Fa handle . -If the reference count drops to 0, the object is removed from the -address space, and -.Fa handle -is rendered invalid. -Just before removing a shared object in this way, the dynamic linker -calls the object's -.Fn _fini -function, if such a function is defined by the object. -If -.Fn dlclose -is successful, it returns a value of 0. -Otherwise it returns -1, and sets an error condition that can be -interrogated with -.Fn dlerror . -.Pp -The object-intrinsic functions -.Fn _init -and -.Fn _fini -are called with no arguments, and are not expected to return values. -.Sh NOTES -ELF executables need to be linked -using the -.Fl export-dynamic -option to -.Xr ld 1 -for symbols defined in the executable to become visible to -.Fn dlsym . -.Pp -In previous implementations, it was necessary to prepend an underscore -to all external symbols in order to gain symbol -compatibility with object code compiled from the C language. -This is -still the case when using the (obsolete) -.Fl aout -option to the C language compiler. -.Sh ERRORS -The -.Fn dlopen , -.Fn dlsym , -and -.Fn dlfunc -functions -return a null pointer in the event of errors. -The -.Fn dlclose -function -returns 0 on success, or -1 if an error occurred. -Whenever an error has been detected, a message detailing it can be -retrieved via a call to -.Fn dlerror . -.Sh SEE ALSO -.Xr ld 1 , -.Xr rtld 1 , -.Xr dladdr 3 , -.Xr dlinfo 3 , -.Xr link 5 diff --git a/src/lib/libc/gen/err.3 b/src/lib/libc/gen/err.3 deleted file mode 100644 index 75e5f2b..0000000 --- a/src/lib/libc/gen/err.3 +++ /dev/null @@ -1,231 +0,0 @@ -.\" Copyright (c) 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" From: @(#)err.3 8.1 (Berkeley) 6/9/93 -.\" $FreeBSD: src/lib/libc/gen/err.3,v 1.19 2002/08/05 06:49:58 mike Exp $ -.\" -.Dd March 6, 1999 -.Dt ERR 3 -.Os -.Sh NAME -.Nm err , -.Nm verr , -.Nm errc , -.Nm verrc , -.Nm errx , -.Nm verrx , -.Nm warn , -.Nm vwarn , -.Nm warnc , -.Nm vwarnc , -.Nm warnx , -.Nm vwarnx , -.Nm err_set_exit , -.Nm err_set_file -.Nd formatted error messages -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In err.h -.Ft void -.Fn err "int eval" "const char *fmt" "..." -.Ft void -.Fn err_set_exit "void (*exitf)(int)" -.Ft void -.Fn err_set_file "void *vfp" -.Ft void -.Fn errc "int eval" "int code" "const char *fmt" "..." -.Ft void -.Fn errx "int eval" "const char *fmt" "..." -.Ft void -.Fn warn "const char *fmt" "..." -.Ft void -.Fn warnc "int code" "const char *fmt" "..." -.Ft void -.Fn warnx "const char *fmt" "..." -.In stdarg.h -.Ft void -.Fn verr "int eval" "const char *fmt" "va_list args" -.Ft void -.Fn verrc "int eval" "int code" "const char *fmt" "va_list args" -.Ft void -.Fn verrx "int eval" "const char *fmt" "va_list args" -.Ft void -.Fn vwarn "const char *fmt" "va_list args" -.Ft void -.Fn vwarnc "int code" "const char *fmt" "va_list args" -.Ft void -.Fn vwarnx "const char *fmt" "va_list args" -.Sh DESCRIPTION -The -.Fn err -and -.Fn warn -family of functions display a formatted error message on the standard -error output, or on another file specified using the -.Fn err_set_file -function. -In all cases, the last component of the program name, a colon character, -and a space are output. -If the -.Fa fmt -argument is not NULL, the -.Xr printf 3 --like formatted error message is output. -The output is terminated by a newline character. -.Pp -The -.Fn err , -.Fn errc , -.Fn verr , -.Fn verrc , -.Fn warn , -.Fn warnc , -.Fn vwarn , -and -.Fn vwarnc -functions append an error message obtained from -.Xr strerror 3 -based on a code or the global variable -.Va errno , -preceded by another colon and space unless the -.Fa fmt -argument is -.Dv NULL . -.Pp -In the case of the -.Fn errc , -.Fn verrc , -.Fn warnc , -and -.Fn vwarnc -functions, -the -.Fa code -argument is used to look up the error message. -.Pp -The -.Fn err , -.Fn verr , -.Fn warn , -and -.Fn vwarn -functions use the global variable -.Va errno -to look up the error message. -.Pp -The -.Fn errx -and -.Fn warnx -functions do not append an error message. -.Pp -The -.Fn err , -.Fn verr , -.Fn errc , -.Fn verrc , -.Fn errx , -and -.Fn verrx -functions do not return, but exit with the value of the argument -.Fa eval . -The -.Fn err_set_exit -function can be used to specify a function which is called before -.Xr exit 3 -to perform any necessary cleanup; passing a null function pointer for -.Va exitf -resets the hook to do nothing. -The -.Fn err_set_file -function sets the output stream used by the other functions. -Its -.Fa vfp -argument must be either a pointer to an open stream -(possibly already converted to void *) -or a null pointer -(in which case the output stream is set to standard error). -.Sh EXAMPLES -Display the current errno information string and exit: -.Bd -literal -offset indent -if ((p = malloc(size)) == NULL) - err(1, NULL); -if ((fd = open(file_name, O_RDONLY, 0)) == -1) - err(1, "%s", file_name); -.Ed -.Pp -Display an error message and exit: -.Bd -literal -offset indent -if (tm.tm_hour < START_TIME) - errx(1, "too early, wait until %s", start_time_string); -.Ed -.Pp -Warn of an error: -.Bd -literal -offset indent -if ((fd = open(raw_device, O_RDONLY, 0)) == -1) - warnx("%s: %s: trying the block device", - raw_device, strerror(errno)); -if ((fd = open(block_device, O_RDONLY, 0)) == -1) - err(1, "%s", block_device); -.Ed -.Pp -Warn of an error without using the global variable -.Va errno : -.Bd -literal -offset indent -error = my_function(); /* returns a value from */ -if (error != 0) - warnc(error, "my_function"); -.Ed -.Sh SEE ALSO -.Xr exit 3 , -.Xr fmtmsg 3 , -.Xr printf 3 , -.Xr strerror 3 -.Sh HISTORY -The -.Fn err -and -.Fn warn -functions first appeared in -.Bx 4.4 . -The -.Fn err_set_exit -and -.Fn err_set_file -functions first appeared in -.Fx 2.1 . -The -.Fn errc -and -.Fn warnc -functions first appeared in -.Fx 3.0 . diff --git a/src/lib/libc/gen/exec.3 b/src/lib/libc/gen/exec.3 deleted file mode 100644 index b741da2..0000000 --- a/src/lib/libc/gen/exec.3 +++ /dev/null @@ -1,325 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)exec.3 8.3 (Berkeley) 1/24/94 -.\" $FreeBSD: src/lib/libc/gen/exec.3,v 1.23 2003/09/10 19:24:32 ru Exp $ -.\" -.Dd January 24, 1994 -.Dt EXEC 3 -.Os -.Sh NAME -.Nm execl , -.Nm execlp , -.Nm execle , -.Nm exect , -.Nm execv , -.Nm execvp , -.Nm execvP -.Nd execute a file -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Vt extern char **environ ; -.Ft int -.Fn execl "const char *path" "const char *arg" ... /* "(char *)0" */ -.Ft int -.Fn execlp "const char *file" "const char *arg" ... /* "(char *)0" */ -.Ft int -.Fo execle -.Fa "const char *path" "const char *arg" ... -.Fa /* -.Bk -words -.Fa "(char *)0" "char *const envp[]" */ -.Ek -.Fc -.Ft int -.Fn exect "const char *path" "char *const argv[]" "char *const envp[]" -.Ft int -.Fn execv "const char *path" "char *const argv[]" -.Ft int -.Fn execvp "const char *file" "char *const argv[]" -.Ft int -.Fn execvP "const char *file" "const char *search_path" "char *const argv[]" -.Sh DESCRIPTION -The -.Nm exec -family of functions replaces the current process image with a -new process image. -The functions described in this manual page are front-ends for the function -.Xr execve 2 . -(See the manual page for -.Xr execve 2 -for detailed information about the replacement of the current process.) -.Pp -The initial argument for these functions is the pathname of a file which -is to be executed. -.Pp -The -.Fa "const char *arg" -and subsequent ellipses in the -.Fn execl , -.Fn execlp , -and -.Fn execle -functions can be thought of as -.Em arg0 , -.Em arg1 , -\&..., -.Em argn . -Together they describe a list of one or more pointers to null-terminated -strings that represent the argument list available to the executed program. -The first argument, by convention, should point to the file name associated -with the file being executed. -The list of arguments -.Em must -be terminated by a -.Dv NULL -pointer. -.Pp -The -.Fn exect , -.Fn execv , -.Fn execvp , -and -.Fn execvP -functions provide an array of pointers to null-terminated strings that -represent the argument list available to the new program. -The first argument, by convention, should point to the file name associated -with the file being executed. -The array of pointers -.Sy must -be terminated by a -.Dv NULL -pointer. -.Pp -The -.Fn execle -and -.Fn exect -functions also specify the environment of the executed process by following -the -.Dv NULL -pointer that terminates the list of arguments in the argument list -or the pointer to the argv array with an additional argument. -This additional argument is an array of pointers to null-terminated strings -and -.Em must -be terminated by a -.Dv NULL -pointer. -The other functions take the environment for the new process image from the -external variable -.Va environ -in the current process. -.Pp -Some of these functions have special semantics. -.Pp -The functions -.Fn execlp , -.Fn execvp , -and -.Fn execvP -will duplicate the actions of the shell in searching for an executable file -if the specified file name does not contain a slash -.Dq Li / -character. -For -.Fn execlp -and -.Fn execvp , -search path is the path specified in the environment by -.Dq Ev PATH -variable. -If this variable isn't specified, -the default path is set according to the -.Dv _PATH_DEFPATH -definition in -.In paths.h , -which is set to -.Dq Ev /usr/bin:/bin . -For -.Fn execvP , -the search path is specified as an argument to the function. -In addition, certain errors are treated specially. -.Pp -If an error is ambiguous (for simplicity, we shall consider all -errors except -.Er ENOEXEC -as being ambiguous here, although only the critical error -.Er EACCES -is really ambiguous), -then these functions will act as if they stat the file to determine -whether the file exists and has suitable execute permissions. -If it does, they will return immediately with the global variable -.Va errno -restored to the value set by -.Fn execve . -Otherwise, the search will be continued. -If the search completes without performing a successful -.Fn execve -or terminating due to an error, -these functions will return with the global variable -.Va errno -set to -.Er EACCES -or -.Er ENOENT -according to whether at least one file with suitable execute permissions -was found. -.Pp -If the header of a file isn't recognized (the attempted -.Fn execve -returned -.Er ENOEXEC ) , -these functions will execute the shell with the path of -the file as its first argument. -(If this attempt fails, no further searching is done.) -.Pp -The function -.Fn exect -executes a file with the program tracing facilities enabled (see -.Xr ptrace 2 ) . -.Sh RETURN VALUES -If any of the -.Fn exec -functions returns, an error will have occurred. -The return value is \-1, and the global variable -.Va errno -will be set to indicate the error. -.Sh FILES -.Bl -tag -width /bin/sh -compact -.It Pa /bin/sh -The shell. -.El -.Sh ERRORS -The -.Fn execl , -.Fn execle , -.Fn execlp , -.Fn execvp -and -.Fn execvP -functions -may fail and set -.Va errno -for any of the errors specified for the library functions -.Xr execve 2 -and -.Xr malloc 3 . -.Pp -The -.Fn exect -and -.Fn execv -functions -may fail and set -.Va errno -for any of the errors specified for the library function -.Xr execve 2 . -.Sh SEE ALSO -.Xr sh 1 , -.Xr execve 2 , -.Xr fork 2 , -.Xr ktrace 2 , -.Xr ptrace 2 , -.Xr environ 7 -.Sh COMPATIBILITY -Historically, the default path for the -.Fn execlp -and -.Fn execvp -functions was -.Dq Pa :/bin:/usr/bin . -This was changed to place the current directory last to enhance system -security. -.Pp -The behavior of -.Fn execlp -and -.Fn execvp -when errors occur while attempting to execute the file is not quite historic -practice, and has not traditionally been documented and is not specified -by the -.Tn POSIX -standard. -.Pp -Traditionally, the functions -.Fn execlp -and -.Fn execvp -ignored all errors except for the ones described above and -.Er ETXTBSY , -upon which they retried after sleeping for several seconds, and -.Er ENOMEM -and -.Er E2BIG , -upon which they returned. -They now return for -.Er ETXTBSY , -and determine existence and executability more carefully. -In particular, -.Er EACCES -for inaccessible directories in the path prefix is no longer -confused with -.Er EACCES -for files with unsuitable execute permissions. -In -.Bx 4.4 , -they returned upon all errors except -.Er EACCES , -.Er ENOENT , -.Er ENOEXEC -and -.Er ETXTBSY . -This was inferior to the traditional error handling, -since it breaks the ignoring of errors for path prefixes -and only improves the handling of the unusual ambiguous error -.Er EFAULT -and the unusual error -.Er EIO . -The behaviour was changed to match the behaviour of -.Xr sh 1 . -.Sh STANDARDS -The -.Fn execl , -.Fn execv , -.Fn execle , -.Fn execlp -and -.Fn execvp -functions -conform to -.St -p1003.1-88 . -The -.Fn execvP -function first appeared in -.Fx 5.2 . diff --git a/src/lib/libc/gen/fmtcheck.3 b/src/lib/libc/gen/fmtcheck.3 deleted file mode 100644 index a2068e1..0000000 --- a/src/lib/libc/gen/fmtcheck.3 +++ /dev/null @@ -1,114 +0,0 @@ -.\" Copyright (c) 2000 The NetBSD Foundation, Inc. -.\" All rights reserved. -.\" -.\" This file was contributed to The NetBSD Foundation by Allen Briggs. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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: src/lib/libc/gen/fmtcheck.3,v 1.8 2002/12/19 09:40:21 ru Exp $ -.Dd October 16, 2002 -.Os -.Dt FMTCHECK 3 -.Sh NAME -.Nm fmtcheck -.Nd sanitizes user-supplied -.Xr printf 3 Ns -style -format string -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In stdio.h -.Ft const char * -.Fn fmtcheck "const char *fmt_suspect" "const char *fmt_default" -.Sh DESCRIPTION -The -.Fn fmtcheck -scans -.Fa fmt_suspect -and -.Fa fmt_default -to determine if -.Fa fmt_suspect -will consume the same argument types as -.Fa fmt_default -and to ensure that -.Fa fmt_suspect -is a valid format string. -.Pp -The -.Xr printf 3 -family of functions cannot verify the types of arguments that they are -passed at run-time. In some cases, like -.Xr catgets 3 , -it is useful or necessary to use a user-supplied format string with no -guarantee that the format string matches the specified arguments. -.Pp -The -.Fn fmtcheck -was designed to be used in these cases, as in: -.Bd -literal -offset indent -printf(fmtcheck(user_format, standard_format), arg1, arg2); -.Ed -.Pp -In the check, field widths, fillers, precisions, etc. are ignored (unless -the field width or precision is an asterisk -.Ql * -instead of a digit string). Also, any text other than the format specifiers -is completely ignored. -.Sh RETURN VALUES -If -.Fa fmt_suspect -is a valid format and consumes the same argument types as -.Fa fmt_default , -then the -.Fn fmtcheck -will return -.Fa fmt_suspect . -Otherwise, it will return -.Fa fmt_default . -.Sh SECURITY CONSIDERATIONS -Note that the formats may be quite different as long as they accept the -same arguments. For example, -.Qq Li "%p %o %30s %#llx %-10.*e %n" -is compatible with -.Qq Li "This number %lu %d%% and string %s has %qd numbers and %.*g floats (%n)" . -However, -.Qq Li %o -is not equivalent to -.Qq Li %lx -because -the first requires an integer and the second requires a long. -.Sh SEE ALSO -.Xr printf 3 -.Sh BUGS -The -.Fn fmtcheck -function does not understand all of the conversions that -.Xr printf 3 -does. diff --git a/src/lib/libc/gen/fmtmsg.3 b/src/lib/libc/gen/fmtmsg.3 deleted file mode 100644 index 3320bd0..0000000 --- a/src/lib/libc/gen/fmtmsg.3 +++ /dev/null @@ -1,260 +0,0 @@ -.\" -.\" Copyright (c) 2002 Mike Barcroft -.\" 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: src/lib/libc/gen/fmtmsg.3,v 1.4 2002/12/04 18:57:44 ru Exp $ -.\" -.Dd August 5, 2002 -.Dt FMTMSG 3 -.Os -.Sh NAME -.Nm fmtmsg -.Nd display a detailed diagnostic message -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In fmtmsg.h -.Ft int -.Fo fmtmsg -.Fa "long classification" "const char *label" "int severity" -.Fa "const char *text" "const char *action" "const char *tag" -.Fc -.Sh DESCRIPTION -The -.Fn fmtmsg -function displays a detailed diagnostic message, based on -the supplied arguments, to -.Dv stderr -and/or the system console. -.Pp -The -.Fa classification -argument is the bitwise inclusive -.Tn OR -of zero or one of the manifest constants from -each of the classification groups below. -The Output classification group is an exception since both -.Dv MM_PRINT -and -.Dv MM_CONSOLE -may be specified. -.Bl -tag -width indent -.It Output -.Bl -tag -width ".Dv MM_CONSOLE" -.It Dv MM_PRINT -Output should take place on -.Dv stderr . -.It Dv MM_CONSOLE -Output should take place on the system console. -.El -.It "Source of Condition (Major)" -.Bl -tag -width ".Dv MM_CONSOLE" -.It Dv MM_HARD -The source of the condition is hardware related. -.It Dv MM_SOFT -The source of the condition is software related. -.It Dv MM_FIRM -The source of the condition is firmware related. -.El -.It "Source of Condition (Minor)" -.Bl -tag -width ".Dv MM_CONSOLE" -.It Dv MM_APPL -The condition was detected at the application level. -.It Dv MM_UTIL -The condition was detected at the utility level. -.It Dv MM_OPSYS -The condition was detected at the operating system level. -.El -.It Status -.Bl -tag -width ".Dv MM_CONSOLE" -.It Dv MM_RECOVER -The application can recover from the condition. -.It Dv MM_NRECOV -The application is unable to recover from the condition. -.El -.El -.Pp -Alternatively, the -.Dv MM_NULLMC -manifest constant may be used to specify no classification. -.Pp -The -.Fa label -argument indicates the source of the message. -It is made up of two fields separated by a colon -.Pq Ql \&: . -The first field can be up to 10 bytes, -and the second field can be up to 14 bytes. -The -.Dv MM_NULLLBL -manifest constant may be used to specify no label. -.Pp -The -.Fa severity -argument identifies the importance of the condition. -One of the following manifest constants should be used for this argument. -.Bl -tag -offset indent -width ".Dv MM_WARNING" -.It Dv MM_HALT -The application has confronted a serious fault and is halting. -.It Dv MM_ERROR -The application has detected a fault. -.It Dv MM_WARNING -The application has detected an unusual condition, -that could be indicative of a problem. -.It Dv MM_INFO -The application is providing information about a non-error condition. -.It Dv MM_NOSEV -No severity level supplied. -.El -.Pp -The -.Fa text -argument details the error condition that caused the message. -There is no limit on the size of this character string. -The -.Dv MM_NULLTXT -manifest constant may be used to specify no text. -.Pp -The -.Fa action -argument details how the error-recovery process should begin. -Upon output, -.Fn fmtmsg -will prefix -.Qq Li "TO FIX:" -to the beginning of the -.Fa action -argument. -The -.Dv MM_NULLACT -manifest constant may be used to specify no action. -.Pp -The -.Fa tag -argument should reference online documentation for the message. -This usually includes the -.Fa label -and a unique identifying number. -An example tag is -.Qq Li BSD:ls:168 . -The -.Dv MM_NULLTAG -manifest constant may be used to specify no tag. -.Sh RETURN VALUES -The -.Fn fmtmsg -function returns -.Dv MM_OK -upon success, -.Dv MM_NOMSG -to indicate output to -.Dv stderr -failed, -.Dv MM_NOCON -to indicate output to the system console failed, or -.Dv MM_NOTOK -to indicate output to -.Dv stderr -and the system console failed. -.Sh ENVIRONMENT -The -.Ev MSGVERB -(message verbosity) -environment variable specifies which arguments to -.Fn fmtmsg -will be output to -.Dv stderr , -and in which order. -.Ev MSGVERB -should be a colon -.Pq Ql \&: -separated list of identifiers. -Valid identifiers include: -.Li label , severity , text , action , -and -.Li tag . -If invalid identifiers are specified or incorrectly separated, -the default message verbosity and ordering will be used. -The default ordering is equivalent to a -.Ev MSGVERB -with a value of -.Qq Li label:severity:text:action:tag . -.Sh EXAMPLES -The code: -.Bd -literal -offset indent -fmtmsg(MM_UTIL | MM_PRINT, "BSD:ls", MM_ERROR, - "illegal option -- z", "refer to manual", "BSD:ls:001"); -.Ed -.Pp -will output: -.Bd -literal -offset indent -BSD:ls: ERROR: illegal option -- z -TO FIX: refer to manual BSD:ls:001 -.Ed -.Pp -to -.Dv stderr . -.Pp -The same code, with -.Ev MSGVERB -set to -.Qq Li "text:severity:action:tag" , -produces: -.Bd -literal -offset indent -illegal option -- z: ERROR -TO FIX: refer to manual BSD:ls:001 -.Ed -.Sh SEE ALSO -.Xr err 3 , -.Xr exit 3 , -.Xr strerror 3 -.Sh STANDARDS -The -.Fn fmtmsg -function conforms to -.St -p1003.1-2001 . -.Sh HISTORY -The -.Fn fmtmsg -function first appeared in -.Fx 5.0 . -.Sh BUGS -Specifying -.Dv MM_NULLMC -for the -.Fa classification -argument makes little sense, since without an output specified, -.Fn fmtmsg -is unable to do anything useful. -.Pp -In order for -.Fn fmtmsg -to output to the system console, the effective -user must have appropriate permission to write to -.Pa /dev/console . -This means that on most systems -.Fn fmtmsg -will return -.Dv MM_NOCON -unless the effective user is root. diff --git a/src/lib/libc/gen/fnmatch.3 b/src/lib/libc/gen/fnmatch.3 deleted file mode 100644 index 7aba4eb..0000000 --- a/src/lib/libc/gen/fnmatch.3 +++ /dev/null @@ -1,151 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Guido van Rossum. -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)fnmatch.3 8.3 (Berkeley) 4/28/95 -.\" $FreeBSD: src/lib/libc/gen/fnmatch.3,v 1.16 2003/11/06 00:52:37 kientzle Exp $ -.\" -.Dd April 28, 1995 -.Dt FNMATCH 3 -.Os -.Sh NAME -.Nm fnmatch -.Nd test whether a filename or pathname matches a shell-style pattern -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In fnmatch.h -.Ft int -.Fn fnmatch "const char *pattern" "const char *string" "int flags" -.Sh DESCRIPTION -The -.Fn fnmatch -function -matches patterns according to the rules used by the shell. -It checks the string specified by the -.Fa string -argument to see if it matches the pattern specified by the -.Fa pattern -argument. -.Pp -The -.Fa flags -argument modifies the interpretation of -.Fa pattern -and -.Fa string . -The value of -.Fa flags -is the bitwise inclusive -.Tn OR -of any of the following -constants, which are defined in the include file -.In fnmatch.h . -.Bl -tag -width FNM_PATHNAME -.It Dv FNM_NOESCAPE -Normally, every occurrence of a backslash -.Pq Ql \e -followed by a character in -.Fa pattern -is replaced by that character. -This is done to negate any special meaning for the character. -If the -.Dv FNM_NOESCAPE -flag is set, a backslash character is treated as an ordinary character. -.It Dv FNM_PATHNAME -Slash characters in -.Fa string -must be explicitly matched by slashes in -.Fa pattern . -If this flag is not set, then slashes are treated as regular characters. -.It Dv FNM_PERIOD -Leading periods in -.Fa string -must be explicitly matched by periods in -.Fa pattern . -If this flag is not set, then leading periods are treated as regular -characters. -The definition of -.Dq leading -is related to the specification of -.Dv FNM_PATHNAME . -A period is always -.Dq leading -if it is the first character in -.Fa string . -Additionally, if -.Dv FNM_PATHNAME -is set, -a period is -leading -if it immediately follows a slash. -.It Dv FNM_LEADING_DIR -Ignore -.Dq Li /* -rest after successful -.Fa pattern -matching. -.It Dv FNM_CASEFOLD -Ignore case distinctions in both the -.Fa pattern -and the -.Fa string . -.El -.Sh RETURN VALUES -The -.Fn fnmatch -function returns zero if -.Fa string -matches the pattern specified by -.Fa pattern , -otherwise, it returns the value -.Dv FNM_NOMATCH . -.Sh SEE ALSO -.Xr sh 1 , -.Xr glob 3 , -.Xr regex 3 -.Sh STANDARDS -The -.Fn fnmatch -function conforms to -.St -p1003.2 . -.Sh HISTORY -The -.Fn fnmatch -function first appeared in -.Bx 4.4 . -.Sh BUGS -The pattern -.Ql * -matches the empty string, even if -.Dv FNM_PATHNAME -is specified. diff --git a/src/lib/libc/gen/fpclassify.3 b/src/lib/libc/gen/fpclassify.3 deleted file mode 100644 index 3366bcb..0000000 --- a/src/lib/libc/gen/fpclassify.3 +++ /dev/null @@ -1,130 +0,0 @@ -.\" Copyright (c) 2003 Mike Barcroft -.\" 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: src/lib/libc/gen/fpclassify.3,v 1.3 2003/06/01 19:19:59 ru Exp $ -.\" -.Dd February 12, 2003 -.Dt FPCLASSIFY 3 -.Os -.Sh NAME -.Nm fpclassify , isfinite , isinf , isnan , isnormal -.Nd "classify a floating-point number" -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In math.h -.Ft int -.Fn fpclassify "real-floating x" -.Ft int -.Fn isfinite "real-floating x" -.Ft int -.Fn isinf "real-floating x" -.Ft int -.Fn isnan "real-floating x" -.Ft int -.Fn isnormal "real-floating x" -.Sh DESCRIPTION -The -.Fn fpclassify -macro takes an argument of -.Fa x -and returns one of the following manifest constants. -.Bl -tag -width ".Dv FP_SUBNORMAL" -.It Dv FP_INFINITE -Indicates that -.Fa x -is an infinite number. -.It Dv FP_NAN -Indicates that -.Fa x -is not a number (NaN). -.It Dv FP_NORMAL -Indicates that -.Fa x -is a normalized number. -.It Dv FP_SUBNORMAL -Indicates that -.Fa x -is a denormalized number. -.It Dv FP_ZERO -Indicates that -.Fa x -is zero (0 or \-0). -.El -.Pp -The -.Fn isfinite -macro returns a non-zero value if and only if its argument has -a finite (zero, subnormal, or normal) value. -The -.Fn isinf , -.Fn isnan , -and -.Fn isnormal -macros return non-zero if and only if -.Fa x -is an infinity, NaN, -or a non-zero normalized number, respectively. -.Pp -The symbol -.Fn isnanf -is provided as an alias to -.Fn isnan -for compatibility, and its use is deprecated. -.Sh SEE ALSO -.Xr isgreater 3 , -.Xr math 3 , -.Xr signbit 3 -.Sh STANDARDS -The -.Fn fpclassify , -.Fn isfinite , -.Fn isinf , -.Fn isnan , -and -.Fn isnormal -macros conform to -.St -isoC-99 . -.Sh HISTORY -The -.Fn fpclassify , -.Fn isfinite , -.Fn isinf , -.Fn isnan , -and -.Fn isnormal -macros were added in -.Fx 5.1 . -.Bx 3 -introduced -.Fn isinf -and -.Fn isnan -functions, which accepted -.Vt double -arguments; these have been superseded by the macros -described above. -.Sh BUGS -By default, the DEC Alpha architecture does not support IEEE rounding. -See the compiler documentation for additional details. diff --git a/src/lib/libc/gen/frexp.3 b/src/lib/libc/gen/frexp.3 deleted file mode 100644 index 4414b3d..0000000 --- a/src/lib/libc/gen/frexp.3 +++ /dev/null @@ -1,88 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" the American National Standards Committee X3, on Information -.\" Processing Systems. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)frexp.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/frexp.3,v 1.10 2002/12/18 13:33:02 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt FREXP 3 -.Os -.Sh NAME -.Nm frexp -.Nd convert floating-point number to fractional and integral components -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In math.h -.Ft double -.Fn frexp "double value" "int *exp" -.Sh DESCRIPTION -The -.Fn frexp -function breaks a floating-point number into a normalized -fraction and an integral power of 2. -It stores the integer in the -.Vt int -object pointed to by -.Fa exp . -.Sh RETURN VALUES -The -.Fn frexp -function returns the value -.Va x , -such that -.Va x -is a -.Vt double -with magnitude in the interval -.Bo 1/2 , 1 Pc -or zero, and -.Fa value -equals -.Va x -times 2 raised to the power -.Fa *exp . -If -.Fa value -is zero, both parts of the result are zero. -.Sh SEE ALSO -.Xr ldexp 3 , -.Xr math 3 , -.Xr modf 3 -.Sh STANDARDS -The -.Fn frexp -function conforms to -.St -isoC . diff --git a/src/lib/libc/gen/ftok.3 b/src/lib/libc/gen/ftok.3 deleted file mode 100644 index 2359013..0000000 --- a/src/lib/libc/gen/ftok.3 +++ /dev/null @@ -1,82 +0,0 @@ -.\" Copyright (c) 1994 SigmaSoft, Th. Lockert -.\" 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. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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: src/lib/libc/gen/ftok.3,v 1.15 2002/10/19 13:33:12 tjr Exp $ -.Dd June 24, 1994 -.Os -.Dt FTOK 3 -.Sh NAME -.Nm ftok -.Nd create IPC identifier from path name -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In sys/ipc.h -.Ft key_t -.Fn ftok "const char *path" "int id" -.Sh DESCRIPTION -The -.Fn ftok -function attempts to create a unique key suitable for use with the -.Xr msgget 3 , -.Xr semget 2 -and -.Xr shmget 2 -functions given the -.Fa path -of an existing file and a user-selectable -.Fa id . -.Pp -The specified -.Fa path -must specify an existing file that is accessible to the calling process -or the call will fail. Also, note that links to files will return the -same key, given the same -.Fa id . -.Sh RETURN VALUES -The -.Fn ftok -function will return -1 if -.Fa path -does not exist or if it cannot be accessed by the calling process. -.Sh SEE ALSO -.Xr semget 2 , -.Xr shmget 2 , -.Xr msgget 3 -.Sh HISTORY -The -.Fn ftok -function originates with System V and is typically used by programs -that use the System V IPC routines. -.Sh AUTHORS -.An Thorsten Lockert Aq tholo@sigmasoft.com -.Sh BUGS -The returned key is computed based on the device minor number and inode of the -specified -.Fa path -in combination with the lower 8 bits of the given -.Fa id . -Thus it is quite possible for the routine to return duplicate keys. diff --git a/src/lib/libc/gen/fts.3 b/src/lib/libc/gen/fts.3 deleted file mode 100644 index a7861a2..0000000 --- a/src/lib/libc/gen/fts.3 +++ /dev/null @@ -1,796 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993, 1994 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)fts.3 8.5 (Berkeley) 4/16/94 -.\" $FreeBSD: src/lib/libc/gen/fts.3,v 1.19 2003/09/08 19:57:14 ru Exp $ -.\" -.Dd September 15, 2002 -.Dt FTS 3 -.Os -.Sh NAME -.Nm fts -.Nd traverse a file hierarchy -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In sys/stat.h -.In fts.h -.Ft FTS * -.Fn fts_open "char * const *path_argv" "int options" "int (*compar)(const FTSENT * const *, const FTSENT * const *)" -.Ft FTSENT * -.Fn fts_read "FTS *ftsp" -.Ft FTSENT * -.Fn fts_children "FTS *ftsp" "int options" -.Ft int -.Fn fts_set "FTS *ftsp" "FTSENT *f" "int options" -.Ft void -.Fn fts_set_clientptr "FTS *ftsp" "void *clientdata" -.Ft void * -.Fn fts_get_clientptr "FTS *ftsp" -.Ft FTS * -.Fn fts_get_stream "FTSENT *f" -.Ft int -.Fn fts_close "FTS *ftsp" -.Sh DESCRIPTION -The -.Nm -functions are provided for traversing -.Ux -file hierarchies. -A simple overview is that the -.Fn fts_open -function returns a -.Dq handle -on a file hierarchy, which is then supplied to -the other -.Nm -functions. -The function -.Fn fts_read -returns a pointer to a structure describing one of the files in the file -hierarchy. -The function -.Fn fts_children -returns a pointer to a linked list of structures, each of which describes -one of the files contained in a directory in the hierarchy. -In general, directories are visited two distinguishable times; in pre-order -(before any of their descendants are visited) and in post-order (after all -of their descendants have been visited). -Files are visited once. -It is possible to walk the hierarchy -.Dq logically -(ignoring symbolic links) -or physically (visiting symbolic links), order the walk of the hierarchy or -prune and/or re-visit portions of the hierarchy. -.Pp -Two structures are defined (and typedef'd) in the include file -.In fts.h . -The first is -.Vt FTS , -the structure that represents the file hierarchy itself. -The second is -.Vt FTSENT , -the structure that represents a file in the file -hierarchy. -Normally, an -.Vt FTSENT -structure is returned for every file in the file -hierarchy. -In this manual page, -.Dq file -and -.Dq Vt FTSENT No structure -are generally -interchangeable. -.Pp -The -.Vt FTS -structure contains space for a single pointer, which may be used to -store application data or per-hierarchy state. -The -.Fn fts_set_clientptr -and -.Fn fts_get_clientptr -functions may be used to set and retrieve this pointer. -This is likely to be useful only when accessed from the sort -comparison function, which can determine the original -.Vt FTS -stream of its arguments using the -.Fn fts_get_stream -function. -The two -.Li get -functions are also available as macros of the same name. -.Pp -The -.Vt FTSENT -structure contains at least the following fields, which are -described in greater detail below: -.Bd -literal -typedef struct _ftsent { - u_short fts_info; /* flags for FTSENT structure */ - char *fts_accpath; /* access path */ - char *fts_path; /* root path */ - u_short fts_pathlen; /* strlen(fts_path) */ - char *fts_name; /* file name */ - u_short fts_namelen; /* strlen(fts_name) */ - short fts_level; /* depth (\-1 to N) */ - int fts_errno; /* file errno */ - long fts_number; /* local numeric value */ - void *fts_pointer; /* local address value */ - struct ftsent *fts_parent; /* parent directory */ - struct ftsent *fts_link; /* next file structure */ - struct ftsent *fts_cycle; /* cycle structure */ - struct stat *fts_statp; /* stat(2) information */ -} FTSENT; -.Ed -.Pp -These fields are defined as follows: -.Bl -tag -width "fts_namelen" -.It Fa fts_info -One of the following values describing the returned -.Vt FTSENT -structure and -the file it represents. -With the exception of directories without errors -.Pq Dv FTS_D , -all of these -entries are terminal, that is, they will not be revisited, nor will any -of their descendants be visited. -.Bl -tag -width FTS_DEFAULT -.It Dv FTS_D -A directory being visited in pre-order. -.It Dv FTS_DC -A directory that causes a cycle in the tree. -(The -.Fa fts_cycle -field of the -.Vt FTSENT -structure will be filled in as well.) -.It Dv FTS_DEFAULT -Any -.Vt FTSENT -structure that represents a file type not explicitly described -by one of the other -.Fa fts_info -values. -.It Dv FTS_DNR -A directory which cannot be read. -This is an error return, and the -.Fa fts_errno -field will be set to indicate what caused the error. -.It Dv FTS_DOT -A file named -.Ql .\& -or -.Ql ..\& -which was not specified as a file name to -.Fn fts_open -(see -.Dv FTS_SEEDOT ) . -.It Dv FTS_DP -A directory being visited in post-order. -The contents of the -.Vt FTSENT -structure will be unchanged from when -it was returned in pre-order, i.e. with the -.Fa fts_info -field set to -.Dv FTS_D . -.It Dv FTS_ERR -This is an error return, and the -.Fa fts_errno -field will be set to indicate what caused the error. -.It Dv FTS_F -A regular file. -.It Dv FTS_NS -A file for which no -.Xr stat 2 -information was available. -The contents of the -.Fa fts_statp -field are undefined. -This is an error return, and the -.Fa fts_errno -field will be set to indicate what caused the error. -.It Dv FTS_NSOK -A file for which no -.Xr stat 2 -information was requested. -The contents of the -.Fa fts_statp -field are undefined. -.It Dv FTS_SL -A symbolic link. -.It Dv FTS_SLNONE -A symbolic link with a non-existent target. -The contents of the -.Fa fts_statp -field reference the file characteristic information for the symbolic link -itself. -.El -.It Fa fts_accpath -A path for accessing the file from the current directory. -.It Fa fts_path -The path for the file relative to the root of the traversal. -This path contains the path specified to -.Fn fts_open -as a prefix. -.It Fa fts_pathlen -The length of the string referenced by -.Fa fts_path . -.It Fa fts_name -The name of the file. -.It Fa fts_namelen -The length of the string referenced by -.Fa fts_name . -.It Fa fts_level -The depth of the traversal, numbered from \-1 to N, where this file -was found. -The -.Vt FTSENT -structure representing the parent of the starting point (or root) -of the traversal is numbered -.Dv FTS_ROOTPARENTLEVEL -(\-1), and the -.Vt FTSENT -structure for the root -itself is numbered -.Dv FTS_ROOTLEVEL -(0). -.It Fa fts_errno -Upon return of a -.Vt FTSENT -structure from the -.Fn fts_children -or -.Fn fts_read -functions, with its -.Fa fts_info -field set to -.Dv FTS_DNR , -.Dv FTS_ERR -or -.Dv FTS_NS , -the -.Fa fts_errno -field contains the value of the external variable -.Va errno -specifying the cause of the error. -Otherwise, the contents of the -.Fa fts_errno -field are undefined. -.It Fa fts_number -This field is provided for the use of the application program and is -not modified by the -.Nm -functions. -It is initialized to 0. -.It Fa fts_pointer -This field is provided for the use of the application program and is -not modified by the -.Nm -functions. -It is initialized to -.Dv NULL . -.It Fa fts_parent -A pointer to the -.Vt FTSENT -structure referencing the file in the hierarchy -immediately above the current file, i.e. the directory of which this -file is a member. -A parent structure for the initial entry point is provided as well, -however, only the -.Fa fts_level , -.Fa fts_number -and -.Fa fts_pointer -fields are guaranteed to be initialized. -.It Fa fts_link -Upon return from the -.Fn fts_children -function, the -.Fa fts_link -field points to the next structure in the NULL-terminated linked list of -directory members. -Otherwise, the contents of the -.Fa fts_link -field are undefined. -.It Fa fts_cycle -If a directory causes a cycle in the hierarchy (see -.Dv FTS_DC ) , -either because -of a hard link between two directories, or a symbolic link pointing to a -directory, the -.Fa fts_cycle -field of the structure will point to the -.Vt FTSENT -structure in the hierarchy that references the same file as the current -.Vt FTSENT -structure. -Otherwise, the contents of the -.Fa fts_cycle -field are undefined. -.It Fa fts_statp -A pointer to -.Xr stat 2 -information for the file. -.El -.Pp -A single buffer is used for all of the paths of all of the files in the -file hierarchy. -Therefore, the -.Fa fts_path -and -.Fa fts_accpath -fields are guaranteed to be -.Dv NUL Ns -terminated -.Em only -for the file most recently returned by -.Fn fts_read . -To use these fields to reference any files represented by other -.Vt FTSENT -structures will require that the path buffer be modified using the -information contained in that -.Vt FTSENT -structure's -.Fa fts_pathlen -field. -Any such modifications should be undone before further calls to -.Fn fts_read -are attempted. -The -.Fa fts_name -field is always -.Dv NUL Ns -terminated . -.Sh FTS_OPEN -The -.Fn fts_open -function takes a pointer to an array of character pointers naming one -or more paths which make up a logical file hierarchy to be traversed. -The array must be terminated by a -.Dv NULL -pointer. -.Pp -There are -a number of options, at least one of which (either -.Dv FTS_LOGICAL -or -.Dv FTS_PHYSICAL ) -must be specified. -The options are selected by -.Em or Ns 'ing -the following values: -.Bl -tag -width "FTS_PHYSICAL" -.It Dv FTS_COMFOLLOW -This option causes any symbolic link specified as a root path to be -followed immediately whether or not -.Dv FTS_LOGICAL -is also specified. -.It Dv FTS_LOGICAL -This option causes the -.Nm -routines to return -.Vt FTSENT -structures for the targets of symbolic links -instead of the symbolic links themselves. -If this option is set, the only symbolic links for which -.Vt FTSENT -structures -are returned to the application are those referencing non-existent files. -Either -.Dv FTS_LOGICAL -or -.Dv FTS_PHYSICAL -.Em must -be provided to the -.Fn fts_open -function. -.It Dv FTS_NOCHDIR -As a performance optimization, the -.Nm -functions change directories as they walk the file hierarchy. -This has the side-effect that an application cannot rely on being -in any particular directory during the traversal. -The -.Dv FTS_NOCHDIR -option turns off this optimization, and the -.Nm -functions will not change the current directory. -Note that applications should not themselves change their current directory -and try to access files unless -.Dv FTS_NOCHDIR -is specified and absolute -pathnames were provided as arguments to -.Fn fts_open . -.It Dv FTS_NOSTAT -By default, returned -.Vt FTSENT -structures reference file characteristic information (the -.Fa statp -field) for each file visited. -This option relaxes that requirement as a performance optimization, -allowing the -.Nm -functions to set the -.Fa fts_info -field to -.Dv FTS_NSOK -and leave the contents of the -.Fa statp -field undefined. -.It Dv FTS_PHYSICAL -This option causes the -.Nm -routines to return -.Vt FTSENT -structures for symbolic links themselves instead -of the target files they point to. -If this option is set, -.Vt FTSENT -structures for all symbolic links in the -hierarchy are returned to the application. -Either -.Dv FTS_LOGICAL -or -.Dv FTS_PHYSICAL -.Em must -be provided to the -.Fn fts_open -function. -.It Dv FTS_SEEDOT -By default, unless they are specified as path arguments to -.Fn fts_open , -any files named -.Ql .\& -or -.Ql ..\& -encountered in the file hierarchy are ignored. -This option causes the -.Nm -routines to return -.Vt FTSENT -structures for them. -.It Dv FTS_XDEV -This option prevents -.Nm -from descending into directories that have a different device number -than the file from which the descent began. -.El -.Pp -The argument -.Fn compar -specifies a user-defined function which may be used to order the traversal -of the hierarchy. -It -takes two pointers to pointers to -.Vt FTSENT -structures as arguments and -should return a negative value, zero, or a positive value to indicate -if the file referenced by its first argument comes before, in any order -with respect to, or after, the file referenced by its second argument. -The -.Fa fts_accpath , -.Fa fts_path -and -.Fa fts_pathlen -fields of the -.Vt FTSENT -structures may -.Em never -be used in this comparison. -If the -.Fa fts_info -field is set to -.Dv FTS_NS -or -.Dv FTS_NSOK , -the -.Fa fts_statp -field may not either. -If the -.Fn compar -argument is -.Dv NULL , -the directory traversal order is in the order listed in -.Fa path_argv -for the root paths, and in the order listed in the directory for -everything else. -.Sh FTS_READ -The -.Fn fts_read -function returns a pointer to an -.Vt FTSENT -structure describing a file in -the hierarchy. -Directories (that are readable and do not cause cycles) are visited at -least twice, once in pre-order and once in post-order. -All other files are visited at least once. -(Hard links between directories that do not cause cycles or symbolic -links to symbolic links may cause files to be visited more than once, -or directories more than twice.) -.Pp -If all the members of the hierarchy have been returned, -.Fn fts_read -returns -.Dv NULL -and sets the external variable -.Va errno -to 0. -If an error unrelated to a file in the hierarchy occurs, -.Fn fts_read -returns -.Dv NULL -and sets -.Va errno -appropriately. -If an error related to a returned file occurs, a pointer to an -.Vt FTSENT -structure is returned, and -.Va errno -may or may not have been set (see -.Fa fts_info ) . -.Pp -The -.Vt FTSENT -structures returned by -.Fn fts_read -may be overwritten after a call to -.Fn fts_close -on the same file hierarchy stream, or, after a call to -.Fn fts_read -on the same file hierarchy stream unless they represent a file of type -directory, in which case they will not be overwritten until after a call to -.Fn fts_read -after the -.Vt FTSENT -structure has been returned by the function -.Fn fts_read -in post-order. -.Sh FTS_CHILDREN -The -.Fn fts_children -function returns a pointer to an -.Vt FTSENT -structure describing the first entry in a NULL-terminated linked list of -the files in the directory represented by the -.Vt FTSENT -structure most recently returned by -.Fn fts_read . -The list is linked through the -.Fa fts_link -field of the -.Vt FTSENT -structure, and is ordered by the user-specified comparison function, if any. -Repeated calls to -.Fn fts_children -will recreate this linked list. -.Pp -As a special case, if -.Fn fts_read -has not yet been called for a hierarchy, -.Fn fts_children -will return a pointer to the files in the logical directory specified to -.Fn fts_open , -i.e. the arguments specified to -.Fn fts_open . -Otherwise, if the -.Vt FTSENT -structure most recently returned by -.Fn fts_read -is not a directory being visited in pre-order, -or the directory does not contain any files, -.Fn fts_children -returns -.Dv NULL -and sets -.Va errno -to zero. -If an error occurs, -.Fn fts_children -returns -.Dv NULL -and sets -.Va errno -appropriately. -.Pp -The -.Vt FTSENT -structures returned by -.Fn fts_children -may be overwritten after a call to -.Fn fts_children , -.Fn fts_close -or -.Fn fts_read -on the same file hierarchy stream. -.Pp -.Em Option -may be set to the following value: -.Bl -tag -width FTS_NAMEONLY -.It Dv FTS_NAMEONLY -Only the names of the files are needed. -The contents of all the fields in the returned linked list of structures -are undefined with the exception of the -.Fa fts_name -and -.Fa fts_namelen -fields. -.El -.Sh FTS_SET -The function -.Fn fts_set -allows the user application to determine further processing for the -file -.Fa f -of the stream -.Fa ftsp . -The -.Fn fts_set -function -returns 0 on success, and \-1 if an error occurs. -.Em Option -must be set to one of the following values: -.Bl -tag -width FTS_PHYSICAL -.It Dv FTS_AGAIN -Re-visit the file; any file type may be re-visited. -The next call to -.Fn fts_read -will return the referenced file. -The -.Fa fts_stat -and -.Fa fts_info -fields of the structure will be reinitialized at that time, -but no other fields will have been changed. -This option is meaningful only for the most recently returned -file from -.Fn fts_read . -Normal use is for post-order directory visits, where it causes the -directory to be re-visited (in both pre and post-order) as well as all -of its descendants. -.It Dv FTS_FOLLOW -The referenced file must be a symbolic link. -If the referenced file is the one most recently returned by -.Fn fts_read , -the next call to -.Fn fts_read -returns the file with the -.Fa fts_info -and -.Fa fts_statp -fields reinitialized to reflect the target of the symbolic link instead -of the symbolic link itself. -If the file is one of those most recently returned by -.Fn fts_children , -the -.Fa fts_info -and -.Fa fts_statp -fields of the structure, when returned by -.Fn fts_read , -will reflect the target of the symbolic link instead of the symbolic link -itself. -In either case, if the target of the symbolic link does not exist the -fields of the returned structure will be unchanged and the -.Fa fts_info -field will be set to -.Dv FTS_SLNONE . -.Pp -If the target of the link is a directory, the pre-order return, followed -by the return of all of its descendants, followed by a post-order return, -is done. -.It Dv FTS_SKIP -No descendants of this file are visited. -The file may be one of those most recently returned by either -.Fn fts_children -or -.Fn fts_read . -.El -.Sh FTS_CLOSE -The -.Fn fts_close -function closes a file hierarchy stream -.Fa ftsp -and restores the current directory to the directory from which -.Fn fts_open -was called to open -.Fa ftsp . -The -.Fn fts_close -function -returns 0 on success, and \-1 if an error occurs. -.Sh ERRORS -The function -.Fn fts_open -may fail and set -.Va errno -for any of the errors specified for the library functions -.Xr open 2 -and -.Xr malloc 3 . -.Pp -The function -.Fn fts_close -may fail and set -.Va errno -for any of the errors specified for the library functions -.Xr chdir 2 -and -.Xr close 2 . -.Pp -The functions -.Fn fts_read -and -.Fn fts_children -may fail and set -.Va errno -for any of the errors specified for the library functions -.Xr chdir 2 , -.Xr malloc 3 , -.Xr opendir 3 , -.Xr readdir 3 -and -.Xr stat 2 . -.Pp -In addition, -.Fn fts_children , -.Fn fts_open -and -.Fn fts_set -may fail and set -.Va errno -as follows: -.Bl -tag -width Er -.It Bq Er EINVAL -The options were invalid. -.El -.Sh SEE ALSO -.Xr find 1 , -.Xr chdir 2 , -.Xr stat 2 , -.Xr qsort 3 -.Sh HISTORY -The -.Nm -interface was first introduced in -.Bx 4.4 . -The -.Fn fts_get_clientptr , -.Fn fts_get_stream , -and -.Fn fts_set_clientptr -functions were introduced in -.Fx 5.0 , -principally to provide for alternative interfaces to the -.Nm -functionality using different data structures. diff --git a/src/lib/libc/gen/getbootfile.3 b/src/lib/libc/gen/getbootfile.3 deleted file mode 100644 index f7c6906..0000000 --- a/src/lib/libc/gen/getbootfile.3 +++ /dev/null @@ -1,72 +0,0 @@ -.\" Copyright (c) 1983, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" From: @(#)gethostname.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getbootfile.3,v 1.11 2002/12/18 10:13:53 ru Exp $ -.\" -.Dd September 23, 1994 -.Dt GETBOOTFILE 3 -.Os -.Sh NAME -.Nm getbootfile -.Nd get kernel boot file name -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In paths.h -.Ft const char * -.Fn getbootfile void -.Sh DESCRIPTION -The -.Fn getbootfile -function retrieves the full pathname of the file from which the -current kernel was loaded, and returns a static pointer to the name. -A read/write interface to this information is available via the -.Xr sysctl 3 -MIB variable -.Dq Li kern.bootfile . -.Sh RETURN VALUES -If the call succeeds a string giving the pathname is returned. If it -fails, a null pointer is returned and an error code is -placed in the global location -.Va errno . -.Sh SEE ALSO -.Xr sysctl 3 -.Sh BUGS -If the boot blocks have not been modified to pass this information into -the kernel at boot time, the static string -.Dq Pa /boot/kernel/kernel -is returned instead of the real boot file. -.Sh HISTORY -The -.Fn getbootfile -function appeared in -.Fx 2.0 . diff --git a/src/lib/libc/gen/getbsize.3 b/src/lib/libc/gen/getbsize.3 deleted file mode 100644 index cf3bc8a..0000000 --- a/src/lib/libc/gen/getbsize.3 +++ /dev/null @@ -1,82 +0,0 @@ -.\" Copyright (c) 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getbsize.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getbsize.3,v 1.10 2002/12/30 11:12:16 obrien Exp $ -.\" -.Dd June 4, 1993 -.Dt GETBSIZE 3 -.Os -.Sh NAME -.Nm getbsize -.Nd get user block size -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In stdlib.h -.Ft char * -.Fn getbsize "int *headerlenp" "long *blocksizep" -.Sh DESCRIPTION -The -.Fn getbsize -function determines the user's preferred block size based on the value of the -.Dq BLOCKSIZE -environment variable; see -.Xr environ 7 -for details on its use and format. -.Pp -The -.Fn getbsize -function returns a pointer to a null-terminated string describing -the block size, something like -.Dq 1K-blocks . -The memory referenced by -.Fa headerlenp -is filled in with the length of the string (not including the -terminating null). -The memory referenced by -.Fa blocksizep -is filled in with block size, in bytes. -.Pp -If the user's block size is unreasonable, a warning message is -written to standard error and the returned information reflects -a block size of 512 bytes. -.Sh SEE ALSO -.Xr df 1 , -.Xr du 1 , -.Xr ls 1 , -.Xr systat 1 , -.Xr environ 7 -.Sh HISTORY -The -.Fn getbsize -function first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/gen/getcap.3 b/src/lib/libc/gen/getcap.3 deleted file mode 100644 index 1980a09..0000000 --- a/src/lib/libc/gen/getcap.3 +++ /dev/null @@ -1,544 +0,0 @@ -.\" Copyright (c) 1992, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Casey Leedom of Lawrence Livermore National Laboratory. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getcap.3 8.4 (Berkeley) 5/13/94 -.\" $FreeBSD: src/lib/libc/gen/getcap.3,v 1.23 2002/12/30 21:18:02 schweikh Exp $ -.\" -.Dd May 13, 1994 -.Dt GETCAP 3 -.Os -.Sh NAME -.Nm cgetent , -.Nm cgetset , -.Nm cgetmatch , -.Nm cgetcap , -.Nm cgetnum , -.Nm cgetstr , -.Nm cgetustr , -.Nm cgetfirst , -.Nm cgetnext , -.Nm cgetclose -.Nd capability database access routines -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In stdlib.h -.Ft int -.Fn cgetent "char **buf" "char **db_array" "char *name" -.Ft int -.Fn cgetset "char *ent" -.Ft int -.Fn cgetmatch "char *buf" "char *name" -.Ft char * -.Fn cgetcap "char *buf" "char *cap" "int type" -.Ft int -.Fn cgetnum "char *buf" "char *cap" "long *num" -.Ft int -.Fn cgetstr "char *buf" "char *cap" "char **str" -.Ft int -.Fn cgetustr "char *buf" "char *cap" "char **str" -.Ft int -.Fn cgetfirst "char **buf" "char **db_array" -.Ft int -.Fn cgetnext "char **buf" "char **db_array" -.Ft int -.Fn cgetclose "void" -.Sh DESCRIPTION -The -.Fn cgetent -function extracts the capability -.Fa name -from the database specified by the -.Dv NULL -terminated file array -.Fa db_array -and returns a pointer to a -.Xr malloc 3 Ns \&'d -copy of it in -.Fa buf . -The -.Fn cgetent -function will first look for files ending in -.Pa .db -(see -.Xr cap_mkdb 1 ) -before accessing the ASCII file. -The -.Fa buf -argument -must be retained through all subsequent calls to -.Fn cgetmatch , -.Fn cgetcap , -.Fn cgetnum , -.Fn cgetstr , -and -.Fn cgetustr , -but may then be -.Xr free 3 Ns \&'d . -On success 0 is returned, 1 if the returned -record contains an unresolved -.Ic tc -expansion, -\-1 if the requested record couldn't be found, -\-2 if a system error was encountered (couldn't open/read a file, etc.) also -setting -.Va errno , -and \-3 if a potential reference loop is detected (see -.Ic tc= -comments below). -.Pp -The -.Fn cgetset -function enables the addition of a character buffer containing a single capability -record entry -to the capability database. -Conceptually, the entry is added as the first ``file'' in the database, and -is therefore searched first on the call to -.Fn cgetent . -The entry is passed in -.Fa ent . -If -.Fa ent -is -.Dv NULL , -the current entry is removed from the database. -A call to -.Fn cgetset -must precede the database traversal. It must be called before the -.Fn cgetent -call. If a sequential access is being performed (see below), it must be called -before the first sequential access call -.Fn ( cgetfirst -or -.Fn cgetnext ) , -or be directly preceded by a -.Fn cgetclose -call. -On success 0 is returned and \-1 on failure. -.Pp -The -.Fn cgetmatch -function will return 0 if -.Fa name -is one of the names of the capability record -.Fa buf , -\-1 if -not. -.Pp -The -.Fn cgetcap -function searches the capability record -.Fa buf -for the capability -.Fa cap -with type -.Fa type . -A -.Fa type -is specified using any single character. If a colon (`:') is used, an -untyped capability will be searched for (see below for explanation of -types). A pointer to the value of -.Fa cap -in -.Fa buf -is returned on success, -.Dv NULL -if the requested capability couldn't be -found. The end of the capability value is signaled by a `:' or -.Tn ASCII -.Dv NUL -(see below for capability database syntax). -.Pp -The -.Fn cgetnum -function retrieves the value of the numeric capability -.Fa cap -from the capability record pointed to by -.Fa buf . -The numeric value is returned in the -.Ft long -pointed to by -.Fa num . -0 is returned on success, \-1 if the requested numeric capability couldn't -be found. -.Pp -The -.Fn cgetstr -function retrieves the value of the string capability -.Fa cap -from the capability record pointed to by -.Fa buf . -A pointer to a decoded, -.Dv NUL -terminated, -.Xr malloc 3 Ns \&'d -copy of the string is returned in the -.Ft char * -pointed to by -.Fa str . -The number of characters in the decoded string not including the trailing -.Dv NUL -is returned on success, \-1 if the requested string capability couldn't -be found, \-2 if a system error was encountered (storage allocation -failure). -.Pp -The -.Fn cgetustr -function is identical to -.Fn cgetstr -except that it does not expand special characters, but rather returns each -character of the capability string literally. -.Pp -The -.Fn cgetfirst -and -.Fn cgetnext -functions comprise a function group that provides for sequential -access of the -.Dv NULL -pointer terminated array of file names, -.Fa db_array . -The -.Fn cgetfirst -function returns the first record in the database and resets the access -to the first record. -The -.Fn cgetnext -function returns the next record in the database with respect to the -record returned by the previous -.Fn cgetfirst -or -.Fn cgetnext -call. If there is no such previous call, the first record in the database is -returned. -Each record is returned in a -.Xr malloc 3 Ns \&'d -copy pointed to by -.Fa buf . -.Ic Tc -expansion is done (see -.Ic tc= -comments below). -Upon completion of the database 0 is returned, 1 is returned upon successful -return of record with possibly more remaining (we haven't reached the end of -the database yet), 2 is returned if the record contains an unresolved -.Ic tc -expansion, \-1 is returned if a system error occurred, and \-2 -is returned if a potential reference loop is detected (see -.Ic tc= -comments below). -Upon completion of database (0 return) the database is closed. -.Pp -The -.Fn cgetclose -function closes the sequential access and frees any memory and file descriptors -being used. Note that it does not erase the buffer pushed by a call to -.Fn cgetset . -.Sh CAPABILITY DATABASE SYNTAX -Capability databases are normally -.Tn ASCII -and may be edited with standard -text editors. Blank lines and lines beginning with a `#' are comments -and are ignored. Lines ending with a `\|\e' indicate that the next line -is a continuation of the current line; the `\|\e' and following newline -are ignored. Long lines are usually continued onto several physical -lines by ending each line except the last with a `\|\e'. -.Pp -Capability databases consist of a series of records, one per logical -line. Each record contains a variable number of `:'-separated fields -(capabilities). Empty fields consisting entirely of white space -characters (spaces and tabs) are ignored. -.Pp -The first capability of each record specifies its names, separated by `|' -characters. These names are used to reference records in the database. -By convention, the last name is usually a comment and is not intended as -a lookup tag. For example, the -.Em vt100 -record from the -.Xr termcap 5 -database begins: -.Pp -.Dl "d0\||\|vt100\||\|vt100-am\||\|vt100am\||\|dec vt100:" -.Pp -giving four names that can be used to access the record. -.Pp -The remaining non-empty capabilities describe a set of (name, value) -bindings, consisting of a names optionally followed by a typed value: -.Bl -column "nameTvalue" -.It name Ta "typeless [boolean] capability" -.Em name No "is present [true]" -.It name Ns Em \&T Ns value Ta capability -.Pq Em name , \&T -has value -.Em value -.It name@ Ta "no capability" Em name No exists -.It name Ns Em T Ns \&@ Ta capability -.Pq Em name , T -does not exist -.El -.Pp -Names consist of one or more characters. Names may contain any character -except `:', but it's usually best to restrict them to the printable -characters and avoid use of graphics like `#', `=', `%', `@', etc. Types -are single characters used to separate capability names from their -associated typed values. Types may be any character except a `:'. -Typically, graphics like `#', `=', `%', etc. are used. Values may be any -number of characters and may contain any character except `:'. -.Sh CAPABILITY DATABASE SEMANTICS -Capability records describe a set of (name, value) bindings. Names may -have multiple values bound to them. Different values for a name are -distinguished by their -.Fa types . -The -.Fn cgetcap -function will return a pointer to a value of a name given the capability -name and the type of the value. -.Pp -The types `#' and `=' are conventionally used to denote numeric and -string typed values, but no restriction on those types is enforced. The -functions -.Fn cgetnum -and -.Fn cgetstr -can be used to implement the traditional syntax and semantics of `#' -and `='. -Typeless capabilities are typically used to denote boolean objects with -presence or absence indicating truth and false values respectively. -This interpretation is conveniently represented by: -.Pp -.Dl "(getcap(buf, name, ':') != NULL)" -.Pp -A special capability, -.Ic tc= name , -is used to indicate that the record specified by -.Fa name -should be substituted for the -.Ic tc -capability. -.Ic Tc -capabilities may interpolate records which also contain -.Ic tc -capabilities and more than one -.Ic tc -capability may be used in a record. A -.Ic tc -expansion scope (i.e., where the argument is searched for) contains the -file in which the -.Ic tc -is declared and all subsequent files in the file array. -.Pp -When a database is searched for a capability record, the first matching -record in the search is returned. When a record is scanned for a -capability, the first matching capability is returned; the capability -.Ic :nameT@: -will hide any following definition of a value of type -.Em T -for -.Fa name ; -and the capability -.Ic :name@: -will prevent any following values of -.Fa name -from being seen. -.Pp -These features combined with -.Ic tc -capabilities can be used to generate variations of other databases and -records by either adding new capabilities, overriding definitions with new -definitions, or hiding following definitions via `@' capabilities. -.Sh EXAMPLES -.Bd -unfilled -offset indent -example\||\|an example of binding multiple values to names:\e - :foo%bar:foo^blah:foo@:\e - :abc%xyz:abc^frap:abc$@:\e - :tc=more: -.Ed -.Pp -The capability foo has two values bound to it (bar of type `%' and blah of -type `^') and any other value bindings are hidden. The capability abc -also has two values bound but only a value of type `$' is prevented from -being defined in the capability record more. -.Pp -.Bd -unfilled -offset indent -file1: - new\||\|new_record\||\|a modification of "old":\e - :fript=bar:who-cares@:tc=old:blah:tc=extensions: -file2: - old\||\|old_record\||\|an old database record:\e - :fript=foo:who-cares:glork#200: -.Ed -.Pp -The records are extracted by calling -.Fn cgetent -with file1 preceding file2. -In the capability record new in file1, fript=bar overrides the definition -of fript=foo interpolated from the capability record old in file2, -who-cares@ prevents the definition of any who-cares definitions in old -from being seen, glork#200 is inherited from old, and blah and anything -defined by the record extensions is added to those definitions in old. -Note that the position of the fript=bar and who-cares@ definitions before -tc=old is important here. If they were after, the definitions in old -would take precedence. -.Sh CGETNUM AND CGETSTR SYNTAX AND SEMANTICS -Two types are predefined by -.Fn cgetnum -and -.Fn cgetstr : -.Bl -column "nameXnumber" -.Sm off -.It Em name No \&# Em number Ta numeric -.Sm on -capability -.Em name -has value -.Em number -.Sm off -.It Em name No = Em string Ta "string capability" -.Sm on -.Em name -has value -.Em string -.Sm off -.It Em name No \&#@ Ta "the numeric capability" -.Sm on -.Em name -does not exist -.Sm off -.It Em name No \&=@ Ta "the string capability" -.Sm on -.Em name -does not exist -.El -.Pp -Numeric capability values may be given in one of three numeric bases. -If the number starts with either -.Ql 0x -or -.Ql 0X -it is interpreted as a hexadecimal number (both upper and lower case a-f -may be used to denote the extended hexadecimal digits). -Otherwise, if the number starts with a -.Ql 0 -it is interpreted as an octal number. -Otherwise the number is interpreted as a decimal number. -.Pp -String capability values may contain any character. Non-printable -.Dv ASCII -codes, new lines, and colons may be conveniently represented by the use -of escape sequences: -.Bl -column "\e\|X,X\e\|X" "(ASCII octal nnn)" -^X ('X' & 037) control-X -\e\|b, \e\|B (ASCII 010) backspace -\e\|t, \e\|T (ASCII 011) tab -\e\|n, \e\|N (ASCII 012) line feed (newline) -\e\|f, \e\|F (ASCII 014) form feed -\e\|r, \e\|R (ASCII 015) carriage return -\e\|e, \e\|E (ASCII 027) escape -\e\|c, \e\|C (:) colon -\e\|\e (\e\|) back slash -\e\|^ (^) caret -\e\|nnn (ASCII octal nnn) -.El -.Pp -A `\|\e' may be followed by up to three octal digits directly specifies -the numeric code for a character. The use of -.Tn ASCII -.Dv NUL Ns s , -while easily -encoded, causes all sorts of problems and must be used with care since -.Dv NUL Ns s -are typically used to denote the end of strings; many applications -use `\e\|200' to represent a -.Dv NUL . -.Sh DIAGNOSTICS -The -.Fn cgetent , -.Fn cgetset , -.Fn cgetmatch , -.Fn cgetnum , -.Fn cgetstr , -.Fn cgetustr , -.Fn cgetfirst , -and -.Fn cgetnext -functions -return a value greater than or equal to 0 on success and a value less -than 0 on failure. -The -.Fn cgetcap -function returns a character pointer on success and a -.Dv NULL -on failure. -.Pp -The -.Fn cgetent , -and -.Fn cgetseq -functions may fail and set -.Va errno -for any of the errors specified for the library functions: -.Xr fopen 3 , -.Xr fclose 3 , -.Xr open 2 , -and -.Xr close 2 . -.Pp -The -.Fn cgetent , -.Fn cgetset , -.Fn cgetstr , -and -.Fn cgetustr -functions -may fail and set -.Va errno -as follows: -.Bl -tag -width Er -.It Bq Er ENOMEM -No memory to allocate. -.El -.Sh SEE ALSO -.Xr cap_mkdb 1 , -.Xr malloc 3 -.Sh BUGS -Colons (`:') can't be used in names, types, or values. -.Pp -There are no checks for -.Ic tc Ns = Ns Ic name -loops in -.Fn cgetent . -.Pp -The buffer added to the database by a call to -.Fn cgetset -is not unique to the database but is rather prepended to any database used. diff --git a/src/lib/libc/gen/getcontext.3 b/src/lib/libc/gen/getcontext.3 deleted file mode 100644 index 3f98e86..0000000 --- a/src/lib/libc/gen/getcontext.3 +++ /dev/null @@ -1,121 +0,0 @@ -.\" Copyright (c) 2002 Packet Design, LLC. -.\" All rights reserved. -.\" -.\" Subject to the following obligations and disclaimer of warranty, -.\" use and redistribution of this software, in source or object code -.\" forms, with or without modifications are expressly permitted by -.\" Packet Design; provided, however, that: -.\" -.\" (i) Any and all reproductions of the source or object code -.\" must include the copyright notice above and the following -.\" disclaimer of warranties; and -.\" (ii) No rights are granted, in any manner or form, to use -.\" Packet Design trademarks, including the mark "PACKET DESIGN" -.\" on advertising, endorsements, or otherwise except as such -.\" appears in the above copyright notice or in the software. -.\" -.\" THIS SOFTWARE IS BEING PROVIDED BY PACKET DESIGN "AS IS", AND -.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, PACKET DESIGN MAKES NO -.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING -.\" THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED -.\" WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, -.\" OR NON-INFRINGEMENT. PACKET DESIGN DOES NOT WARRANT, GUARANTEE, -.\" OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS -.\" OF THE USE OF THIS SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, -.\" RELIABILITY OR OTHERWISE. IN NO EVENT SHALL PACKET DESIGN BE -.\" LIABLE FOR ANY DAMAGES RESULTING FROM OR ARISING OUT OF ANY USE -.\" OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY DIRECT, -.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE, OR CONSEQUENTIAL -.\" DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF -.\" USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER 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 PACKET DESIGN IS ADVISED OF -.\" THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD: src/lib/libc/gen/getcontext.3,v 1.2 2002/12/04 15:47:41 ru Exp $ -.\" -.Dd September 10, 2002 -.Dt GETCONTEXT 3 -.Os -.Sh NAME -.Nm getcontext , setcontext -.Nd get and set user thread context -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In ucontext.h -.Ft int -.Fn getcontext "ucontext_t *ucp" -.Ft int -.Fn setcontext "const ucontext_t *ucp" -.Sh DESCRIPTION -The -.Fn getcontext -function -saves the current thread's execution context in the structure pointed to by -.Fa ucp . -This saved context may then later be restored by calling -.Fn setcontext . -.Pp -The -.Fn setcontext -function -makes a previously saved thread context the current thread context, i.e., -the current context is lost and -.Fn setcontext -does not return. -Instead, execution continues in the context specified by -.Fa ucp , -which must have been previously initialized by a call to -.Fn setcontext , -.Xr makecontext 3 , -or by being passed as an argument to a signal handler (see -.Xr sigaction 2 ) . -.Pp -If -.Fa ucp -was initialized by -.Fn getcontext , -then execution continues as if the original -.Fn getcontext -call had just returned (again). -.Pp -If -.Fa ucp -was initialized by -.Xr makecontext 3 , -execution continues with the invocation of the function specified to -.Xr makecontext 3 . -When that function returns, -.Fa "ucp->uc_link" -determines what happens next: -if -.Fa "ucp->uc_link" -is -.Dv NULL , -the process exits; -otherwise, -.Fn setcontext "ucp->uc_link" -is implicitly invoked. -.Pp -If -.Fa ucp -was initialized by the invocation of a signal handler, execution continues -at the point the thread was interrupted by the signal. -.Sh RETURN VALUES -If successful, -.Fn getcontext -returns zero and -.Fn setcontext -does not return; otherwise \-1 is returned. -.Sh ERRORS -No errors are defined for -.Fn getcontext -or -.Fn setcontext . -.Sh SEE ALSO -.Xr sigaction 2 , -.Xr sigaltstack 2 , -.Xr makecontext 3 , -.Xr ucontext 3 diff --git a/src/lib/libc/gen/getcwd.3 b/src/lib/libc/gen/getcwd.3 deleted file mode 100644 index e7591d9..0000000 --- a/src/lib/libc/gen/getcwd.3 +++ /dev/null @@ -1,158 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getcwd.3 8.2 (Berkeley) 12/11/93 -.\" $FreeBSD: src/lib/libc/gen/getcwd.3,v 1.16 2003/09/08 19:57:14 ru Exp $ -.\" -.Dd November 24, 1997 -.Dt GETCWD 3 -.Os -.Sh NAME -.Nm getcwd , -.Nm getwd -.Nd get working directory pathname -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft char * -.Fn getcwd "char *buf" "size_t size" -.Ft char * -.Fn getwd "char *buf" -.Sh DESCRIPTION -The -.Fn getcwd -function copies the absolute pathname of the current working directory -into the memory referenced by -.Fa buf -and returns a pointer to -.Fa buf . -The -.Fa size -argument is the size, in bytes, of the array referenced by -.Fa buf . -.Pp -If -.Fa buf -is -.Dv NULL , -space is allocated as necessary to store the pathname. -This space may later be -.Xr free 3 Ns 'd . -.Pp -The function -.Fn getwd -is a compatibility routine which calls -.Fn getcwd -with its -.Fa buf -argument and a size of -.Dv MAXPATHLEN -(as defined in the include -file -.In sys/param.h ) . -Obviously, -.Fa buf -should be at least -.Dv MAXPATHLEN -bytes in length. -.Pp -These routines have traditionally been used by programs to save the -name of a working directory for the purpose of returning to it. -A much faster and less error-prone method of accomplishing this is to -open the current directory -.Pq Ql .\& -and use the -.Xr fchdir 2 -function to return. -.Sh RETURN VALUES -Upon successful completion, a pointer to the pathname is returned. -Otherwise a -.Dv NULL -pointer is returned and the global variable -.Va errno -is set to indicate the error. -In addition, -.Fn getwd -copies the error message associated with -.Va errno -into the memory referenced by -.Fa buf . -.Sh ERRORS -The -.Fn getcwd -function -will fail if: -.Bl -tag -width Er -.It Bq Er EACCES -Read or search permission was denied for a component of the pathname. -.It Bq Er EINVAL -The -.Fa size -argument is zero. -.It Bq Er ENOENT -A component of the pathname no longer exists. -.It Bq Er ENOMEM -Insufficient memory is available. -.It Bq Er ERANGE -The -.Fa size -argument is greater than zero but smaller than the length of the pathname -plus 1. -.El -.Sh SEE ALSO -.Xr chdir 2 , -.Xr fchdir 2 , -.Xr malloc 3 , -.Xr strerror 3 -.Sh STANDARDS -The -.Fn getcwd -function -conforms to -.St -p1003.1-90 . -The ability to specify a -.Dv NULL -pointer and have -.Fn getcwd -allocate memory as necessary is an extension. -.Sh HISTORY -The -.Fn getwd -function appeared in -.Bx 4.0 . -.Sh BUGS -The -.Fn getwd -function -does not do sufficient error checking and is not able to return very -long, but valid, paths. -It is provided for compatibility. diff --git a/src/lib/libc/gen/getdiskbyname.3 b/src/lib/libc/gen/getdiskbyname.3 deleted file mode 100644 index 2ee6833..0000000 --- a/src/lib/libc/gen/getdiskbyname.3 +++ /dev/null @@ -1,67 +0,0 @@ -.\" Copyright (c) 1983, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getdiskbyname.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getdiskbyname.3,v 1.8 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt GETDISKBYNAME 3 -.Os -.Sh NAME -.Nm getdiskbyname -.Nd get generic disk description by its name -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/disklabel.h -.Ft struct disklabel * -.Fn getdiskbyname "const char *name" -.Sh DESCRIPTION -The -.Fn getdiskbyname -function -takes a disk name (e.g.\& -.Ql rm03 ) -and returns a prototype disk label -describing its geometry information and the standard -disk partition tables. All information is obtained from -the -.Xr disktab 5 -file. -.Sh SEE ALSO -.Xr disklabel 5 , -.Xr disktab 5 , -.Xr disklabel 8 -.Sh HISTORY -The -.Fn getdiskbyname -function appeared in -.Bx 4.3 . diff --git a/src/lib/libc/gen/getdomainname.3 b/src/lib/libc/gen/getdomainname.3 deleted file mode 100644 index c4582c3..0000000 --- a/src/lib/libc/gen/getdomainname.3 +++ /dev/null @@ -1,103 +0,0 @@ -.\" Copyright (c) 1983, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)gethostname.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getdomainname.3,v 1.18 2003/09/10 19:24:32 ru Exp $ -.\" -.Dd May 6, 1994 -.Dt GETDOMAINNAME 3 -.Os -.Sh NAME -.Nm getdomainname , -.Nm setdomainname -.Nd get/set the NIS domain name of current host -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft int -.Fn getdomainname "char *name" "int namelen" -.Ft int -.Fn setdomainname "const char *name" "int namelen" -.Sh DESCRIPTION -The -.Fn getdomainname -function -returns the standard NIS domain name for the current host, as -previously set by -.Fn setdomainname . -The -.Fa namelen -argument -specifies the size of the -.Fa name -array. The returned name is null-terminated unless insufficient -space is provided. -.Pp -The -.Fn setdomainname -function -sets the NIS domain name of the host machine to be -.Fa name , -which has length -.Fa namelen . -This call is restricted to the super-user and -is normally used only when the system is bootstrapped. -.Sh RETURN VALUES -.Rv -std -.Sh ERRORS -The following errors may be returned by these calls: -.Bl -tag -width Er -.It Bq Er EFAULT -The -.Fa name -or -.Fa namelen -argument gave an -invalid address. -.It Bq Er EPERM -The caller tried to set the hostname and was not the super-user. -.El -.Sh SEE ALSO -.Xr gethostid 3 , -.Xr gethostname 3 , -.Xr sysctl 3 -.Sh BUGS -Domain names are limited to -.Dv MAXHOSTNAMELEN -(from -.In sys/param.h ) -characters, currently 256. -.Sh HISTORY -The -.Fn getdomainname -function appeared in -.Bx 4.2 . diff --git a/src/lib/libc/gen/getfsent.3 b/src/lib/libc/gen/getfsent.3 deleted file mode 100644 index af43be2..0000000 --- a/src/lib/libc/gen/getfsent.3 +++ /dev/null @@ -1,189 +0,0 @@ -.\" Copyright (c) 1983, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getfsent.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getfsent.3,v 1.16 2004/06/21 19:30:45 mpp Exp $ -.\" -.Dd April 7, 2003 -.Dt GETFSENT 3 -.Os -.Sh NAME -.Nm getfsent , -.Nm getfsspec , -.Nm getfsfile , -.Nm setfsent , -.Nm endfsent -.Nd get file system descriptor file entry -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In fstab.h -.Ft "struct fstab *" -.Fn getfsent void -.Ft "struct fstab *" -.Fn getfsspec "const char *spec" -.Ft "struct fstab *" -.Fn getfsfile "const char *file" -.Ft int -.Fn setfsent void -.Ft void -.Fn endfsent void -.Ft void -.Fn setfstab "const char *file" -.Ft "const char *" -.Fn getfstab void -.Sh DESCRIPTION -The -.Fn getfsent , -.Fn getfsspec , -and -.Fn getfsfile -functions -each return a pointer to an object with the following structure -containing the broken-out fields of a line in the file system -description file, -.In fstab.h . -.Bd -literal -offset indent -struct fstab { - char *fs_spec; /* block special device name */ - char *fs_file; /* file system path prefix */ - char *fs_vfstype; /* File system type, ufs, nfs */ - char *fs_mntops; /* Mount options ala -o */ - char *fs_type; /* FSTAB_* from fs_mntops */ - int fs_freq; /* dump frequency, in days */ - int fs_passno; /* pass number on parallel fsck */ -}; -.Ed -.Pp -The fields have meanings described in -.Xr fstab 5 . -.Pp -The -.Fn setfsent -function -opens the file (closing any previously opened file) or rewinds it -if it is already open. -.Pp -The -.Fn endfsent -function -closes the file. -.Pp -The -.Fn setfstab -function sets the file to be used by subsequent operations. -The value set by -.Fn setfstab -does not persist across calls to -.Fn endfsent . -.Pp -The -.Fn getfstab -function returns the name of the file that will be used. -.Pp -The -.Fn getfsspec -and -.Fn getfsfile -functions -search the entire file (opening it if necessary) for a matching special -file name or file system file name. -.Pp -For programs wishing to read the entire database, -.Fn getfsent -reads the next entry (opening the file if necessary). -.Pp -All entries in the file with a type field equivalent to -.Dv FSTAB_XX -are ignored. -.Sh RETURN VALUES -The -.Fn getfsent , -.Fn getfsspec , -and -.Fn getfsfile -functions -return a -.Dv NULL -pointer on -.Dv EOF -or error. -The -.Fn setfsent -function -returns 0 on failure, 1 on success. -The -.Fn endfsent -function -returns nothing. -.Sh ENVIRONMENT -.Bl -tag -width ".Ev PATH_FSTAB" -.It Ev PATH_FSTAB -If the environment variable -.Ev PATH_FSTAB -is set, all operations are performed against the specified file. -.Ev PATH_FSTAB -will not be honored if the process environment or memory address space is -considered -.Dq tainted . -(See -.Xr issetugid 2 -for more information.) -.El -.Sh FILES -.Bl -tag -width /etc/fstab -compact -.It Pa /etc/fstab -.El -.Sh SEE ALSO -.Xr fstab 5 -.Sh HISTORY -The -.Fn getfsent -function appeared in -.Bx 4.0 ; -the -.Fn endfsent , -.Fn getfsfile , -.Fn getfsspec , -and -.Fn setfsent -functions appeared in -.Bx 4.3 ; -the -.Fn setfstab -and -.Fn getfstab -functions appeared in -.Fx 5.1 . -.Sh BUGS -These functions use static data storage; -if the data is needed for future use, it should be -copied before any subsequent calls overwrite it. diff --git a/src/lib/libc/gen/getgrent.3 b/src/lib/libc/gen/getgrent.3 deleted file mode 100644 index bcd366f..0000000 --- a/src/lib/libc/gen/getgrent.3 +++ /dev/null @@ -1,287 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" From: @(#)getgrent.3 8.2 (Berkeley) 4/19/94 -.\" $FreeBSD: src/lib/libc/gen/getgrent.3,v 1.24 2004/05/17 22:15:49 kientzle Exp $ -.\" -.Dd April 16, 2003 -.Dt GETGRENT 3 -.Os -.Sh NAME -.Nm getgrent , -.Nm getgrent_r , -.Nm getgrnam , -.Nm getgrnam_r , -.Nm getgrgid , -.Nm getgrgid_r , -.Nm setgroupent , -.Nm setgrent , -.Nm endgrent -.Nd group database operations -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In grp.h -.Ft struct group * -.Fn getgrent void -.Ft int -.Fn getgrent_r "struct group *grp" "char *buffer" "size_t bufsize" "struct group **result" -.Ft struct group * -.Fn getgrnam "const char *name" -.Ft int -.Fn getgrnam_r "const char *name" "struct group *grp" "char *buffer" "size_t bufsize" "struct group **result" -.Ft struct group * -.Fn getgrgid "gid_t gid" -.Ft int -.Fn getgrgid_r "gid_t gid" "struct group *grp" "char *buffer" "size_t bufsize" "struct group **result" -.Ft int -.Fn setgroupent "int stayopen" -.Ft int -.Fn setgrent void -.Ft void -.Fn endgrent void -.Sh DESCRIPTION -These functions operate on the group database file -.Pa /etc/group -which is described -in -.Xr group 5 . -Each line of the database is defined by the structure -.Vt group -found in the include -file -.In grp.h : -.Bd -literal -offset indent -struct group { - char *gr_name; /* group name */ - char *gr_passwd; /* group password */ - gid_t gr_gid; /* group id */ - char **gr_mem; /* group members */ -}; -.Ed -.Pp -The functions -.Fn getgrnam -and -.Fn getgrgid -search the group database for the given group name pointed to by -.Fa name -or the group id pointed to by -.Fa gid , -respectively, returning the first one encountered. Identical group -names or group gids may result in undefined behavior. -.Pp -The -.Fn getgrent -function -sequentially reads the group database and is intended for programs -that wish to step through the complete list of groups. -.Pp -The functions -.Fn getgrent_r , -.Fn getgrnam_r , -and -.Fn getgrgid_r -are thread-safe versions of -.Fn getgrent , -.Fn getgrnam , -and -.Fn getgrgid , -respectively. -The caller must provide storage for the results of the search in -the -.Fa grp , -.Fa buffer , -.Fa bufsize , -and -.Fa result -arguments. -When these functions are successful, the -.Fa grp -argument will be filled-in, and a pointer to that argument will be -stored in -.Fa result . -If an entry is not found or an error occurs, -.Fa result -will be set to -.Dv NULL . -.Pp -These functions will open the group file for reading, if necessary. -.Pp -The -.Fn setgroupent -function -opens the file, or rewinds it if it is already open. If -.Fa stayopen -is non-zero, file descriptors are left open, significantly speeding -functions subsequent calls. This functionality is unnecessary for -.Fn getgrent -as it doesn't close its file descriptors by default. It should also -be noted that it is dangerous for long-running programs to use this -functionality as the group file may be updated. -.Pp -The -.Fn setgrent -function -is identical to -.Fn setgroupent -with an argument of zero. -.Pp -The -.Fn endgrent -function -closes any open files. -.Sh RETURN VALUES -The functions -.Fn getgrent , -.Fn getgrnam , -and -.Fn getgrgid , -return a pointer to a group structure on success or -.Dv NULL -if the entry is not found or if an error occurs. -If an error does occur, -.Va errno -will be set. -Note that programs must explicitly set -.Va errno -to zero before calling any of these functions if they need to -distinguish between a non-existent entry and an error. -The functions -.Fn getgrent_r , -.Fn getgrnam_r , -and -.Fn getgrgid_r -return 0 if no error occurred, or an error number to indicate failure. -It is not an error if a matching entry is not found. -(Thus, if -.Fa result -is set to -.Dv NULL -and the return value is 0, no matching entry exists.) -.Pp -The functions -.Fn setgroupent -and -.Fn setgrent -return the value 1 if successful, otherwise the value -0 is returned. -The functions -.Fn endgrent -and -.Fn setgrfile -have no return value. -.Sh FILES -.Bl -tag -width /etc/group -compact -.It Pa /etc/group -group database file -.El -.Sh SEE ALSO -.Xr getpwent 3 , -.Xr group 5 , -.Xr nsswitch.conf 5 , -.Xr yp 8 -.Sh HISTORY -The functions -.Fn endgrent , -.Fn getgrent , -.Fn getgrnam , -.Fn getgrgid , -and -.Fn setgrent -appeared in -.At v7 . -The functions -.Fn setgrfile -and -.Fn setgroupent -appeared in -.Bx 4.3 Reno . -The functions -.Fn getgrent_r , -.Fn getgrnam_r , -and -.Fn getgrgid_r -appeared in -.Fx 5.1 . -.Sh STANDARDS -The -.Fn getgrent , -.Fn getgrnam , -.Fn getgrnam_r , -.Fn getgrgid , -.Fn getgrgid_r -and -.Fn endgrent -functions conform to -.St -p1003.1-96 . -The -.Fn setgrent -function differs from that standard in that its return type is -.Vt int -rather than -.Vt void . -.Sh COMPATIBILITY -The historic function -.Fn setgrfile , -which allowed the specification of alternate password databases, has -been deprecated and is no longer available. -.Sh BUGS -The functions -.Fn getgrent , -.Fn getgrnam , -.Fn getgrgid , -.Fn setgroupent -and -.Fn setgrent -leave their results in an internal static object and return -a pointer to that object. -Subsequent calls to -the same function -will modify the same object. -.Pp -The functions -.Fn getgrent , -.Fn getgrent_r , -.Fn endgrent , -.Fn setgroupent , -and -.Fn setgrent -are fairly useless in a networked environment and should be -avoided, if possible. -The -.Fn getgrent -and -.Fn getgrent_r -functions -make no attempt to suppress duplicate information if multiple -sources are specified in -.Xr nsswitch.conf 5 . diff --git a/src/lib/libc/gen/getgrouplist.3 b/src/lib/libc/gen/getgrouplist.3 deleted file mode 100644 index 5a923e3..0000000 --- a/src/lib/libc/gen/getgrouplist.3 +++ /dev/null @@ -1,96 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getgrouplist.3 8.1 (Berkeley) 6/9/93 -.\" $FreeBSD: src/lib/libc/gen/getgrouplist.3,v 1.8 2002/01/22 17:32:53 markm Exp $ -.\" -.Dd June 9, 1993 -.Dt GETGROUPLIST 3 -.Os -.Sh NAME -.Nm getgrouplist -.Nd calculate group access list -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft int -.Fn getgrouplist "const char *name" "gid_t basegid" "gid_t *groups" "int *ngroups" -.Sh DESCRIPTION -The -.Fn getgrouplist -function reads through the group file and calculates -the group access list for the user specified in -.Fa name . -The -.Fa basegid -is automatically included in the groups list. -Typically this value is given as -the group number from the password file. -.Pp -The resulting group list is returned in the array pointed to by -.Fa groups . -The caller specifies the size of the -.Fa groups -array in the integer pointed to by -.Fa ngroups ; -the actual number of groups found is returned in -.Fa ngroups . -.Sh RETURN VALUES -The -.Fn getgrouplist -function -returns \-1 if the size of the group list is too small to -hold all the user's groups. -Here, the group array will be filled with as many groups as will fit. -.Sh FILES -.Bl -tag -width /etc/group -compact -.It Pa /etc/group -group membership list -.El -.Sh SEE ALSO -.Xr setgroups 2 , -.Xr initgroups 3 -.Sh HISTORY -The -.Fn getgrouplist -function first appeared in -.Bx 4.4 . -.Sh BUGS -The -.Fn getgrouplist -function -uses the routines based on -.Xr getgrent 3 . -If the invoking program uses any of these routines, -the group structure will -be overwritten in the call to -.Fn getgrouplist . diff --git a/src/lib/libc/gen/gethostname.3 b/src/lib/libc/gen/gethostname.3 deleted file mode 100644 index e43f3fe..0000000 --- a/src/lib/libc/gen/gethostname.3 +++ /dev/null @@ -1,134 +0,0 @@ -.\" Copyright (c) 1983, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)gethostname.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/gethostname.3,v 1.15 2003/09/08 19:57:14 ru Exp $ -.\" -.Dd August 18, 2003 -.Dt GETHOSTNAME 3 -.Os -.Sh NAME -.Nm gethostname , -.Nm sethostname -.Nd get/set name of current host -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft int -.Fn gethostname "char *name" "size_t namelen" -.Ft int -.Fn sethostname "const char *name" "int namelen" -.Sh DESCRIPTION -The -.Fn gethostname -function -returns the standard host name for the current processor, as -previously set by -.Fn sethostname . -The -.Fa namelen -argument -specifies the size of the -.Fa name -array. -The returned name is null-terminated unless insufficient space is provided. -.Pp -The -.Fn sethostname -function -sets the name of the host machine to be -.Fa name , -which has length -.Fa namelen . -This call is restricted to the super-user and -is normally used only when the system is bootstrapped. -.Pp -Host names are limited to -.Brq Dv HOST_NAME_MAX -characters, not including the trailing null, currently 255. -.Sh RETURN VALUES -.Rv -std -.Sh ERRORS -The following errors may be returned by these calls: -.Bl -tag -width Er -.It Bq Er EFAULT -The -.Fa name -or -.Fa namelen -argument gave an -invalid address. -.It Bq Er ENAMETOOLONG -The current host name is longer than -.Fa namelen . (For -.Fn gethostname -only.) -.It Bq Er EPERM -The caller tried to set the host name and was not the super-user. -.El -.Sh SEE ALSO -.Xr sysconf 3 , -.Xr sysctl 3 -.Sh STANDARDS -The -.Fn gethostname -function conforms to -.St -p1003.1-2001 . -Callers should be aware that -.Brq Dv HOST_NAME_MAX -may be variable or infinite, but is guaranteed to be no less than -.Brq Dv _POSIX_HOST_NAME_MAX . -On older systems, this limit was defined in the non-standard header -.In sys/param.h -as -.Dv MAXHOSTNAMELEN , -and counted the terminating null. -The -.Fn sethostname -function and the error returns for -.Fn gethostname -are not standardized. -.Sh HISTORY -The -.Fn gethostname -function appeared in -.Bx 4.2 . -The -.Fa namelen -argument to -.Fn gethostname -was changed to -.Vt size_t -in -.Fx 5.2 -for alignment with -.St -p1003.1-2001 . diff --git a/src/lib/libc/gen/getloadavg.3 b/src/lib/libc/gen/getloadavg.3 deleted file mode 100644 index 24e7cdf..0000000 --- a/src/lib/libc/gen/getloadavg.3 +++ /dev/null @@ -1,69 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getloadavg.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getloadavg.3,v 1.8 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt GETLOADAVG 3 -.Os -.Sh NAME -.Nm getloadavg -.Nd get system load averages -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In stdlib.h -.Ft int -.Fn getloadavg "double loadavg[]" "int nelem" -.Sh DESCRIPTION -The -.Fn getloadavg -function returns the number of processes in the system run queue -averaged over various periods of time. -Up to -.Fa nelem -samples are retrieved and assigned to successive elements of -.Fa loadavg Ns Bq . -The system imposes a maximum of 3 samples, representing averages -over the last 1, 5, and 15 minutes, respectively. -.Sh DIAGNOSTICS -If the load average was unobtainable, \-1 is returned; otherwise, -the number of samples actually retrieved is returned. -.Sh SEE ALSO -.Xr uptime 1 , -.Xr kvm_getloadavg 3 , -.Xr sysctl 3 -.Sh HISTORY -The -.Fn getloadavg -function appeared in -.Bx 4.3 Reno . diff --git a/src/lib/libc/gen/getmntinfo.3 b/src/lib/libc/gen/getmntinfo.3 deleted file mode 100644 index 307d494..0000000 --- a/src/lib/libc/gen/getmntinfo.3 +++ /dev/null @@ -1,113 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getmntinfo.3 8.1 (Berkeley) 6/9/93 -.\" $FreeBSD: src/lib/libc/gen/getmntinfo.3,v 1.12 2002/12/19 09:40:21 ru Exp $ -.\" -.Dd June 9, 1993 -.Dt GETMNTINFO 3 -.Os -.Sh NAME -.Nm getmntinfo -.Nd get information about mounted file systems -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/param.h -.In sys/ucred.h -.In sys/mount.h -.Ft int -.Fn getmntinfo "struct statfs **mntbufp" "int flags" -.Sh DESCRIPTION -The -.Fn getmntinfo -function -returns an array of -.Fn statfs -structures describing each currently mounted file system (see -.Xr statfs 2 ) . -.Pp -The -.Fn getmntinfo -function -passes its -.Fa flags -argument transparently to -.Xr getfsstat 2 . -.Sh RETURN VALUES -On successful completion, -.Fn getmntinfo -returns a count of the number of elements in the array. -The pointer to the array is stored into -.Fa mntbufp . -.Pp -If an error occurs, zero is returned and the external variable -.Va errno -is set to indicate the error. -Although the pointer -.Fa mntbufp -will be unmodified, any information previously returned by -.Fn getmntinfo -will be lost. -.Sh ERRORS -The -.Fn getmntinfo -function -may fail and set errno for any of the errors specified for the library -routines -.Xr getfsstat 2 -or -.Xr malloc 3 . -.Sh SEE ALSO -.Xr getfsstat 2 , -.Xr mount 2 , -.Xr statfs 2 , -.Xr mount 8 -.Sh HISTORY -The -.Fn getmntinfo -function first appeared in -.Bx 4.4 . -.Sh BUGS -The -.Fn getmntinfo -function writes the array of structures to an internal static object -and returns -a pointer to that object. -Subsequent calls to -.Fn getmntinfo -will modify the same object. -.Pp -The memory allocated by -.Fn getmntinfo -cannot be -.Xr free 3 Ns 'd -by the application. diff --git a/src/lib/libc/gen/getnetgrent.3 b/src/lib/libc/gen/getnetgrent.3 deleted file mode 100644 index eb2b252..0000000 --- a/src/lib/libc/gen/getnetgrent.3 +++ /dev/null @@ -1,135 +0,0 @@ -.\" Copyright (c) 1992, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getnetgrent.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getnetgrent.3,v 1.11 2002/12/18 10:13:54 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt GETNETGRENT 3 -.Os -.Sh NAME -.Nm getnetgrent , -.Nm innetgr , -.Nm setnetgrent , -.Nm endnetgrent -.Nd netgroup database operations -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In netdb.h -.Ft int -.Fn getnetgrent "char **host" "char **user" "char **domain" -.Ft int -.Fn innetgr "const char *netgroup" "const char *host" "const char *user" "const char *domain" -.Ft void -.Fn setnetgrent "const char *netgroup" -.Ft void -.Fn endnetgrent void -.Sh DESCRIPTION -These functions operate on the netgroup database file -.Pa /etc/netgroup -which is described -in -.Xr netgroup 5 . -The database defines a set of netgroups, each made up of one or more triples: -.Bd -literal -offset indent -(host, user, domain) -.Ed -that defines a combination of host, user and domain. -Any of the three fields may be specified as ``wildcards'' that match any -string. -.Pp -The function -.Fn getnetgrent -sets the three pointer arguments to the strings of the next member of the -current netgroup. -If any of the string pointers are -.Sy (char *)0 -that field is considered a wildcard. -.Pp -The functions -.Fn setnetgrent -and -.Fn endnetgrent -set the current netgroup and terminate the current netgroup respectively. -If -.Fn setnetgrent -is called with a different netgroup than the previous call, an implicit -.Fn endnetgrent -is implied. -The -.Fn setnetgrent -function -also sets the offset to the first member of the netgroup. -.Pp -The function -.Fn innetgr -searches for a match of all fields within the specified group. -If any of the -.Sy host , -.Sy user , -or -.Sy domain -arguments are -.Sy (char *)0 -those fields will match any string value in the netgroup member. -.Sh RETURN VALUES -The function -.Fn getnetgrent -returns 0 for ``no more netgroup members'' and 1 otherwise. -The function -.Fn innetgr -returns 1 for a successful match and 0 otherwise. -The functions -.Fn setnetgrent -and -.Fn endnetgrent -have no return value. -.Sh FILES -.Bl -tag -width /etc/netgroup -compact -.It Pa /etc/netgroup -netgroup database file -.El -.Sh SEE ALSO -.Xr netgroup 5 -.Sh COMPATIBILITY -The netgroup members have three string fields to maintain compatibility -with other vendor implementations, however it is not obvious what use the -.Sy domain -string has within -.Bx . -.Sh BUGS -The function -.Fn getnetgrent -returns pointers to dynamically allocated data areas that are freed when -the function -.Fn endnetgrent -is called. diff --git a/src/lib/libc/gen/getobjformat.3 b/src/lib/libc/gen/getobjformat.3 deleted file mode 100644 index 4753273..0000000 --- a/src/lib/libc/gen/getobjformat.3 +++ /dev/null @@ -1,130 +0,0 @@ -.\" Copyright (c) 1998 John D. Polstra -.\" 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: src/lib/libc/gen/getobjformat.3,v 1.9 2002/12/18 10:13:54 ru Exp $ -.\" -.Dd September 7, 1998 -.Dt GETOBJFORMAT 3 -.Os -.Sh NAME -.Nm getobjformat -.Nd get preferred object file format -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In objformat.h -.Ft int -.Fn getobjformat "char *buf" "size_t bufsize" "int *argcp" "char **argv" -.Sh DESCRIPTION -The -.Fn getobjformat -function -queries several sources to determine the preferred object file -format, and copies its name into a buffer provided by the caller. -.Pp -The object file format is determined as follows. If -.Va argv -is -.No non- Ns Ev NULL -and an explicit command line argument such as -.Fl aout -or -.Fl elf -is present, then that determines the object file format. -.Pp -Otherwise, if the variable -.Ev OBJFORMAT -is set in the environment, the object file format is taken from its -value. -.Pp -Otherwise, if the file -.Pa /etc/objformat -is readable and contains a line of the form -.Ql OBJFORMAT=xxx , -the object file format is taken from there. -.Pp -Otherwise, a built-in system default object file format is returned. -.Pp -.Va buf -points to a user-supplied buffer into which the name of the object -file format is copied. -.Va bufsize -gives the size of the buffer in bytes. The string placed in -.Va buf -is always null-terminated. It is an error if the buffer is too -small to hold the null-terminated name. -.Pp -.Va argv -points to a -.Dv NULL Ns -terminated -argument vector to be scanned for object -format options. -.Va argv -may be -.Dv NULL , -in which case the argument vector is not scanned. -.Pp -If -.Va argcp -is non-NULL, any object format options are deleted from the -argument vector, and the updated argument count is stored into -the integer referenced by -.Va argcp . -If -.Va argcp -is -.Dv NULL , -the argument vector is left unchanged. -.Sh RETURN VALUES -On success, -.Fn getobjformat -returns the length of the object file format name, not counting the -null terminator. -If the supplied buffer is too small to hold the object file format -and its null terminator, -.Fn getobjformat -returns -1. In that case, the contents of the buffer and argument -vector supplied by the caller are indeterminate. -.Sh ENVIRONMENT -.Bl -tag -width OBJFORMAT -.It Ev OBJFORMAT -If the environment variable -.Ev OBJFORMAT -is set, it overrides the default object file format. -.Ev OBJFORMAT takes precedence over -.Pa /etc/objformat . -.El -.Sh FILES -.Bl -tag -width /etc/objformat -compact -.It Pa /etc/objformat -If present, specifies the object file format to use. Syntax is -.Ql OBJFORMAT=xxx . -.El -.Sh SEE ALSO -.Xr objformat 1 -.Sh HISTORY -The -.Fn getobjformat -function first appeared in -.Fx 3.0 . diff --git a/src/lib/libc/gen/getosreldate.3 b/src/lib/libc/gen/getosreldate.3 deleted file mode 100644 index d7b1321..0000000 --- a/src/lib/libc/gen/getosreldate.3 +++ /dev/null @@ -1,77 +0,0 @@ -.\" Copyright (c) 2002 The FreeBSD Project. -.\" 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: src/lib/libc/gen/getosreldate.3,v 1.2 2003/02/24 22:55:33 ru Exp $ -.\" -.Dd January 30, 2003 -.Dt GETOSRELDATE 3 -.Os -.Sh NAME -.Nm getosreldate -.Nd get the value of -.Dv __FreeBSD_version -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In osreldate.h -.Ft int -.Fn getosreldate void -.Sh DESCRIPTION -The -.Fn getosreldate -function returns an integer showing the version of the -currently running -.Fx -kernel. -Definitions of the values can be found in -.%B "The Porter's Handbook" -which is usually installed at -.Pa /usr/share/doc/en_US.ISO8859-1/books/porters-handbook/ . -.Sh RETURN VALUES -Upon successful completion, -.Fn getosreldate -returns the value requested; -otherwise the value \-1 is returned and the global variable -.Va errno -is set to indicate the error. -.Sh EXAMPLES -An example can be found in -.Pa /usr/share/examples/FreeBSD_version . -.Sh ERRORS -The -.Fn getosreldate -function may fail and set -.Va errno -for any of the errors specified for the library function -.Xr sysctl 3 . -.Sh SEE ALSO -.Rs -.%B "The Porter's Handbook" -.%O /usr/share/doc/en_US.ISO8859-1/books/porters\-handbook/ -.Re -.Sh HISTORY -The -.Fn getosreldate -function appeared in -.Fx 2.0 . diff --git a/src/lib/libc/gen/getpagesize.3 b/src/lib/libc/gen/getpagesize.3 deleted file mode 100644 index a8e57e1..0000000 --- a/src/lib/libc/gen/getpagesize.3 +++ /dev/null @@ -1,65 +0,0 @@ -.\" Copyright (c) 1983, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getpagesize.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getpagesize.3,v 1.11 2002/12/27 12:15:28 schweikh Exp $ -.\" -.Dd June 4, 1993 -.Dt GETPAGESIZE 3 -.Os -.Sh NAME -.Nm getpagesize -.Nd get system page size -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft int -.Fn getpagesize void -.Sh DESCRIPTION -The -.Fn getpagesize -function -returns the number of bytes in a page. -Page granularity is the granularity of many of the memory -management calls. -.Pp -The page size is a system -page size and may not be the same as the underlying -hardware page size. -.Sh SEE ALSO -.Xr pagesize 1 , -.Xr sbrk 2 -.Sh HISTORY -The -.Fn getpagesize -function appeared in -.Bx 4.2 . diff --git a/src/lib/libc/gen/getpass.3 b/src/lib/libc/gen/getpass.3 deleted file mode 100644 index f3317bd..0000000 --- a/src/lib/libc/gen/getpass.3 +++ /dev/null @@ -1,97 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getpass.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getpass.3,v 1.11 2001/11/22 09:48:54 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt GETPASS 3 -.Os -.Sh NAME -.Nm getpass -.Nd get a password -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In pwd.h -.In unistd.h -.Ft char * -.Fn getpass "const char *prompt" -.Sh DESCRIPTION -The -.Fn getpass -function displays a prompt to, and reads in a password from, -.Pa /dev/tty . -If this file is not accessible, -.Fn getpass -displays the prompt on the standard error output and reads from the standard -input. -.Pp -The password may be up to _PASSWORD_LEN (currently 128) -characters in length. -Any additional -characters and the terminating newline character are discarded. -.Pp -The -.Fn getpass -function turns off character echoing while reading the password. -.Sh RETURN VALUES -The -.Fn getpass -function returns a pointer to the null terminated password. -.Sh FILES -.Bl -tag -width /dev/tty -compact -.It Pa /dev/tty -.El -.Sh SEE ALSO -.Xr crypt 3 , -.Xr readpassphrase 3 -.Sh HISTORY -A -.Fn getpass -function appeared in -.At v7 . -.Sh BUGS -The -.Fn getpass -function leaves its result in an internal static object and returns -a pointer to that object. -Subsequent calls to -.Fn getpass -will modify the same object. -.Pp -The calling process should zero the password as soon as possible to -avoid leaving the cleartext password visible in the process's address -space. -.Pp -Upon receipt of a SIGTSTP, the input buffer will be flushed, so any -partially typed password must be retyped when the process -continues. diff --git a/src/lib/libc/gen/getpeereid.3 b/src/lib/libc/gen/getpeereid.3 deleted file mode 100644 index 6b5aed0..0000000 --- a/src/lib/libc/gen/getpeereid.3 +++ /dev/null @@ -1,137 +0,0 @@ -.\" -.\" Copyright (c) 2001 Dima Dorfman. -.\" 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: src/lib/libc/gen/getpeereid.3,v 1.6 2002/12/18 10:13:54 ru Exp $ -.\" -.Dd July 15, 2001 -.Dt GETPEEREID 3 -.Os -.Sh NAME -.Nm getpeereid -.Nd get the effective credentials of a UNIX-domain peer -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In unistd.h -.Ft int -.Fn getpeereid "int s" "uid_t *euid" "gid_t *egid" -.Sh DESCRIPTION -The -.Fn getpeereid -function returns the effective user and group IDs of the -peer connected to a -.Ux Ns -domain -socket. -The argument -.Fa s -must be a -.Ux Ns -domain -socket -.Pq Xr unix 4 -of type -.Dv SOCK_STREAM -on which either -.Xr connect 2 -or -.Xr listen 2 -have been called. -The effective used ID is placed in -.Fa euid , -and the effective group ID in -.Fa egid . -.Pp -The credentials returned to the -.Xr listen 2 -caller are those of its peer at the time it called -.Xr connect 2 ; -the credentials returned to the -.Xr connect 2 -caller are those of its peer at the time it called -.Xr listen 2 . -This mechanism is reliable; there is no way for either side to influence -the credentials returned to its peer except by calling the appropriate -system call (i.e., either -.Xr connect 2 -or -.Xr listen 2 ) -under different effective credentials. -.Pp -One common use of this routine is for a -.Ux Ns -domain -server -to verify the credentials of its client. -Likewise, the client can verify the credentials of the server. -.Sh IMPLEMENTATION NOTES -On -.Fx , -.Fn getpeereid -is implemented in terms of the -.Dv LOCAL_PEERCRED -.Xr unix 4 -socket option. -.Sh RETURN VALUES -.Rv -std getpeereid -.Sh ERRORS -The -.Fn getpeereid -function -fails if: -.Bl -tag -width Er -.It Bq Er EBADF -The argument -.Fa s -is not a valid descriptor. -.It Bq Er ENOTSOCK -The argument -.Fa s -is a file, not a socket. -.It Bq Er ENOTCONN -The argument -.Fa s -does not refer to a socket on which -.Xr connect 2 -or -.Xr listen 2 -have been called. -.It Bq Er EINVAL -The argument -.Fa s -does not refer to a socket of type -.Dv SOCK_STREAM , -or the kernel returned invalid data. -.El -.Sh SEE ALSO -.Xr connect 2 , -.Xr getpeername 2 , -.Xr getsockname 2 , -.Xr getsockopt 2 , -.Xr listen 2 , -.Xr unix 4 -.Sh HISTORY -The -.Fn getpeereid -function appeared in -.Fx 4.6 . diff --git a/src/lib/libc/gen/getprogname.3 b/src/lib/libc/gen/getprogname.3 deleted file mode 100644 index 5ea703e..0000000 --- a/src/lib/libc/gen/getprogname.3 +++ /dev/null @@ -1,94 +0,0 @@ -.\" -.\" Copyright (c) 2001 Christopher G. Demetriou -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed for the -.\" NetBSD Project. See http://www.netbsd.org/ for -.\" information about NetBSD. -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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: src/lib/libc/gen/getprogname.3,v 1.5 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd May 1, 2001 -.Dt GETPROGNAME 3 -.Os -.Sh NAME -.Nm getprogname , -.Nm setprogname -.Nd get or set the program name -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In stdlib.h -.Ft const char * -.Fn getprogname "void" -.Ft void -.Fn setprogname "const char *progname" -.Sh DESCRIPTION -The -.Fn getprogname -and -.Fn setprogname -functions manipulate the name of the current program. -They are used by error-reporting routines to produce -consistent output. -.Pp -The -.Fn getprogname -function returns the name of the program. -If the name has not been set yet, it will return -.Dv NULL . -.Pp -The -.Fn setprogname -function sets the name of the program to be the last component of the -.Fa progname -argument. -Since a pointer to the given string is kept as the program name, -it should not be modified for the rest of the program's lifetime. -.Pp -In -.Fx , -the name of the program is set by the start-up code that is run before -.Fn main ; -thus, -running -.Fn setprogname -is not necessary. -Programs that desire maximum portability should still call it; -on another operating system, -these functions may be implemented in a portability library. -Calling -.Fn setprogname -allows the aforementioned library to learn the program name without -modifications to the start-up code. -.Sh SEE ALSO -.Xr err 3 , -.Xr setproctitle 3 -.Sh HISTORY -These functions first appeared in -.Nx 1.6 , -and made their way into -.Fx 4.4 . diff --git a/src/lib/libc/gen/getpwent.3 b/src/lib/libc/gen/getpwent.3 deleted file mode 100644 index 77edcfc..0000000 --- a/src/lib/libc/gen/getpwent.3 +++ /dev/null @@ -1,319 +0,0 @@ -.\" Copyright (c) 1988, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" From: @(#)getpwent.3 8.2 (Berkeley) 12/11/93 -.\" $FreeBSD: src/lib/libc/gen/getpwent.3,v 1.26 2004/05/17 18:27:05 kientzle Exp $ -.\" -.Dd April 16, 2003 -.Dt GETPWENT 3 -.Os -.Sh NAME -.Nm getpwent , -.Nm getpwent_r , -.Nm getpwnam , -.Nm getpwnam_r , -.Nm getpwuid , -.Nm getpwuid_r , -.Nm setpassent , -.Nm setpwent , -.Nm endpwent -.Nd password database operations -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In pwd.h -.Ft struct passwd * -.Fn getpwent void -.Ft int -.Fn getpwent_r "struct passwd *pwd" "char *buffer" "size_t bufsize" "struct passwd **result" -.Ft struct passwd * -.Fn getpwnam "const char *login" -.Ft int -.Fn getpwnam_r "const char *name" "struct passwd *pwd" "char *buffer" "size_t bufsize" "struct passwd **result" -.Ft struct passwd * -.Fn getpwuid "uid_t uid" -.Ft int -.Fn getpwuid_r "uid_t uid" "struct passwd *pwd" "char *buffer" "size_t bufsize" "struct passwd **result" -.Ft int -.Fn setpassent "int stayopen" -.Ft void -.Fn setpwent void -.Ft void -.Fn endpwent void -.Sh DESCRIPTION -These functions -operate on the password database file -which is described -in -.Xr passwd 5 . -Each entry in the database is defined by the structure -.Vt passwd -found in the include -file -.In pwd.h : -.Bd -literal -offset indent -struct passwd { - char *pw_name; /* user name */ - char *pw_passwd; /* encrypted password */ - uid_t pw_uid; /* user uid */ - gid_t pw_gid; /* user gid */ - time_t pw_change; /* password change time */ - char *pw_class; /* user access class */ - char *pw_gecos; /* Honeywell login info */ - char *pw_dir; /* home directory */ - char *pw_shell; /* default shell */ - time_t pw_expire; /* account expiration */ - int pw_fields; /* internal: fields filled in */ -}; -.Ed -.Pp -The functions -.Fn getpwnam -and -.Fn getpwuid -search the password database for the given login name or user uid, -respectively, always returning the first one encountered. -.Pp -The -.Fn getpwent -function -sequentially reads the password database and is intended for programs -that wish to process the complete list of users. -.Pp -The functions -.Fn getpwent_r , -.Fn getpwnam_r , -and -.Fn getpwuid_r -are thread-safe versions of -.Fn getpwent , -.Fn getpwnam , -and -.Fn getpwuid , -respectively. -The caller must provide storage for the results of the search in -the -.Fa pwd , -.Fa buffer , -.Fa bufsize , -and -.Fa result -arguments. -When these functions are successful, the -.Fa pwd -argument will be filled-in, and a pointer to that argument will be -stored in -.Fa result . -If an entry is not found or an error occurs, -.Fa result -will be set to -.Dv NULL . -.Pp -The -.Fn setpassent -function -accomplishes two purposes. -First, it causes -.Fn getpwent -to ``rewind'' to the beginning of the database. -Additionally, if -.Fa stayopen -is non-zero, file descriptors are left open, significantly speeding -up subsequent accesses for all of the routines. -(This latter functionality is unnecessary for -.Fn getpwent -as it doesn't close its file descriptors by default.) -.Pp -It is dangerous for long-running programs to keep the file descriptors -open as the database will become out of date if it is updated while the -program is running. -.Pp -The -.Fn setpwent -function -is identical to -.Fn setpassent -with an argument of zero. -.Pp -The -.Fn endpwent -function -closes any open files. -.Pp -These routines have been written to ``shadow'' the password file, e.g.\& -allow only certain programs to have access to the encrypted password. -If the process which calls them has an effective uid of 0, the encrypted -password will be returned, otherwise, the password field of the returned -structure will point to the string -.Ql * . -.Sh RETURN VALUES -The functions -.Fn getpwent , -.Fn getpwnam , -and -.Fn getpwuid -return a valid pointer to a passwd structure on success -or -.Dv NULL -if the entry is not found or if an error occurs. -If an error does occur, -.Va errno -will be set. -Note that programs must explicitly set -.Va errno -to zero before calling any of these functions if they need to -distinguish between a non-existent entry and an error. -The functions -.Fn getpwent_r , -.Fn getpwnam_r , -and -.Fn getpwuid_r -return 0 if no error occurred, or an error number to indicate failure. -It is not an error if a matching entry is not found. -(Thus, if -.Fa result -is -.Dv NULL -and the return value is 0, no matching entry exists.) -.Pp -The -.Fn setpassent -function returns 0 on failure and 1 on success. -The -.Fn endpwent -and -.Fn setpwent -functions -have no return value. -.Sh ERRORS -These routines may fail for any of the errors specified in -.Xr open 2 , -.Xr dbopen 3 , -.Xr socket 2 , -and -.Xr connect 2 , -in addition to the following: -.Bl -tag -width Er -.It Bq Er ERANGE -The buffer specified by the -.Fa buffer -and -.Fa bufsize -arguments was insufficiently sized to store the result. -The caller should retry with a larger buffer. -.El -.Sh FILES -.Bl -tag -width /etc/master.passwd -compact -.It Pa /etc/pwd.db -The insecure password database file -.It Pa /etc/spwd.db -The secure password database file -.It Pa /etc/master.passwd -The current password file -.It Pa /etc/passwd -A Version 7 format password file -.El -.Sh SEE ALSO -.Xr getlogin 2 , -.Xr getgrent 3 , -.Xr nsswitch.conf 5 , -.Xr passwd 5 , -.Xr pwd_mkdb 8 , -.Xr vipw 8 , -.Xr yp 8 -.Sh HISTORY -The -.Fn getpwent , -.Fn getpwnam , -.Fn getpwuid , -.Fn setpwent , -and -.Fn endpwent -functions appeared in -.At v7 . -The -.Fn setpassent -function appeared in -.Bx 4.3 Reno . -The -.Fn getpwent_r , -.Fn getpwnam_r , -and -.Fn getpwuid_r -functions appeared in -.Fx 5.1 . -.Sh STANDARDS -The -.Fn getpwent , -.Fn getpwnam , -.Fn getpwnam_r , -.Fn getpwuid , -.Fn getpwuid_r , -.Fn setpwent , -and -.Fn endpwent -functions conform to -.St -p1003.1-96 . -.Sh COMPATIBILITY -The historic function -.Xr setpwfile 3 , -which allowed the specification of alternate password databases, -has been deprecated and is no longer available. -.Sh BUGS -The functions -.Fn getpwent , -.Fn getpwnam , -and -.Fn getpwuid , -leave their results in an internal static object and return -a pointer to that object. -Subsequent calls to -the same function -will modify the same object. -.Pp -The functions -.Fn getpwent , -.Fn getpwent_r , -.Fn endpwent , -.Fn setpassent , -and -.Fn setpwent -are fairly useless in a networked environment and should be -avoided, if possible. -The -.Fn getpwent -and -.Fn getpwent_r -functions -make no attempt to suppress duplicate information if multiple -sources are specified in -.Xr nsswitch.conf 5 . diff --git a/src/lib/libc/gen/getttyent.3 b/src/lib/libc/gen/getttyent.3 deleted file mode 100644 index 2bd3175..0000000 --- a/src/lib/libc/gen/getttyent.3 +++ /dev/null @@ -1,212 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getttyent.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/getttyent.3,v 1.13 2002/12/19 09:40:21 ru Exp $ -.\" -.Dd November 17, 1996 -.Dt GETTTYENT 3 -.Os -.Sh NAME -.Nm getttyent , -.Nm getttynam , -.Nm setttyent , -.Nm endttyent -.Nd get ttys file entry -.Nm isdialuptty , -.Nm isnettty -.Nd determine tty type from ttys file entry -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In ttyent.h -.Ft struct ttyent * -.Fn getttyent void -.Ft struct ttyent * -.Fn getttynam "const char *name" -.Ft int -.Fn setttyent void -.Ft int -.Fn endttyent void -.Ft int -.Fn isdialuptty "const char *name" -.Ft int -.Fn isnettty "const char *name" -.Sh DESCRIPTION -The -.Fn getttyent , -and -.Fn getttynam -functions -each return a pointer to an object, with the following structure, -containing the broken-out fields of a line from the tty description -file. -.Bd -literal -struct ttyent { - char *ty_name; /* terminal device name */ - char *ty_getty; /* command to execute, usually getty */ - char *ty_type; /* terminal type for termcap */ -#define TTY_ON 0x01 /* enable logins (start ty_getty program) */ -#define TTY_SECURE 0x02 /* allow uid of 0 to login */ -#define TTY_DIALUP 0x04 /* is a dialup tty */ -#define TTY_NETWORK 0x08 /* is a network tty */ - int ty_status; /* status flags */ - char *ty_window; /* command to start up window manager */ - char *ty_comment; /* comment field */ - char *ty_group; /* tty group name */ -}; -.Ed -.Pp -The fields are as follows: -.Bl -tag -width ty_comment -.It Fa ty_name -The name of the character-special file. -.It Fa ty_getty -The name of the command invoked by -.Xr init 8 -to initialize tty line characteristics. -.It Fa ty_type -The name of the default terminal type connected to this tty line. -.It Fa ty_status -A mask of bit fields which indicate various actions allowed on this -tty line. -The possible flags are as follows: -.Bl -tag -width TTY_NETWORK -.It Dv TTY_ON -Enables logins (i.e., -.Xr init 8 -will start the command referenced by -.Fa ty_getty -on this entry). -.It Dv TTY_SECURE -Allow users with a uid of 0 to login on this terminal. -.It Dv TTY_DIALUP -Identifies a tty as a dialin line. -If this flag is set, then -.Fn isdialuptty -will return a non-zero value. -.It Dv TTY_NETWORK -Identifies a tty used for network connections. -If this flag is set, then -.Fn isnettty -will return a non-zero value. -.El -.It Fa ty_window -The command to execute for a window system associated with the line. -.It Fa ty_group -A group name to which the tty belongs. -If no group is specified in the ttys description file, -then the tty is placed in an anonymous group called "none". -.It Fa ty_comment -Any trailing comment field, with any leading hash marks (``#'') or -whitespace removed. -.El -.Pp -If any of the fields pointing to character strings are unspecified, -they are returned as null pointers. -The field -.Fa ty_status -will be zero if no flag values are specified. -.Pp -See -.Xr ttys 5 -for a more complete discussion of the meaning and usage of the -fields. -.Pp -The -.Fn getttyent -function -reads the next line from the ttys file, opening the file if necessary. -The -.Fn setttyent -function -rewinds the file if open, or opens the file if it is unopened. -The -.Fn endttyent -function -closes any open files. -.Pp -The -.Fn getttynam -function -searches from the beginning of the file until a matching -.Fa name -is found -(or until -.Dv EOF -is encountered). -.Sh RETURN VALUES -The routines -.Fn getttyent -and -.Fn getttynam -return a null pointer on -.Dv EOF -or error. -The -.Fn setttyent -function -and -.Fn endttyent -return 0 on failure and 1 on success. -.Pp -The routines -.Fn isdialuptty -and -.Fn isnettty -return non-zero if the dialup or network flag is set for the -tty entry relating to the tty named by the argument, and -zero otherwise. -.Sh FILES -.Bl -tag -width /etc/ttys -compact -.It Pa /etc/ttys -.El -.Sh SEE ALSO -.Xr login 1 , -.Xr ttyslot 3 , -.Xr gettytab 5 , -.Xr termcap 5 , -.Xr ttys 5 , -.Xr getty 8 , -.Xr init 8 -.Sh HISTORY -The -.Fn getttyent , -.Fn getttynam , -.Fn setttyent , -and -.Fn endttyent -functions appeared in -.Bx 4.3 . -.Sh BUGS -These functions use static data storage; -if the data is needed for future use, it should be -copied before any subsequent calls overwrite it. diff --git a/src/lib/libc/gen/getusershell.3 b/src/lib/libc/gen/getusershell.3 deleted file mode 100644 index 4d8805e..0000000 --- a/src/lib/libc/gen/getusershell.3 +++ /dev/null @@ -1,103 +0,0 @@ -.\" $NetBSD: getusershell.3,v 1.6 1999/03/22 19:44:42 garbled Exp $ -.\" $FreeBSD: src/lib/libc/gen/getusershell.3,v 1.10 2001/10/01 16:08:51 ru Exp $ -.\" -.\" Copyright (c) 1985, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)getusershell.3 8.1 (Berkeley) 6/4/93 -.\" -.Dd January 16, 1999 -.Dt GETUSERSHELL 3 -.Os -.Sh NAME -.Nm getusershell , -.Nm setusershell , -.Nm endusershell -.Nd get valid user shells -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft char * -.Fn getusershell void -.Ft void -.Fn setusershell void -.Ft void -.Fn endusershell void -.Sh DESCRIPTION -The -.Fn getusershell -function -returns a pointer to a valid user shell as defined by the -system manager in the shells database as described in -.Xr shells 5 . -If the shells database is not available, -.Fn getusershell -behaves as if -.Pa /bin/sh -and -.Pa /bin/csh -were listed. -.Pp -The -.Fn getusershell -function -reads the next -line (opening the file if necessary); -.Fn setusershell -rewinds the file; -.Fn endusershell -closes it. -.Sh FILES -.Bl -tag -width /etc/shells -compact -.It Pa /etc/shells -.El -.Sh DIAGNOSTICS -The routine -.Fn getusershell -returns a null pointer (0) on -.Dv EOF . -.Sh SEE ALSO -.Xr nsswitch.conf 5 , -.Xr shells 5 -.Sh HISTORY -The -.Fn getusershell -function appeared in -.Bx 4.3 . -.Sh BUGS -The -.Fn getusershell -function leaves its result in an internal static object and returns -a pointer to that object. -Subsequent calls to -.Fn getusershell -will modify the same object. diff --git a/src/lib/libc/gen/getvfsbyname.3 b/src/lib/libc/gen/getvfsbyname.3 deleted file mode 100644 index 0df69ea..0000000 --- a/src/lib/libc/gen/getvfsbyname.3 +++ /dev/null @@ -1,114 +0,0 @@ -.\" Copyright (c) 1995 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)kvm_getvfsbyname.3 8.3 (Berkeley) 5/4/95 -.\" $FreeBSD: src/lib/libc/gen/getvfsbyname.3,v 1.15 2002/12/19 09:40:21 ru Exp $ -.\" -.Dd May 4, 1995 -.Dt GETVFSBYNAME 3 -.Os -.Sh NAME -.Nm getvfsbyname -.Nd get information about a file system -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/param.h -.In sys/mount.h -.Ft int -.Fn getvfsbyname "const char *name" "struct xvfsconf *vfc" -.Sh DESCRIPTION -The -.Fn getvfsbyname -function provides access to information about a -file system module that is configured in the kernel. -If successful, -the requested file system -.Fa xvfsconf -is returned in the location pointed to by -.Fa vfc . -The fields in a -.Dq Li struct xvfsconf -are defined as follows: -.Pp -.Bl -tag -compact -width vfc_refcount -.It vfc_name -the name of the file system -.It vfc_typenum -the file system type number assigned by the kernel -.It vfc_refcount -the number of active mount points using the file system -.It vfc_flags -flag bits, as described below -.El -.Pp -The flags are defined as follows: -.Pp -.Bl -tag -width VFCF_SYNTHETIC -compact -.It Dv VFCF_STATIC -statically compiled into kernel -.It Dv VFCF_NETWORK -may get data over the network -.It Dv VFCF_READONLY -writes are not implemented -.It Dv VFCF_SYNTHETIC -data does not represent real files -.It Dv VFCF_LOOPBACK -aliases some other mounted FS -.It Dv VFCF_UNICODE -stores file names as Unicode -.El -.Sh RETURN VALUES -.Rv -std getvfsbyname -.Sh ERRORS -The following errors may be reported: -.Bl -tag -width Er -.It Bq Er EFAULT -The -.Fa vfc -argument -points to an invalid address. -.It Bq Er ENOENT -The -.Fa name -argument -specifies a file system that is unknown or not configured in the kernel. -.El -.Sh SEE ALSO -.Xr mount 2 , -.Xr sysctl 3 , -.Xr mount 8 , -.Xr sysctl 8 -.Sh HISTORY -A variant of the -.Fn getvfsbyname -function first appeared in -.Fx 2.0 . diff --git a/src/lib/libc/gen/glob.3 b/src/lib/libc/gen/glob.3 deleted file mode 100644 index ee4bc44..0000000 --- a/src/lib/libc/gen/glob.3 +++ /dev/null @@ -1,469 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993, 1994 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Guido van Rossum. -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)glob.3 8.3 (Berkeley) 4/16/94 -.\" $FreeBSD: src/lib/libc/gen/glob.3,v 1.25 2003/09/10 19:24:32 ru Exp $ -.\" -.Dd April 16, 1994 -.Dt GLOB 3 -.Os -.Sh NAME -.Nm glob , -.Nm globfree -.Nd generate pathnames matching a pattern -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In glob.h -.Ft int -.Fn glob "const char *pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t *pglob" -.Ft void -.Fn globfree "glob_t *pglob" -.Sh DESCRIPTION -The -.Fn glob -function -is a pathname generator that implements the rules for file name pattern -matching used by the shell. -.Pp -The include file -.In glob.h -defines the structure type -.Fa glob_t , -which contains at least the following fields: -.Bd -literal -typedef struct { - int gl_pathc; /* count of total paths so far */ - int gl_matchc; /* count of paths matching pattern */ - int gl_offs; /* reserved at beginning of gl_pathv */ - int gl_flags; /* returned flags */ - char **gl_pathv; /* list of paths matching pattern */ -} glob_t; -.Ed -.Pp -The argument -.Fa pattern -is a pointer to a pathname pattern to be expanded. -The -.Fn glob -argument -matches all accessible pathnames against the pattern and creates -a list of the pathnames that match. -In order to have access to a pathname, -.Fn glob -requires search permission on every component of a path except the last -and read permission on each directory of any filename component of -.Fa pattern -that contains any of the special characters -.Ql * , -.Ql ?\& -or -.Ql \&[ . -.Pp -The -.Fn glob -argument -stores the number of matched pathnames into the -.Fa gl_pathc -field, and a pointer to a list of pointers to pathnames into the -.Fa gl_pathv -field. -The first pointer after the last pathname is -.Dv NULL . -If the pattern does not match any pathnames, the returned number of -matched paths is set to zero. -.Pp -It is the caller's responsibility to create the structure pointed to by -.Fa pglob . -The -.Fn glob -function allocates other space as needed, including the memory pointed -to by -.Fa gl_pathv . -.Pp -The argument -.Fa flags -is used to modify the behavior of -.Fn glob . -The value of -.Fa flags -is the bitwise inclusive -.Tn OR -of any of the following -values defined in -.In glob.h : -.Bl -tag -width GLOB_ALTDIRFUNC -.It Dv GLOB_APPEND -Append pathnames generated to the ones from a previous call (or calls) -to -.Fn glob . -The value of -.Fa gl_pathc -will be the total matches found by this call and the previous call(s). -The pathnames are appended to, not merged with the pathnames returned by -the previous call(s). -Between calls, the caller must not change the setting of the -.Dv GLOB_DOOFFS -flag, nor change the value of -.Fa gl_offs -when -.Dv GLOB_DOOFFS -is set, nor (obviously) call -.Fn globfree -for -.Fa pglob . -.It Dv GLOB_DOOFFS -Make use of the -.Fa gl_offs -field. -If this flag is set, -.Fa gl_offs -is used to specify how many -.Dv NULL -pointers to prepend to the beginning -of the -.Fa gl_pathv -field. -In other words, -.Fa gl_pathv -will point to -.Fa gl_offs -.Dv NULL -pointers, -followed by -.Fa gl_pathc -pathname pointers, followed by a -.Dv NULL -pointer. -.It Dv GLOB_ERR -Causes -.Fn glob -to return when it encounters a directory that it cannot open or read. -Ordinarily, -.Fn glob -continues to find matches. -.It Dv GLOB_MARK -Each pathname that is a directory that matches -.Fa pattern -has a slash -appended. -.It Dv GLOB_NOCHECK -If -.Fa pattern -does not match any pathname, then -.Fn glob -returns a list -consisting of only -.Fa pattern , -with the number of total pathnames set to 1, and the number of matched -pathnames set to 0. -The effect of backslash escaping is present in the pattern returned. -.It Dv GLOB_NOESCAPE -By default, a backslash -.Pq Ql \e -character is used to escape the following character in the pattern, -avoiding any special interpretation of the character. -If -.Dv GLOB_NOESCAPE -is set, backslash escaping is disabled. -.It Dv GLOB_NOSORT -By default, the pathnames are sorted in ascending -.Tn ASCII -order; -this flag prevents that sorting (speeding up -.Fn glob ) . -.El -.Pp -The following values may also be included in -.Fa flags , -however, they are non-standard extensions to -.St -p1003.2 . -.Bl -tag -width GLOB_ALTDIRFUNC -.It Dv GLOB_ALTDIRFUNC -The following additional fields in the pglob structure have been -initialized with alternate functions for glob to use to open, read, -and close directories and to get stat information on names found -in those directories. -.Bd -literal -void *(*gl_opendir)(const char * name); -struct dirent *(*gl_readdir)(void *); -void (*gl_closedir)(void *); -int (*gl_lstat)(const char *name, struct stat *st); -int (*gl_stat)(const char *name, struct stat *st); -.Ed -.Pp -This extension is provided to allow programs such as -.Xr restore 8 -to provide globbing from directories stored on tape. -.It Dv GLOB_BRACE -Pre-process the pattern string to expand -.Ql {pat,pat,...} -strings like -.Xr csh 1 . -The pattern -.Ql {} -is left unexpanded for historical reasons (and -.Xr csh 1 -does the same thing to -ease typing -of -.Xr find 1 -patterns). -.It Dv GLOB_MAGCHAR -Set by the -.Fn glob -function if the pattern included globbing characters. -See the description of the usage of the -.Fa gl_matchc -structure member for more details. -.It Dv GLOB_NOMAGIC -Is the same as -.Dv GLOB_NOCHECK -but it only appends the -.Fa pattern -if it does not contain any of the special characters ``*'', ``?'' or ``[''. -.Dv GLOB_NOMAGIC -is provided to simplify implementing the historic -.Xr csh 1 -globbing behavior and should probably not be used anywhere else. -.It Dv GLOB_TILDE -Expand patterns that start with -.Ql ~ -to user name home directories. -.It Dv GLOB_LIMIT -Limit the total number of returned pathnames to the value provided in -.Fa gl_matchc -(default -.Dv ARG_MAX ) . -This option should be set for programs -that can be coerced into a denial of service attack -via patterns that expand to a very large number of matches, -such as a long string of -.Ql */../*/.. . -.El -.Pp -If, during the search, a directory is encountered that cannot be opened -or read and -.Fa errfunc -is -.Pf non- Dv NULL , -.Fn glob -calls -.Fa \*(lp*errfunc\*(rp Ns ( Fa path , errno ) . -This may be unintuitive: a pattern like -.Ql */Makefile -will try to -.Xr stat 2 -.Ql foo/Makefile -even if -.Ql foo -is not a directory, resulting in a -call to -.Fa errfunc . -The error routine can suppress this action by testing for -.Er ENOENT -and -.Er ENOTDIR ; -however, the -.Dv GLOB_ERR -flag will still cause an immediate -return when this happens. -.Pp -If -.Fa errfunc -returns non-zero, -.Fn glob -stops the scan and returns -.Dv GLOB_ABORTED -after setting -.Fa gl_pathc -and -.Fa gl_pathv -to reflect any paths already matched. -This also happens if an error is encountered and -.Dv GLOB_ERR -is set in -.Fa flags , -regardless of the return value of -.Fa errfunc , -if called. -If -.Dv GLOB_ERR -is not set and either -.Fa errfunc -is -.Dv NULL -or -.Fa errfunc -returns zero, the error is ignored. -.Pp -The -.Fn globfree -function frees any space associated with -.Fa pglob -from a previous call(s) to -.Fn glob . -.Sh RETURN VALUES -On successful completion, -.Fn glob -returns zero. -In addition the fields of -.Fa pglob -contain the values described below: -.Bl -tag -width GLOB_NOCHECK -.It Fa gl_pathc -contains the total number of matched pathnames so far. -This includes other matches from previous invocations of -.Fn glob -if -.Dv GLOB_APPEND -was specified. -.It Fa gl_matchc -contains the number of matched pathnames in the current invocation of -.Fn glob . -.It Fa gl_flags -contains a copy of the -.Fa flags -argument with the bit -.Dv GLOB_MAGCHAR -set if -.Fa pattern -contained any of the special characters ``*'', ``?'' or ``['', cleared -if not. -.It Fa gl_pathv -contains a pointer to a -.Dv NULL Ns -terminated -list of matched pathnames. -However, if -.Fa gl_pathc -is zero, the contents of -.Fa gl_pathv -are undefined. -.El -.Pp -If -.Fn glob -terminates due to an error, it sets errno and returns one of the -following non-zero constants, which are defined in the include -file -.In glob.h : -.Bl -tag -width GLOB_NOCHECK -.It Dv GLOB_NOSPACE -An attempt to allocate memory failed, or if -.Fa errno -was 0 -.Dv GLOB_LIMIT -was specified in the flags and -.Fa pglob\->gl_matchc -or more patterns were matched. -.It Dv GLOB_ABORTED -The scan was stopped because an error was encountered and either -.Dv GLOB_ERR -was set or -.Fa \*(lp*errfunc\*(rp\*(lp\*(rp -returned non-zero. -.It Dv GLOB_NOMATCH -The pattern did not match a pathname and -.Dv GLOB_NOCHECK -was not set. -.El -.Pp -The arguments -.Fa pglob\->gl_pathc -and -.Fa pglob\->gl_pathv -are still set as specified above. -.Sh EXAMPLES -A rough equivalent of -.Ql "ls -l *.c *.h" -can be obtained with the -following code: -.Bd -literal -offset indent -glob_t g; - -g.gl_offs = 2; -glob("*.c", GLOB_DOOFFS, NULL, &g); -glob("*.h", GLOB_DOOFFS | GLOB_APPEND, NULL, &g); -g.gl_pathv[0] = "ls"; -g.gl_pathv[1] = "-l"; -execvp("ls", g.gl_pathv); -.Ed -.Sh SEE ALSO -.Xr sh 1 , -.Xr fnmatch 3 , -.Xr regexp 3 -.Sh STANDARDS -The -.Fn glob -function is expected to be -.St -p1003.2 -compatible with the exception -that the flags -.Dv GLOB_ALTDIRFUNC , -.Dv GLOB_BRACE , -.Dv GLOB_LIMIT , -.Dv GLOB_MAGCHAR , -.Dv GLOB_NOMAGIC , -and -.Dv GLOB_TILDE , -and the fields -.Fa gl_matchc -and -.Fa gl_flags -should not be used by applications striving for strict -.Tn POSIX -conformance. -.Sh HISTORY -The -.Fn glob -and -.Fn globfree -functions first appeared in -.Bx 4.4 . -.Sh BUGS -Patterns longer than -.Dv MAXPATHLEN -may cause unchecked errors. -.Pp -The -.Fn glob -argument -may fail and set errno for any of the errors specified for the -library routines -.Xr stat 2 , -.Xr closedir 3 , -.Xr opendir 3 , -.Xr readdir 3 , -.Xr malloc 3 , -and -.Xr free 3 . diff --git a/src/lib/libc/gen/initgroups.3 b/src/lib/libc/gen/initgroups.3 deleted file mode 100644 index beba09e..0000000 --- a/src/lib/libc/gen/initgroups.3 +++ /dev/null @@ -1,90 +0,0 @@ -.\" Copyright (c) 1983, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)initgroups.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/initgroups.3,v 1.12 2002/01/22 17:32:53 markm Exp $ -.\" -.Dd June 4, 1993 -.Dt INITGROUPS 3 -.Os -.Sh NAME -.Nm initgroups -.Nd initialize group access list -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft int -.Fn initgroups "const char *name" "gid_t basegid" -.Sh DESCRIPTION -The -.Fn initgroups -function -uses the -.Xr getgrouplist 3 -function to calculate the group access list for the user -specified in -.Fa name . -This group list is then setup for the current process using -.Xr setgroups 2 . -The -.Fa basegid -is automatically included in the groups list. -Typically this value is given as -the group number from the password file. -.Sh RETURN VALUES -.Rv -std initgroups -.Sh ERRORS -The -.Fn initgroups -function may fail and set -.Va errno -for any of the errors specified for the library function -.Xr setgroups 2 . -.Sh SEE ALSO -.Xr setgroups 2 , -.Xr getgrouplist 3 -.Sh HISTORY -The -.Fn initgroups -function appeared in -.Bx 4.2 . -.Sh BUGS -The -.Fn getgrouplist -function called by -.Fn initgroups -uses the routines based on -.Xr getgrent 3 . -If the invoking program uses any of these routines, -the group structure will -be overwritten in the call to -.Fn initgroups . diff --git a/src/lib/libc/gen/isgreater.3 b/src/lib/libc/gen/isgreater.3 deleted file mode 100644 index 93972dc..0000000 --- a/src/lib/libc/gen/isgreater.3 +++ /dev/null @@ -1,102 +0,0 @@ -.\" Copyright (c) 2003 David Schultz -.\" 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: src/lib/libc/gen/isgreater.3,v 1.2 2003/06/01 19:19:59 ru Exp $ -.\" -.Dd February 12, 2003 -.Dt ISGREATER 3 -.Os -.Sh NAME -.Nm isgreater , isgreaterequal , isless , islessequal , -.Nm islessgreater , isunordered -.Nd "compare two floating-point numbers" -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In math.h -.Ft int -.Fn isgreater "real-floating x" "real-floating y" -.Ft int -.Fn isgreaterequal "real-floating x" "real-floating y" -.Ft int -.Fn isless "real-floating x" "real-floating y" -.Ft int -.Fn islessequal "real-floating x" "real-floating y" -.Ft int -.Fn islessgreater "real-floating x" "real-floating y" -.Ft int -.Fn isunordered "real-floating x" "real-floating y" -.Sh DESCRIPTION -Each of the macros -.Fn isgreater , -.Fn isgreaterequal , -.Fn isless , -.Fn islessequal , -and -.Fn islessgreater -take arguments -.Fa x -and -.Fa y -and return a non-zero value if and only if its nominal -relation on -.Fa x -and -.Fa y -is true. -These macros always return zero if either -argument is not a number (NaN), but unlike the corresponding C -operators, they never raise a floating point exception. -.Pp -The -.Fn isunordered -macro takes arguments -.Fa x -and -.Fa y -and returns non-zero if and only if neither -.Fa x -nor -.Fa y -are NaNs. -For any pair of floating-point values, one -of the relationships (less, greater, equal, unordered) holds. -.Sh SEE ALSO -.Xr fpclassify 3 , -.Xr math 3 , -.Xr signbit 3 -.Sh STANDARDS -The -.Fn isgreater , -.Fn isgreaterequal , -.Fn isless , -.Fn islessequal , -.Fn islessgreater , -and -.Fn isunordered -macros conform to -.St -isoC-99 . -.Sh HISTORY -The relational macros described above first appeared in -.Fx 5.1 . diff --git a/src/lib/libc/gen/ldexp.3 b/src/lib/libc/gen/ldexp.3 deleted file mode 100644 index 88c0d2f..0000000 --- a/src/lib/libc/gen/ldexp.3 +++ /dev/null @@ -1,80 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" the American National Standards Committee X3, on Information -.\" Processing Systems. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)ldexp.3 8.2 (Berkeley) 4/19/94 -.\" $FreeBSD: src/lib/libc/gen/ldexp.3,v 1.8 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd April 19, 1994 -.Dt LDEXP 3 -.Os -.Sh NAME -.Nm ldexp -.Nd multiply floating-point number by integral power of 2 -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In math.h -.Ft double -.Fn ldexp "double x" "int exp" -.Sh DESCRIPTION -The -.Fn ldexp -function multiplies a floating-point number by an integral -power of 2. -.Sh RETURN VALUES -The -.Fn ldexp -function returns the value of -.Fa x -times 2 raised to the power -.Fa exp . -.Pp -If the resultant value would cause an overflow, -the global variable -.Va errno -is set to -.Er ERANGE -and the value -.Dv HUGE -is returned. -.Sh SEE ALSO -.Xr frexp 3 , -.Xr math 3 , -.Xr modf 3 -.Sh STANDARDS -The -.Fn ldexp -function conforms to -.St -isoC . diff --git a/src/lib/libc/gen/lockf.3 b/src/lib/libc/gen/lockf.3 deleted file mode 100644 index f0b7dc8..0000000 --- a/src/lib/libc/gen/lockf.3 +++ /dev/null @@ -1,269 +0,0 @@ -.\" $NetBSD: lockf.3,v 1.2 1998/02/05 18:47:28 perry Exp $ -.\" -.\" Copyright (c) 1997 The NetBSD Foundation, Inc. -.\" All rights reserved. -.\" -.\" This code is derived from software contributed to The NetBSD Foundation -.\" by Klaus Klein and S.P. Zeidler. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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: src/lib/libc/gen/lockf.3,v 1.12 2004/05/17 23:09:10 yar Exp $ -.\" -.Dd December 19, 1997 -.Dt LOCKF 3 -.Os -.Sh NAME -.Nm lockf -.Nd record locking on files -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft int -.Fn lockf "int filedes" "int function" "off_t size" -.Sh DESCRIPTION -The -.Fn lockf -function allows sections of a file to be locked with advisory-mode locks. -Calls to -.Fn lockf -from other processes which attempt to lock the locked file section will -either return an error value or block until the section becomes unlocked. -All the locks for a process are removed when the process terminates. -.Pp -The argument -.Fa filedes -is an open file descriptor. -The file descriptor must have been opened either for write-only -.Dv ( O_WRONLY ) -or read/write -.Dv ( O_RDWR ) -operation. -.Pp -The -.Fa function -argument is a control value which specifies the action to be taken. -The permissible values for -.Fa function -are as follows: -.Bl -tag -width F_ULOCKXX -compact -offset indent -.It Sy Function -.Sy Description -.It Dv F_ULOCK -unlock locked sections -.It Dv F_LOCK -lock a section for exclusive use -.It Dv F_TLOCK -test and lock a section for exclusive use -.It Dv F_TEST -test a section for locks by other processes -.El -.Pp -.Dv F_ULOCK -removes locks from a section of the file; -.Dv F_LOCK -and -.Dv F_TLOCK -both lock a section of a file if the section is available; -.Dv F_TEST -detects if a lock by another process is present on the specified section. -.Pp -The -.Fa size -argument is the number of contiguous bytes to be locked or -unlocked. -The section to be locked or unlocked starts at the current -offset in the file and extends forward for a positive size or backward -for a negative size (the preceding bytes up to but not including the -current offset). However, it is not permitted to lock a section that -starts or extends before the beginning of the file. -If -.Fa size -is 0, the section from the current offset through the largest possible -file offset is locked (that is, from the current offset through the -present or any future end-of-file). -.Pp -The sections locked with -.Dv F_LOCK -or -.Dv F_TLOCK -may, in whole or in part, contain or be contained by a previously -locked section for the same process. -When this occurs, or if adjacent -locked sections would occur, the sections are combined into a single -locked section. -If the request would cause the number of locks to -exceed a system-imposed limit, the request will fail. -.Pp -.Dv F_LOCK -and -.Dv F_TLOCK -requests differ only by the action taken if the section is not -available. -.Dv F_LOCK -blocks the calling process until the section is available. -.Dv F_TLOCK -makes the function fail if the section is already locked by another -process. -.Pp -File locks are released on first close by the locking process of any -file descriptor for the file. -.Pp -.Dv F_ULOCK -requests release (wholly or in part) one or more locked sections -controlled by the process. -Locked sections will be unlocked starting -at the current file offset through -.Fa size -bytes or to the end of file if size is 0. When all of a locked section -is not released (that is, when the beginning or end of the area to be -unlocked falls within a locked section), the remaining portions of -that section are still locked by the process. -Releasing the center -portion of a locked section will cause the remaining locked beginning -and end portions to become two separate locked sections. -If the -request would cause the number of locks in the system to exceed a -system-imposed limit, the request will fail. -.Pp -An -.Dv F_ULOCK -request in which size is non-zero and the offset of the last byte of -the requested section is the maximum value for an object of type -off_t, when the process has an existing lock in which size is 0 and -which includes the last byte of the requested section, will be treated -as a request to unlock from the start of the requested section with a -size equal to 0. Otherwise an -.Dv F_ULOCK -request will attempt to unlock only the requested section. -.Pp -A potential for deadlock occurs if a process controlling a locked -region is put to sleep by attempting to lock the locked region of -another process. This implementation detects that sleeping until a -locked region is unlocked would cause a deadlock and fails with an -.Er EDEADLK -error. -.Pp -The -.Fn lockf , -.Xr fcntl 2 , -and -.Xr flock 2 -locks are compatible. -Processes using different locking interfaces can cooperate -over the same file safely. -However, only one of such interfaces should be used within -the same process. -If a file is locked by a process through -.Xr flock 2 , -any record within the file will be seen as locked -from the viewpoint of another process using -.Xr fcntl 2 -or -.Fn lockf , -and vice versa. -.Pp -Blocking on a section is interrupted by any signal. -.Sh RETURN VALUES -.Rv -std lockf -In the case of a failure, existing locks are not changed. -.Sh ERRORS -The -.Fn lockf -function -will fail if: -.Bl -tag -width Er -.It Bq Er EAGAIN -The argument -.Fa function -is -.Dv F_TLOCK -or -.Dv F_TEST -and the section is already locked by another process. -.It Bq Er EBADF -The argument -.Fa filedes -is not a valid open file descriptor. -.Pp -The argument -.Fa function -is -.Dv F_LOCK -or -.Dv F_TLOCK , -and -.Fa filedes -is not a valid file descriptor open for writing. -.It Bq Er EDEADLK -The argument -.Fa function -is -.Dv F_LOCK -and a deadlock is detected. -.It Bq Er EINTR -The argument -.Fa function -is F_LOCK -and -.Fn lockf -was interrupted by the delivery of a signal. -.It Bq Er EINVAL -The argument -.Fa function -is not one of -.Dv F_ULOCK , -.Dv F_LOCK , -.Dv F_TLOCK -or -.Dv F_TEST . -.Pp -The argument -.Fa filedes -refers to a file that does not support locking. -.It Bq Er ENOLCK -The argument -.Fa function -is -.Dv F_ULOCK , -.Dv F_LOCK -or -.Dv F_TLOCK , -and satisfying the lock or unlock request would result in the number -of locked regions in the system exceeding a system-imposed limit. -.El -.Sh SEE ALSO -.Xr fcntl 2 , -.Xr flock 2 -.Sh STANDARDS -The -.Fn lockf -function conforms to -.St -xpg4.2 . diff --git a/src/lib/libc/gen/makecontext.3 b/src/lib/libc/gen/makecontext.3 deleted file mode 100644 index 36e3ce8..0000000 --- a/src/lib/libc/gen/makecontext.3 +++ /dev/null @@ -1,120 +0,0 @@ -.\" Copyright (c) 2002 Packet Design, LLC. -.\" All rights reserved. -.\" -.\" Subject to the following obligations and disclaimer of warranty, -.\" use and redistribution of this software, in source or object code -.\" forms, with or without modifications are expressly permitted by -.\" Packet Design; provided, however, that: -.\" -.\" (i) Any and all reproductions of the source or object code -.\" must include the copyright notice above and the following -.\" disclaimer of warranties; and -.\" (ii) No rights are granted, in any manner or form, to use -.\" Packet Design trademarks, including the mark "PACKET DESIGN" -.\" on advertising, endorsements, or otherwise except as such -.\" appears in the above copyright notice or in the software. -.\" -.\" THIS SOFTWARE IS BEING PROVIDED BY PACKET DESIGN "AS IS", AND -.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, PACKET DESIGN MAKES NO -.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING -.\" THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED -.\" WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, -.\" OR NON-INFRINGEMENT. PACKET DESIGN DOES NOT WARRANT, GUARANTEE, -.\" OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS -.\" OF THE USE OF THIS SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, -.\" RELIABILITY OR OTHERWISE. IN NO EVENT SHALL PACKET DESIGN BE -.\" LIABLE FOR ANY DAMAGES RESULTING FROM OR ARISING OUT OF ANY USE -.\" OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY DIRECT, -.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE, OR CONSEQUENTIAL -.\" DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF -.\" USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER 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 PACKET DESIGN IS ADVISED OF -.\" THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD: src/lib/libc/gen/makecontext.3,v 1.4 2002/12/19 09:40:21 ru Exp $ -.\" -.Dd September 10, 2002 -.Dt MAKECONTEXT 3 -.Os -.Sh NAME -.Nm makecontext , swapcontext -.Nd modify and exchange user thread contexts -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In ucontext.h -.Ft void -.Fo makecontext -.Fa "ucontext_t *ucp" -.Fa "void \*[lp]*func\*[rp]\*[lp]void\*[rp]" -.Fa "int argc" ... -.Fc -.Ft int -.Fn swapcontext "ucontext_t *oucp" "const ucontext_t *ucp" -.Sh DESCRIPTION -The -.Fn makecontext -function -modifies the user thread context pointed to by -.Fa ucp , -which must have previously been initialized by a call to -.Xr getcontext 3 -and had a stack allocated for it. -The context is modified so that it will continue execution by invoking -.Fn func -with the arguments provided. -The -.Fa argc -argument -must be equal to the number of additional arguments provided to -.Fn makecontext -and also equal to the number of arguments to -.Fn func , -or else the behavior is undefined. -.Pp -The -.Fa "ucp->uc_link" -argument -must be initialized before calling -.Fn makecontext -and determines the action to take when -.Fn func -returns: -if equal to -.Dv NULL , -the process exits; -otherwise, -.Fn setcontext "ucp->uc_link" -is implicitly invoked. -.Pp -The -.Fn swapcontext -function -saves the current thread context in -.Fa "*oucp" -and makes -.Fa "*ucp" -the currently active context. -.Sh RETURN VALUES -If successful, -.Fn swapcontext -returns zero; -otherwise \-1 is returned and the global variable -.Va errno -is set appropriately. -.Sh ERRORS -The -.Fn swapcontext -function -will fail if: -.Bl -tag -width Er -.It Bq Er ENOMEM -There is not enough stack space in -.Fa ucp -to complete the operation. -.El -.Sh SEE ALSO -.Xr setcontext 3 , -.Xr ucontext 3 diff --git a/src/lib/libc/gen/modf.3 b/src/lib/libc/gen/modf.3 deleted file mode 100644 index 891ae61..0000000 --- a/src/lib/libc/gen/modf.3 +++ /dev/null @@ -1,75 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" the American National Standards Committee X3, on Information -.\" Processing Systems. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)modf.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/modf.3,v 1.8 2002/12/18 13:33:02 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt MODF 3 -.Os -.Sh NAME -.Nm modf -.Nd extract signed integral and fractional values from floating-point number -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In math.h -.Ft double -.Fn modf "double value" "double *iptr" -.Sh DESCRIPTION -The -.Fn modf -function breaks the argument -.Fa value -into integral and fractional parts, each of which has the -same sign as the argument. -It stores the integral part as a -.Vt double -in the object pointed to by -.Fa iptr . -.Sh RETURN VALUES -The -.Fn modf -function returns the signed fractional part of -.Fa value . -.Sh SEE ALSO -.Xr frexp 3 , -.Xr ldexp 3 , -.Xr math 3 -.Sh STANDARDS -The -.Fn modf -function conforms to -.St -isoC . diff --git a/src/lib/libc/gen/msgctl.3 b/src/lib/libc/gen/msgctl.3 deleted file mode 100644 index 8391de2..0000000 --- a/src/lib/libc/gen/msgctl.3 +++ /dev/null @@ -1,214 +0,0 @@ -.\" $NetBSD: msgctl.2,v 1.1 1995/10/16 23:49:15 jtc Exp $ -.\" -.\" Copyright (c) 1995 Frank van der Linden -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed for the NetBSD Project -.\" by Frank van der Linden -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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: src/lib/libc/gen/msgctl.3,v 1.19 2003/09/08 19:57:14 ru Exp $ -.\"/ -.Dd November 24, 1997 -.Dt MSGCTL 3 -.Os -.Sh NAME -.Nm msgctl -.Nd message control operations -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In sys/ipc.h -.In sys/msg.h -.Ft int -.Fn msgctl "int msqid" "int cmd" "struct msqid_ds *buf" -.Sh DESCRIPTION -The -.Fn msgctl -system call performs some control operations on the message queue specified -by -.Fa msqid . -.Pp -Each message queue has a data structure associated with it, parts of which -may be altered by -.Fn msgctl -and parts of which determine the actions of -.Fn msgctl . -The data structure is defined in -.In sys/msg.h -and contains (amongst others) the following members: -.Bd -literal -struct msqid_ds { - struct ipc_perm msg_perm; /* msg queue permission bits */ - struct msg *msg_first; /* first message in the queue */ - struct msg *msg_last; /* last message in the queue */ - u_long msg_cbytes; /* number of bytes in use on the queue */ - u_long msg_qnum; /* number of msgs in the queue */ - u_long msg_qbytes; /* max # of bytes on the queue */ - pid_t msg_lspid; /* pid of last msgsnd() */ - pid_t msg_lrpid; /* pid of last msgrcv() */ - time_t msg_stime; /* time of last msgsnd() */ - long msg_pad1; - time_t msg_rtime; /* time of last msgrcv() */ - long msg_pad2; - time_t msg_ctime; /* time of last msgctl() */ - long msg_pad3; - long msg_pad4[4]; -}; -.Ed -.Pp -The -.Vt ipc_perm -structure used inside the -.Vt shmid_ds -structure is defined in -.In sys/ipc.h -and looks like this: -.Bd -literal -struct ipc_perm { - ushort cuid; /* creator user id */ - ushort cgid; /* creator group id */ - ushort uid; /* user id */ - ushort gid; /* group id */ - ushort mode; /* r/w permission */ - ushort seq; /* sequence # (to generate unique msg/sem/shm id) */ - key_t key; /* user specified msg/sem/shm key */ -}; -.Ed -.Pp -The operation to be performed by -.Fn msgctl -is specified in -.Fa cmd -and is one of: -.Bl -tag -width IPC_RMIDX -.It Dv IPC_STAT -Gather information about the message queue and place it in the -structure pointed to by -.Fa buf . -.It Dv IPC_SET -Set the value of the -.Va msg_perm.uid , -.Va msg_perm.gid , -.Va msg_perm.mode -and -.Va msg_qbytes -fields in the structure associated with -.Fa msqid . -The values are taken from the corresponding fields in the structure -pointed to by -.Fa buf . -This operation can only be executed by the super-user, or a process that -has an effective user id equal to either -.Va msg_perm.cuid -or -.Va msg_perm.uid -in the data structure associated with the message queue. -The value of -.Va msg_qbytes -can only be increased by the super-user. -Values for -.Va msg_qbytes -that exceed the system limit (MSGMNB from -.In sys/msg.h ) -are silently truncated to that limit. -.It Dv IPC_RMID -Remove the message queue specified by -.Fa msqid -and destroy the data associated with it. -Only the super-user or a process -with an effective uid equal to the -.Va msg_perm.cuid -or -.Va msg_perm.uid -values in the data structure associated with the queue can do this. -.El -.Pp -The permission to read from or write to a message queue (see -.Xr msgsnd 3 -and -.Xr msgrcv 3 ) -is determined by the -.Va msg_perm.mode -field in the same way as is -done with files (see -.Xr chmod 2 ) , -but the effective uid can match either the -.Va msg_perm.cuid -field or the -.Va msg_perm.uid -field, and the -effective gid can match either -.Va msg_perm.cgid -or -.Va msg_perm.gid . -.Sh RETURN VALUES -.Rv -std msgctl -.Sh ERRORS -The -.Fn msgctl -function -will fail if: -.Bl -tag -width Er -.It Bq Er EPERM -The -.Fa cmd -argument -is equal to IPC_SET or IPC_RMID and the caller is not the super-user, nor does -the effective uid match either the -.Va msg_perm.uid -or -.Va msg_perm.cuid -fields of the data structure associated with the message queue. -.Pp -An attempt is made to increase the value of -.Va msg_qbytes -through IPC_SET -but the caller is not the super-user. -.It Bq Er EACCES -The command is IPC_STAT -and the caller has no read permission for this message queue. -.It Bq Er EINVAL -The -.Fa msqid -argument -is not a valid message queue identifier. -.Pp -.Va cmd -is not a valid command. -.It Bq Er EFAULT -The -.Fa buf -argument -specifies an invalid address. -.El -.Sh SEE ALSO -.Xr msgget 3 , -.Xr msgrcv 3 , -.Xr msgsnd 3 -.Sh HISTORY -Message queues appeared in the first release of -.At V . diff --git a/src/lib/libc/gen/msgget.3 b/src/lib/libc/gen/msgget.3 deleted file mode 100644 index d875747..0000000 --- a/src/lib/libc/gen/msgget.3 +++ /dev/null @@ -1,141 +0,0 @@ -.\" $NetBSD: msgget.2,v 1.1 1995/10/16 23:49:19 jtc Exp $ -.\" -.\" Copyright (c) 1995 Frank van der Linden -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed for the NetBSD Project -.\" by Frank van der Linden -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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: src/lib/libc/gen/msgget.3,v 1.13 2002/12/18 10:13:54 ru Exp $ -.\" -.\"/ -.Dd August 17, 1995 -.Dt MSGGET 3 -.Os -.Sh NAME -.Nm msgget -.Nd get message queue -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In sys/ipc.h -.In sys/msg.h -.Ft int -.Fn msgget "key_t key" "int msgflg" -.Sh DESCRIPTION -The -.Fn msgget -function -returns the message queue identifier associated with -.Fa key . -A message queue identifier is a unique integer greater than zero. -.Pp -A message queue is created if either -.Fa key -is equal to -.Dv IPC_PRIVATE , -or -.Fa key -does not have a message queue identifier associated with it, and the -.Dv IPC_CREAT -bit is set in -.Fa msgflg . -.Pp -If a new message queue is created, the data structure associated with it (the -.Va msqid_ds -structure, see -.Xr msgctl 3 ) -is initialized as follows: -.Bl -bullet -.It -.Va msg_perm.cuid -and -.Va msg_perm.uid -are set to the effective uid of the calling process. -.It -.Va msg_perm.gid -and -.Va msg_perm.cgid -are set to the effective gid of the calling process. -.It -.Va msg_perm.mode -is set to the lower 9 bits of -.Fa msgflg . -.It -.Va msg_cbytes , -.Va msg_qnum , -.Va msg_lspid , -.Va msg_lrpid , -.Va msg_rtime , -and -.Va msg_stime -are set to 0. -.It -.Va msg_qbytes -is set to the system wide maximum value for the number of bytes in a queue -.Pf ( Dv MSGMNB ) . -.It -.Va msg_ctime -is set to the current time. -.El -.Sh RETURN VALUES -Upon successful completion a positive message queue identifier is returned. -Otherwise, -1 is returned and the global variable -.Va errno -is set to indicate the error. -.Sh ERRORS -.Bl -tag -width Er -.It Bq Er EACCES -A message queue is already associated with -.Fa key -and the caller has no permission to access it. -.It Bq Er EEXIST -Both -.Dv IPC_CREAT -and -.Dv IPC_EXCL -are set in -.Fa msgflg , -and a message queue is already associated with -.Fa key . -.It Bq Er ENOSPC -A new message queue could not be created because the system limit for -the number of message queues has been reached. -.It Bq Er ENOENT -.Dv IPC_CREAT -was not set in -.Fa msgflg -and no message queue associated with -.Fa key -was found. -.El -.Sh SEE ALSO -.Xr msgctl 3 , -.Xr msgrcv 3 , -.Xr msgsnd 3 -.Sh HISTORY -Message queues appeared in the first release of -.At V . diff --git a/src/lib/libc/gen/msgrcv.3 b/src/lib/libc/gen/msgrcv.3 deleted file mode 100644 index 6e8f9b3..0000000 --- a/src/lib/libc/gen/msgrcv.3 +++ /dev/null @@ -1,218 +0,0 @@ -.\" $NetBSD: msgrcv.2,v 1.1 1995/10/16 23:49:20 jtc Exp $ -.\" -.\" Copyright (c) 1995 Frank van der Linden -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed for the NetBSD Project -.\" by Frank van der Linden -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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: src/lib/libc/gen/msgrcv.3,v 1.18 2002/12/19 09:40:21 ru Exp $ -.\" -.\"/ -.Dd November 24, 1997 -.Dt MSGRCV 3 -.Os -.Sh NAME -.Nm msgrcv -.Nd receive a message from a message queue -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In sys/ipc.h -.In sys/msg.h -.Ft int -.Fn msgrcv "int msqid" "void *msgp" "size_t msgsz" "long msgtyp" "int msgflg" -.Sh DESCRIPTION -The -.Fn msgrcv -function receives a message from the message queue specified in -.Fa msqid , -and places it into the structure pointed to by -.Fa msgp . -This structure should consist of the following members: -.Bd -literal - long mtype; /* message type */ - char mtext[1]; /* body of message */ -.Ed -.Pp -.Va mtype -is an integer greater than 0 that can be used for selecting messages, -.Va mtext -is an array of bytes, with a size up to that of the system limit -.Pf ( Dv MSGMAX ) . -.Pp -The value of -.Fa msgtyp -has one of the following meanings: -.Bl -bullet -.It -The -.Fa msgtyp -argument -is greater than 0. The first message of type -.Fa msgtyp -will be received. -.It -The -.Fa msgtyp -argument -is equal to 0. The first message on the queue will be received. -.It -The -.Fa msgtyp -argument -is less than 0. The first message of the lowest message type that is -less than or equal to the absolute value of -.Fa msgtyp -will be received. -.El -.Pp -The -.Fa msgsz -argument -specifies the maximum length of the requested message. -If the received -message has a length greater than -.Fa msgsz -it will be silently truncated if the -.Dv MSG_NOERROR -flag is set in -.Fa msgflg , -otherwise an error will be returned. -.Pp -If no matching message is present on the message queue specified by -.Fa msqid , -the behavior of -.Fn msgrcv -depends on whether the -.Dv IPC_NOWAIT -flag is set in -.Fa msgflg -or not. -If -.Dv IPC_NOWAIT -is set, -.Fn msgrcv -will immediately return a value of -1, and set -.Va errno -to -.Er EAGAIN . -If -.Dv IPC_NOWAIT -is not set, the calling process will be blocked -until: -.Bl -bullet -.It -A message of the requested type becomes available on the message queue. -.It -The message queue is removed, in which case -1 will be returned, and -.Va errno -set to -.Er EINVAL . -.It -A signal is received and caught. -1 is returned, and -.Va errno -set to -.Er EINTR . -.El -.Pp -If a message is successfully received, the data structure associated with -.Fa msqid -is updated as follows: -.Bl -bullet -.It -.Va msg_cbytes -is decremented by the size of the message. -.It -.Va msg_lrpid -is set to the pid of the caller. -.It -.Va msg_lrtime -is set to the current time. -.It -.Va msg_qnum -is decremented by 1. -.El -.Sh RETURN VALUES -Upon successful completion, -.Fn msgrcv -returns the number of bytes received into the -.Va mtext -field of the structure pointed to by -.Fa msgp . -Otherwise, -1 is returned, and -.Va errno -set to indicate the error. -.Sh ERRORS -The -.Fn msgrcv -function -will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -The -.Fa msqid -argument -is not a valid message queue identifier. -.Pp -The message queue was removed while -.Fn msgrcv -was waiting for a message of the requested type to become available on it. -.Pp -The -.Fa msgsz -argument -is less than 0. -.It Bq Er E2BIG -A matching message was received, but its size was greater than -.Fa msgsz -and the -.Dv MSG_NOERROR -flag was not set in -.Fa msgflg . -.It Bq Er EACCES -The calling process does not have read access to the message queue. -.It Bq Er EFAULT -The -.Fa msgp -argument -points to an invalid address. -.It Bq Er EINTR -The system call was interrupted by the delivery of a signal. -.It Bq Er EAGAIN -There is no message of the requested type available on the message queue, -and -.Dv IPC_NOWAIT -is set in -.Fa msgflg . -.El -.Sh SEE ALSO -.Xr msgctl 3 , -.Xr msgget 3 , -.Xr msgsnd 3 -.Sh HISTORY -Message queues appeared in the first release of -.At V . diff --git a/src/lib/libc/gen/msgsnd.3 b/src/lib/libc/gen/msgsnd.3 deleted file mode 100644 index 111cdfd..0000000 --- a/src/lib/libc/gen/msgsnd.3 +++ /dev/null @@ -1,179 +0,0 @@ -.\" $NetBSD: msgsnd.2,v 1.1 1995/10/16 23:49:24 jtc Exp $ -.\" -.\" Copyright (c) 1995 Frank van der Linden -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed for the NetBSD Project -.\" by Frank van der Linden -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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: src/lib/libc/gen/msgsnd.3,v 1.19 2003/01/26 20:09:34 alfred Exp $ -.\" -.Dd November 24, 1997 -.Dt MSGSND 3 -.Os -.Sh NAME -.Nm msgsnd -.Nd send a message to a message queue -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In sys/ipc.h -.In sys/msg.h -.Ft int -.Fn msgsnd "int msqid" "const void *msgp" "size_t msgsz" "int msgflg" -.Sh DESCRIPTION -The -.Fn msgsnd -function sends a message to the message queue specified in -.Fa msqid . -The -.Fa msgp -argument -points to a structure containing the message. -This structure should -consist of the following members: -.Bd -literal - long mtype; /* message type */ - char mtext[1]; /* body of message */ -.Ed -.Pp -.Va mtype -is an integer greater than 0 that can be used for selecting messages (see -.Xr msgrcv 3 ) , -.Va mtext -is an array of bytes, with a size up to that of the system limit -.Pf ( Dv MSGMAX ) . -.Pp -If the number of bytes already on the message queue plus -.Fa msgsz -is bigger than the maximum number of bytes on the message queue -.Pf ( Va msg_qbytes , -see -.Xr msgctl 3 ) , -or the number of messages on all queues system-wide is already equal to -the system limit, -.Fa msgflg -determines the action of -.Fn msgsnd . -If -.Fa msgflg -has -.Dv IPC_NOWAIT -mask set in it, the call will return immediately. -If -.Fa msgflg -does not have -.Dv IPC_NOWAIT -set in it, the call will block until: -.Bl -bullet -.It -The condition which caused the call to block does no longer exist. -The message will be sent. -.It -The message queue is removed, in which case -1 will be returned, and -.Va errno -is set to -.Er EINVAL . -.It -The caller catches a signal. -The call returns with -.Va errno -set to -.Er EINTR . -.El -.Pp -After a successful call, the data structure associated with the message -queue is updated in the following way: -.Bl -bullet -.It -.Va msg_cbytes -is incremented by the size of the message. -.It -.Va msg_qnum -is incremented by 1. -.It -.Va msg_lspid -is set to the pid of the calling process. -.It -.Va msg_stime -is set to the current time. -.El -.Sh RETURN VALUES -.Rv -std msgsnd -.Sh ERRORS -The -.Fn msgsnd -function -will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -The -.Fa msqid -argument -is not a valid message queue identifier -.Pp -The message queue was removed while -.Fn msgsnd -was waiting for a resource to become available in order to deliver the -message. -.Pp -The -.Fa msgsz -argument -is less than 0, or greater than -.Va msg_qbytes . -.Pp -The -.Fa mtype -argument -is not greater than 0. -.It Bq Er EACCES -The calling process does not have write access to the message queue. -.It Bq Er EAGAIN -There was no space for this message either on the queue, or in the whole -system, and -.Dv IPC_NOWAIT -was set in -.Fa msgflg . -.It Bq Er EFAULT -The -.Fa msgp -argument -points to an invalid address. -.It Bq Er EINTR -The system call was interrupted by the delivery of a signal. -.El -.Sh BUGS -.Nx -and -.Fx -do not define the -.Er EIDRM -error value, which should be used -in the case of a removed message queue. -.Sh HISTORY -Message queues appeared in the first release of AT&T Unix System V. diff --git a/src/lib/libc/gen/nice.3 b/src/lib/libc/gen/nice.3 deleted file mode 100644 index 6a98d9e..0000000 --- a/src/lib/libc/gen/nice.3 +++ /dev/null @@ -1,73 +0,0 @@ -.\" Copyright (c) 1980, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)nice.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/nice.3,v 1.11 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt NICE 3 -.Os -.Sh NAME -.Nm nice -.Nd set program scheduling priority -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft int -.Fn nice "int incr" -.Sh DESCRIPTION -.Bf -symbolic -This interface is obsoleted by -.Xr setpriority 2 . -.Ef -.Pp -The -.Fn nice -function obtains the scheduling priority of the process -from the system and sets it to the priority value specified in -.Fa incr . -The priority is a value in the range -20 to 20. -The default priority is 0; lower priorities cause more favorable scheduling. -Only the super-user may lower priorities. -.Pp -Children inherit the priority of their parent processes via -.Xr fork 2 . -.Sh SEE ALSO -.Xr nice 1 , -.Xr fork 2 , -.Xr setpriority 2 , -.Xr renice 8 -.Sh HISTORY -A -.Fn nice -syscall appeared in -.At v6 . diff --git a/src/lib/libc/gen/nlist.3 b/src/lib/libc/gen/nlist.3 deleted file mode 100644 index 9a6309c..0000000 --- a/src/lib/libc/gen/nlist.3 +++ /dev/null @@ -1,81 +0,0 @@ -.\" Copyright (c) 1980, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)nlist.3 8.3 (Berkeley) 4/19/94 -.\" $FreeBSD: src/lib/libc/gen/nlist.3,v 1.7 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd April 19, 1994 -.Dt NLIST 3 -.Os -.Sh NAME -.Nm nlist -.Nd retrieve symbol table name list from an executable file -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In nlist.h -.Ft int -.Fn nlist "const char *filename" "struct nlist *nl" -.Sh DESCRIPTION -The -.Fn nlist -function -retrieves name list entries from the symbol table of an -executable file (see -.Xr a.out 5 ) . -The argument -.Fa \&nl -is set to reference the -beginning of the list. -The list is preened of binary and invalid data; -if an entry in the -name list is valid, the -.Fa n_type -and -.Fa n_value -for the entry are copied into the list -referenced by -.Fa \&nl . -No other data is copied. -The last entry in the list is always -.Dv NULL . -.Sh RETURN VALUES -The number of invalid entries is returned if successful; otherwise, -if the file -.Fa filename -does not exist or is not executable, the returned value is \-1. -.Sh SEE ALSO -.Xr a.out 5 -.Sh HISTORY -A -.Fn nlist -function appeared in -.At v6 . diff --git a/src/lib/libc/gen/pause.3 b/src/lib/libc/gen/pause.3 deleted file mode 100644 index b8c257e..0000000 --- a/src/lib/libc/gen/pause.3 +++ /dev/null @@ -1,86 +0,0 @@ -.\" Copyright (c) 1980, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)pause.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/pause.3,v 1.8 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt PAUSE 3 -.Os -.Sh NAME -.Nm pause -.Nd stop until signal -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft int -.Fn pause void -.Sh DESCRIPTION -.Sy Pause is made obsolete by -.Xr sigsuspend 2 . -.Pp -The -.Fn pause -function -forces a process to pause until -a signal is received from either the -.Xr kill 2 -function -or an interval timer. -(See -.Xr setitimer 2 . ) -Upon termination of a signal handler started during a -.Fn pause , -the -.Fn pause -call will return. -.Sh RETURN VALUES -Always returns \-1. -.Sh ERRORS -The -.Fn pause -function -always returns: -.Bl -tag -width Er -.It Bq Er EINTR -The call was interrupted. -.El -.Sh SEE ALSO -.Xr kill 2 , -.Xr select 2 , -.Xr sigsuspend 2 -.Sh HISTORY -A -.Fn pause -syscall -appeared in -.At v6 . diff --git a/src/lib/libc/gen/popen.3 b/src/lib/libc/gen/popen.3 deleted file mode 100644 index 12974b7..0000000 --- a/src/lib/libc/gen/popen.3 +++ /dev/null @@ -1,201 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)popen.3 8.2 (Berkeley) 5/3/95 -.\" $FreeBSD: src/lib/libc/gen/popen.3,v 1.16 2003/06/08 10:01:51 charnier Exp $ -.\" -.Dd May 3, 1995 -.Dt POPEN 3 -.Os -.Sh NAME -.Nm popen , -.Nm pclose -.Nd process -.Tn I/O -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In stdio.h -.Ft FILE * -.Fn popen "const char *command" "const char *type" -.Ft int -.Fn pclose "FILE *stream" -.Sh DESCRIPTION -The -.Fn popen -function -.Dq opens -a process by creating a bidirectional pipe -forking, -and invoking the shell. -Any streams opened by previous -.Fn popen -calls in the parent process are closed in the new child process. -Historically, -.Fn popen -was implemented with a unidirectional pipe; -hence many implementations of -.Fn popen -only allow the -.Fa type -argument to specify reading or writing, not both. -Since -.Fn popen -is now implemented using a bidirectional pipe, the -.Fa type -argument may request a bidirectional data flow. -The -.Fa type -argument is a pointer to a null-terminated string -which must be -.Ql r -for reading, -.Ql w -for writing, or -.Ql r+ -for reading and writing. -.Pp -The -.Fa command -argument is a pointer to a null-terminated string -containing a shell command line. -This command is passed to -.Pa /bin/sh -using the -.Fl c -flag; interpretation, if any, is performed by the shell. -.Pp -The return value from -.Fn popen -is a normal standard -.Tn I/O -stream in all respects -save that it must be closed with -.Fn pclose -rather than -.Fn fclose . -Writing to such a stream -writes to the standard input of the command; -the command's standard output is the same as that of the process that called -.Fn popen , -unless this is altered by the command itself. -Conversely, reading from a -.Dq popened -stream reads the command's standard output, and -the command's standard input is the same as that of the process that called -.Fn popen . -.Pp -Note that output -.Fn popen -streams are fully buffered by default. -.Pp -The -.Fn pclose -function waits for the associated process to terminate -and returns the exit status of the command -as returned by -.Xr wait4 2 . -.Sh RETURN VALUES -The -.Fn popen -function returns -.Dv NULL -if the -.Xr fork 2 -or -.Xr pipe 2 -calls fail, -or if it cannot allocate memory. -.Pp -The -.Fn pclose -function -returns \-1 if -.Fa stream -is not associated with a -.Dq popened -command, if -.Fa stream -already -.Dq pclosed , -or if -.Xr wait4 2 -returns an error. -.Sh ERRORS -The -.Fn popen -function does not reliably set -.Va errno . -.Sh SEE ALSO -.Xr sh 1 , -.Xr fork 2 , -.Xr pipe 2 , -.Xr wait4 2 , -.Xr fclose 3 , -.Xr fflush 3 , -.Xr fopen 3 , -.Xr stdio 3 , -.Xr system 3 -.Sh BUGS -Since the standard input of a command opened for reading -shares its seek offset with the process that called -.Fn popen , -if the original process has done a buffered read, -the command's input position may not be as expected. -Similarly, the output from a command opened for writing -may become intermingled with that of the original process. -The latter can be avoided by calling -.Xr fflush 3 -before -.Fn popen . -.Pp -Failure to execute the shell -is indistinguishable from the shell's failure to execute command, -or an immediate exit of the command. -The only hint is an exit status of 127. -.Pp -The -.Fn popen -function -always calls -.Xr sh 1 , -never calls -.Xr csh 1 . -.Sh HISTORY -A -.Fn popen -and a -.Fn pclose -function appeared in -.At v7 . -.Pp -Bidirectional functionality was added in -.Fx 2.2.6 . diff --git a/src/lib/libc/gen/pselect.3 b/src/lib/libc/gen/pselect.3 deleted file mode 100644 index 4b12fb7..0000000 --- a/src/lib/libc/gen/pselect.3 +++ /dev/null @@ -1,127 +0,0 @@ -.\" -.\" Copyright 2002 Massachusetts Institute of Technology -.\" -.\" Permission to use, copy, modify, and distribute this software and -.\" its documentation for any purpose and without fee is hereby -.\" granted, provided that both the above copyright notice and this -.\" permission notice appear in all copies, that both the above -.\" copyright notice and this permission notice appear in all -.\" supporting documentation, and that the name of M.I.T. not be used -.\" in advertising or publicity pertaining to distribution of the -.\" software without specific, written prior permission. M.I.T. makes -.\" no representations about the suitability of this software for any -.\" purpose. It is provided "as is" without express or implied -.\" warranty. -.\" -.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS -.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, -.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT -.\" SHALL M.I.T. 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: src/lib/libc/gen/pselect.3,v 1.4 2002/12/18 10:13:54 ru Exp $ -.\" -.Dd June 16, 2002 -.Dt PSELECT 3 -.Os -.Sh NAME -.Nm pselect -.Nd synchronous I/O multiplexing a la POSIX.1g -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/select.h -.Ft int -.Fo pselect -.Fa "int nfds" -.Fa "fd_set * restrict readfds" -.Fa "fd_set * restrict writefds" -.Fa "fd_set * restrict exceptfds" -.Fa "const struct timespec * restrict timeout" -.Fa "const sigset_t * restrict newsigmask" -.Fc -.Sh DESCRIPTION -The -.Fn pselect -function was introduced by -.St -p1003.1g-2000 -as a slightly stronger version of -.Xr select 2 . -The -.Fa nfds , readfds , writefds , -and -.Fa exceptfds -arguments are all identical to the analogous arguments of -.Fn select . -The -.Fa timeout -argument in -.Fn pselect -points to a -.Vt "const struct timespec" -rather than the (modifiable) -.Vt "struct timeval" -used by -.Fn select ; -as in -.Fn select , -a null pointer may be passed to indicate that -.Fn pselect -should wait indefinitely. -Finally, -.Fa newsigmask -specifies a signal mask which is set while waiting for input. -When -.Fn pselect -returns, the original signal mask is restored. -.Pp -See -.Xr select 2 -for a more detailed discussion of the semantics of this interface, and -for macros used to manipulate the -.Vt "fd_set" -data type. -.Sh IMPLEMENTATION NOTES -The -.Fn pselect -function is implemented in the C library as a wrapper around -.Fn select . -.Sh RETURN VALUES -The -.Fn pselect -function returns the same values and under the same conditions as -.Fn select . -.Sh ERRORS -The -.Fn pselect -function may fail for any of the reasons documented for -.Xr select 2 -and (if a signal mask is provided) -.Xr sigprocmask 2 . -.Sh SEE ALSO -.Xr kqueue 2 , -.Xr poll 2 , -.Xr select 2 , -.Xr sigprocmask 2 -.Sh STANDARDS -The -.Fn pselect -function conforms to -.St -p1003.1-2001 . -.Sh HISTORY -The -.Fn pselect -function first appeared in -.Fx 5.0 . -.Sh AUTHORS -The -.Fn pselect -function and this manual page were written by -.An Garrett Wollman Aq wollman@FreeBSD.org . diff --git a/src/lib/libc/gen/psignal.3 b/src/lib/libc/gen/psignal.3 deleted file mode 100644 index 02013a4..0000000 --- a/src/lib/libc/gen/psignal.3 +++ /dev/null @@ -1,113 +0,0 @@ -.\" Copyright (c) 1983, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)psignal.3 8.2 (Berkeley) 2/27/95 -.\" $FreeBSD: src/lib/libc/gen/psignal.3,v 1.16 2002/12/30 21:18:02 schweikh Exp $ -.\" -.Dd February 27, 1995 -.Dt PSIGNAL 3 -.Os -.Sh NAME -.Nm psignal , -.Nm strsignal , -.Nm sys_siglist , -.Nm sys_signame -.Nd system signal messages -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In signal.h -.Ft void -.Fn psignal "unsigned sig" "const char *s" -.Vt extern const char * const sys_siglist[] ; -.Vt extern const char * const sys_signame[] ; -.In string.h -.Ft "char *" -.Fn strsignal "int sig" -.Sh DESCRIPTION -The -.Fn psignal -and -.Fn strsignal -functions locate the descriptive message -string for a signal number. -.Pp -The -.Fn strsignal -function accepts a signal number argument -.Fa sig -and returns a pointer to the corresponding message string. -.Pp -The -.Fn psignal -function accepts a signal number argument -.Fa sig -and writes it to the standard error. -If the argument -.Fa s -is -.Pf non- Dv NULL -and does not point to the null character, -.Fa s -is written to the standard error file descriptor -prior to the message string, -immediately followed by a colon and a space. -If the signal number is not recognized -.Pq Xr sigaction 2 , -the string -.Dq "Unknown signal -is produced. -.Pp -The message strings can be accessed directly -through the external array -.Va sys_siglist , -indexed by recognized signal numbers. -The external array -.Va sys_signame -is used similarly and -contains short, lower-case abbreviations for signals -which are useful for recognizing signal names -in user input. -The defined variable -.Dv NSIG -contains a count of the strings in -.Va sys_siglist -and -.Va sys_signame . -.Sh SEE ALSO -.Xr sigaction 2 , -.Xr perror 3 , -.Xr strerror 3 -.Sh HISTORY -The -.Fn psignal -function appeared in -.Bx 4.2 . diff --git a/src/lib/libc/gen/pwcache.3 b/src/lib/libc/gen/pwcache.3 deleted file mode 100644 index ea2263f..0000000 --- a/src/lib/libc/gen/pwcache.3 +++ /dev/null @@ -1,97 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)pwcache.3 8.1 (Berkeley) 6/9/93 -.\" $FreeBSD: src/lib/libc/gen/pwcache.3,v 1.12 2002/03/22 02:35:47 imp Exp $ -.\" -.Dd June 9, 1993 -.Dt PWCACHE 3 -.Os -.Sh NAME -.Nm pwcache -.Nd cache password and group entries -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In pwd.h -.Ft const char * -.Fn user_from_uid "unsigned long uid" "int nouser" -.In grp.h -.Ft const char * -.Fn group_from_gid "unsigned long gid" "int nogroup" -.Sh DESCRIPTION -The -.Fn user_from_uid -function returns the user name associated with the argument -.Fa uid . -The user name is cached so that multiple calls with the same -.Fa uid -do not require additional calls to -.Xr getpwuid 3 . -If there is no user associated with the -.Fa uid , -a pointer is returned -to a string representation of the -.Fa uid , -unless the argument -.Fa nouser -is non-zero, in which case a -.Dv NULL -pointer is returned. -.Pp -The -.Fn group_from_gid -function returns the group name associated with the argument -.Fa gid . -The group name is cached so that multiple calls with the same -.Fa gid -do not require additional calls to -.Xr getgrgid 3 . -If there is no group associated with the -.Fa gid , -a pointer is returned -to a string representation of the -.Fa gid , -unless the argument -.Fa nogroup -is non-zero, in which case a -.Dv NULL -pointer is returned. -.Sh SEE ALSO -.Xr getgrgid 3 , -.Xr getpwuid 3 -.Sh HISTORY -The -.Fn user_from_uid -and -.Fn group_from_gid -functions first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/gen/raise.3 b/src/lib/libc/gen/raise.3 deleted file mode 100644 index 1a8fcd7..0000000 --- a/src/lib/libc/gen/raise.3 +++ /dev/null @@ -1,77 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" the American National Standards Committee X3, on Information -.\" Processing Systems. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)raise.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/raise.3,v 1.7 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt RAISE 3 -.Os -.Sh NAME -.Nm raise -.Nd send a signal to the current process -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In signal.h -.Ft int -.Fn raise "int sig" -.Sh DESCRIPTION -The -.Fn raise -function sends the signal -.Fa sig -to the current process. -.Sh RETURN VALUES -.Rv -std raise -.Sh ERRORS -The -.Fn raise -function -may fail and set -.Va errno -for any of the errors specified for the -library functions -.Xr getpid 2 -and -.Xr kill 2 . -.Sh SEE ALSO -.Xr kill 2 -.Sh STANDARDS -The -.Fn raise -function -conforms to -.St -isoC . diff --git a/src/lib/libc/gen/rand48.3 b/src/lib/libc/gen/rand48.3 deleted file mode 100644 index 59bab77..0000000 --- a/src/lib/libc/gen/rand48.3 +++ /dev/null @@ -1,181 +0,0 @@ -.\" Copyright (c) 1993 Martin Birgmeier -.\" All rights reserved. -.\" -.\" You may redistribute unmodified or modified versions of this source -.\" code provided that the above copyright notice and this and the -.\" following conditions are retained. -.\" -.\" This software is provided ``as is'', and comes with no warranties -.\" of any kind. I shall in no event be liable for anything that happens -.\" to anyone/anything when using this software. -.\" -.\" @(#)rand48.3 V1.0 MB 8 Oct 1993 -.\" $FreeBSD: src/lib/libc/gen/rand48.3,v 1.15 2002/12/19 09:40:21 ru Exp $ -.\" -.Dd October 8, 1993 -.Dt RAND48 3 -.Os -.Sh NAME -.Nm drand48 , -.Nm erand48 , -.Nm lrand48 , -.Nm nrand48 , -.Nm mrand48 , -.Nm jrand48 , -.Nm srand48 , -.Nm seed48 , -.Nm lcong48 -.Nd pseudo random number generators and initialization routines -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In stdlib.h -.Ft double -.Fn drand48 void -.Ft double -.Fn erand48 "unsigned short xseed[3]" -.Ft long -.Fn lrand48 void -.Ft long -.Fn nrand48 "unsigned short xseed[3]" -.Ft long -.Fn mrand48 void -.Ft long -.Fn jrand48 "unsigned short xseed[3]" -.Ft void -.Fn srand48 "long seed" -.Ft "unsigned short *" -.Fn seed48 "unsigned short xseed[3]" -.Ft void -.Fn lcong48 "unsigned short p[7]" -.Sh DESCRIPTION -The -.Fn rand48 -family of functions generates pseudo-random numbers using a linear -congruential algorithm working on integers 48 bits in size. -The -particular formula employed is -r(n+1) = (a * r(n) + c) mod m -where the default values are -for the multiplicand a = 0xfdeece66d = 25214903917 and -the addend c = 0xb = 11. -The modulo is always fixed at m = 2 ** 48. -r(n) is called the seed of the random number generator. -.Pp -For all the six generator routines described next, the first -computational step is to perform a single iteration of the algorithm. -.Pp -The -.Fn drand48 -and -.Fn erand48 -functions -return values of type double. -The full 48 bits of r(n+1) are -loaded into the mantissa of the returned value, with the exponent set -such that the values produced lie in the interval [0.0, 1.0). -.Pp -The -.Fn lrand48 -and -.Fn nrand48 -functions -return values of type long in the range -[0, 2**31-1]. The high-order (31) bits of -r(n+1) are loaded into the lower bits of the returned value, with -the topmost (sign) bit set to zero. -.Pp -The -.Fn mrand48 -and -.Fn jrand48 -functions -return values of type long in the range -[-2**31, 2**31-1]. The high-order (32) bits of -r(n+1) are loaded into the returned value. -.Pp -The -.Fn drand48 , -.Fn lrand48 , -and -.Fn mrand48 -functions -use an internal buffer to store r(n). For these functions -the initial value of r(0) = 0x1234abcd330e = 20017429951246. -.Pp -On the other hand, -.Fn erand48 , -.Fn nrand48 , -and -.Fn jrand48 -use a user-supplied buffer to store the seed r(n), -which consists of an array of 3 shorts, where the zeroth member -holds the least significant bits. -.Pp -All functions share the same multiplicand and addend. -.Pp -The -.Fn srand48 -function -is used to initialize the internal buffer r(n) of -.Fn drand48 , -.Fn lrand48 , -and -.Fn mrand48 -such that the 32 bits of the seed value are copied into the upper 32 bits -of r(n), with the lower 16 bits of r(n) arbitrarily being set to 0x330e. -Additionally, the constant multiplicand and addend of the algorithm are -reset to the default values given above. -.Pp -The -.Fn seed48 -function -also initializes the internal buffer r(n) of -.Fn drand48 , -.Fn lrand48 , -and -.Fn mrand48 , -but here all 48 bits of the seed can be specified in an array of 3 shorts, -where the zeroth member specifies the lowest bits. -Again, -the constant multiplicand and addend of the algorithm are -reset to the default values given above. -The -.Fn seed48 -function -returns a pointer to an array of 3 shorts which contains the old seed. -This array is statically allocated, thus its contents are lost after -each new call to -.Fn seed48 . -.Pp -Finally, -.Fn lcong48 -allows full control over the multiplicand and addend used in -.Fn drand48 , -.Fn erand48 , -.Fn lrand48 , -.Fn nrand48 , -.Fn mrand48 , -and -.Fn jrand48 , -and the seed used in -.Fn drand48 , -.Fn lrand48 , -and -.Fn mrand48 . -An array of 7 shorts is passed as argument; the first three shorts are -used to initialize the seed; the second three are used to initialize the -multiplicand; and the last short is used to initialize the addend. -It is thus not possible to use values greater than 0xffff as the addend. -.Pp -Note that all three methods of seeding the random number generator -always also set the multiplicand and addend for any of the six -generator calls. -.Pp -For a more powerful random number generator, see -.Xr random 3 . -.Sh AUTHORS -.An Martin Birgmeier -.Sh SEE ALSO -.Xr rand 3 , -.Xr random 3 diff --git a/src/lib/libc/gen/readpassphrase.3 b/src/lib/libc/gen/readpassphrase.3 deleted file mode 100644 index ea143ec..0000000 --- a/src/lib/libc/gen/readpassphrase.3 +++ /dev/null @@ -1,191 +0,0 @@ -.\" $OpenBSD: readpassphrase.3,v 1.7 2001/12/15 15:37:51 millert Exp $ -.\" -.\" Copyright (c) 2000 Todd C. Miller -.\" 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. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED ``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 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: src/lib/libc/gen/readpassphrase.3,v 1.6 2002/12/27 12:15:28 schweikh Exp $ -.\" -.Dd December 7, 2001 -.Dt READPASSPHRASE 3 -.Os -.Sh NAME -.Nm readpassphrase -.Nd get a passphrase from the user -.Sh SYNOPSIS -.In readpassphrase.h -.Ft "char *" -.Fn readpassphrase "const char *prompt" "char *buf" "size_t bufsiz" "int flags" -.Sh DESCRIPTION -The -.Fn readpassphrase -function displays a prompt to, and reads in a passphrase from, -.Pa /dev/tty . -If this file is inaccessible -and the -.Dv RPP_REQUIRE_TTY -flag is not set, -.Fn readpassphrase -displays the prompt on the standard error output and reads from the standard -input. -In this case it is generally not possible to turn off echo. -.Pp -Up to -.Fa bufsiz -\- 1 characters (one is for the -.Dv NUL ) -are read into the provided buffer -.Fa buf . -Any additional -characters and the terminating newline (or return) character are discarded. -.Pp -The -.Fn readpassphrase -function -takes the following optional -.Fa flags : -.Pp -.Bl -tag -width ".Dv RPP_REQUIRE_TTY" -compact -.It Dv RPP_ECHO_OFF -turn off echo (default behavior) -.It Dv RPP_ECHO_ON -leave echo on -.It Dv RPP_REQUIRE_TTY -fail if there is no tty -.It Dv RPP_FORCELOWER -force input to lower case -.It Dv RPP_FORCEUPPER -force input to upper case -.It Dv RPP_SEVENBIT -strip the high bit from input -.El -.Pp -The calling process should zero the passphrase as soon as possible to -avoid leaving the cleartext passphrase visible in the process's address -space. -.Sh RETURN VALUES -Upon successful completion, -.Fn readpassphrase -returns a pointer to the null-terminated passphrase. -If an error is encountered, the terminal state is restored and -a -.Dv NULL -pointer is returned. -.Sh ERRORS -.Bl -tag -width Er -.It Bq Er EINTR -The -.Fn readpassphrase -function was interrupted by a signal. -.It Bq Er EINVAL -The -.Fa bufsiz -argument was zero. -.It Bq Er EIO -The process is a member of a background process attempting to read -from its controlling terminal, the process is ignoring or blocking -the -.Dv SIGTTIN -signal or the process group is orphaned. -.It Bq Er EMFILE -The process has already reached its limit for open file descriptors. -.It Bq Er ENFILE -The system file table is full. -.It Bq Er ENOTTY -There is no controlling terminal and the -.Dv RPP_REQUIRE_TTY -flag was specified. -.El -.Sh EXAMPLES -The following code fragment will read a passphrase from -.Pa /dev/tty -into the buffer -.Fa passbuf . -.Bd -literal -offset indent -char passbuf[1024]; - -\&... - -if (readpassphrase("Response: ", passbuf, sizeof(passbuf), - RPP_REQUIRE_TTY) == NULL) - errx(1, "unable to read passphrase"); - -if (compare(transform(passbuf), epass) != 0) - errx(1, "bad passphrase"); - -\&... - -memset(passbuf, 0, sizeof(passbuf)); -.Ed -.Sh SIGNALS -The -.Fn readpassphrase -function -will catch the following signals: -.Pp -.Bl -tag -compact -.It Dv SIGINT -.It Dv SIGHUP -.It Dv SIGQUIT -.It Dv SIGTERM -.It Dv SIGTSTP -.It Dv SIGTTIN -.It Dv SIGTTOU -.El -.Pp -When one of the above signals is intercepted, terminal echo will -be restored if it had previously been turned off. -If a signal handler was installed for the signal when -.Fn readpassphrase -was called that handler is then executed. -If no handler was previously installed for the signal then the -default action is taken as per -.Xr sigaction 2 . -.Pp -The -.Dv SIGTSTP , SIGTTIN , -and -.Dv SIGTTOU -signals (stop signal generated from keyboard or due to terminal I/O -from a background process) are treated specially. -When the process is resumed after it has been stopped, -.Fn readpassphrase -will reprint the prompt and the user may then enter a passphrase. -.Sh FILES -.Bl -tag -width ".Pa /dev/tty" -compact -.It Pa /dev/tty -.El -.Sh SEE ALSO -.Xr sigaction 2 , -.Xr getpass 3 -.Sh STANDARDS -The -.Fn readpassphrase -function is an -extension and should not be used if portability is desired. -.Sh HISTORY -The -.Fn readpassphrase -function first appeared in -.Ox 2.9 . diff --git a/src/lib/libc/gen/rfork_thread.3 b/src/lib/libc/gen/rfork_thread.3 deleted file mode 100644 index bd03d93..0000000 --- a/src/lib/libc/gen/rfork_thread.3 +++ /dev/null @@ -1,79 +0,0 @@ -.\" -.\" Copyright (c) 2000 Peter Wemm -.\" 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: src/lib/libc/gen/rfork_thread.3,v 1.7 2003/04/27 21:07:27 robert Exp $ -.\" -.Dd July 29, 2000 -.Dt RFORK_THREAD 3 -.Os -.Sh NAME -.Nm rfork_thread -.Nd create a rfork-based process thread -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft pid_t -.Fn rfork_thread "int flags" "void *stack" "int (*func)(void *arg)" "void *arg" -.Sh DESCRIPTION -The -.Fn rfork_thread -function -is a helper function for -.Xr rfork 2 . -It arranges for a new process to be created and the child process will -call the specified function with the specified argument, while running on -the supplied stack. -.Pp -Using this function should avoid the need to implement complex stack -swap code. -.Sh RETURN VALUES -Upon successful completion, -.Fn rfork_thread -returns the process ID of the child process to the parent process. -Otherwise, a value of -1 is returned -to the parent process, no child process is created, and the global -variable -.Va errno -is set to indicate the error. -.Pp -The child process context is not aware of a return from the -.Fn rfork_thread -function as it begins executing directly with the supplied function. -.Sh ERRORS -See -.Xr rfork 2 -for error return codes. -.Sh SEE ALSO -.Xr fork 2 , -.Xr intro 2 , -.Xr minherit 2 , -.Xr rfork 2 , -.Xr vfork 2 -.Sh HISTORY -The -.Fn rfork_thread -function first appeared in -.Fx 4.3 . diff --git a/src/lib/libc/gen/scandir.3 b/src/lib/libc/gen/scandir.3 deleted file mode 100644 index b76eff8..0000000 --- a/src/lib/libc/gen/scandir.3 +++ /dev/null @@ -1,109 +0,0 @@ -.\" Copyright (c) 1983, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)scandir.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/scandir.3,v 1.8 2002/12/19 09:40:21 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt SCANDIR 3 -.Os -.Sh NAME -.Nm scandir , -.Nm alphasort -.Nd scan a directory -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In dirent.h -.Ft int -.Fn scandir "const char *dirname" "struct dirent ***namelist" "int \\*(lp*select\\*(rp\\*(lpstruct dirent *\\*(rp" "int \\*(lp*compar\\*(rp\\*(lpconst void *, const void *\\*(rp" -.Ft int -.Fn alphasort "const void *d1" "const void *d2" -.Sh DESCRIPTION -The -.Fn scandir -function -reads the directory -.Fa dirname -and builds an array of pointers to directory -entries using -.Xr malloc 3 . -It returns the number of entries in the array. -A pointer to the array of directory entries is stored in the location -referenced by -.Fa namelist . -.Pp -The -.Fa select -argument is a pointer to a user supplied subroutine which is called by -.Fn scandir -to select which entries are to be included in the array. -The select routine is passed a -pointer to a directory entry and should return a non-zero -value if the directory entry is to be included in the array. -If -.Fa select -is null, then all the directory entries will be included. -.Pp -The -.Fa compar -argument is a pointer to a user supplied subroutine which is passed to -.Xr qsort 3 -to sort the completed array. -If this pointer is null, the array is not sorted. -.Pp -The -.Fn alphasort -function -is a routine which can be used for the -.Fa compar -argument to sort the array alphabetically. -.Pp -The memory allocated for the array can be deallocated with -.Xr free 3 , -by freeing each pointer in the array and then the array itself. -.Sh DIAGNOSTICS -Returns \-1 if the directory cannot be opened for reading or if -.Xr malloc 3 -cannot allocate enough memory to hold all the data structures. -.Sh SEE ALSO -.Xr directory 3 , -.Xr malloc 3 , -.Xr qsort 3 , -.Xr dir 5 -.Sh HISTORY -The -.Fn scandir -and -.Fn alphasort -functions appeared in -.Bx 4.2 . diff --git a/src/lib/libc/gen/sem_destroy.3 b/src/lib/libc/gen/sem_destroy.3 deleted file mode 100644 index 96ae0ac..0000000 --- a/src/lib/libc/gen/sem_destroy.3 +++ /dev/null @@ -1,84 +0,0 @@ -.\" Copyright (C) 2000 Jason Evans . -.\" 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(s), this list of conditions and the following disclaimer as -.\" the first lines of this file unmodified other than the possible -.\" addition of one or more copyright notices. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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: src/lib/libc/gen/sem_destroy.3,v 1.13 2004/01/14 20:54:16 ru Exp $ -.Dd February 15, 2000 -.Dt SEM_DESTROY 3 -.Os -.Sh NAME -.Nm sem_destroy -.Nd destroy an unnamed semaphore -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In semaphore.h -.Ft int -.Fn sem_destroy "sem_t *sem" -.Sh DESCRIPTION -The -.Fn sem_destroy -function destroys the unnamed semaphore pointed to by -.Fa sem . -After a successful call to -.Fn sem_destroy , -.Fa sem -is unusable until re-initialized by another call to -.Fn sem_init . -.Sh RETURN VALUES -.Rv -std sem_destroy -.Sh ERRORS -The -.Fn sem_destroy -function will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -.Fa sem -points to an invalid semaphore. -.It Bq Er EBUSY -There are currently threads blocked on the semaphore that -.Fa sem -points to. -.El -.Sh SEE ALSO -.Xr sem_init 3 , -.Xr sem 4 -.Sh STANDARDS -The -.Fn sem_destroy -function conforms to -.St -p1003.1-96 . -.Pp -POSIX does not define the behavior of -.Fn sem_destroy -if called while there are threads blocked on -.Fa sem , -but this implementation is guaranteed to return -1 and set -.Va errno -to -.Er EBUSY -if there are threads blocked on -.Fa sem . diff --git a/src/lib/libc/gen/sem_getvalue.3 b/src/lib/libc/gen/sem_getvalue.3 deleted file mode 100644 index a681f22..0000000 --- a/src/lib/libc/gen/sem_getvalue.3 +++ /dev/null @@ -1,76 +0,0 @@ -.\" Copyright (C) 2000 Jason Evans . -.\" 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(s), this list of conditions and the following disclaimer as -.\" the first lines of this file unmodified other than the possible -.\" addition of one or more copyright notices. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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: src/lib/libc/gen/sem_getvalue.3,v 1.13 2004/01/14 20:54:16 ru Exp $ -.Dd February 15, 2000 -.Dt SEM_GETVALUE 3 -.Os -.Sh NAME -.Nm sem_getvalue -.Nd get the value of a semaphore -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In semaphore.h -.Ft int -.Fn sem_getvalue "sem_t * restrict sem" "int * restrict sval" -.Sh DESCRIPTION -The -.Fn sem_getvalue -function sets the variable pointed to by -.Fa sval -to the current value of the semaphore pointed to by -.Fa sem , -as of the time that the call to -.Fn sem_getvalue -is actually run. -.Sh RETURN VALUES -.Rv -std sem_getvalue -.Sh ERRORS -The -.Fn sem_getvalue -function will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -.Fa sem -points to an invalid semaphore. -.El -.Sh SEE ALSO -.Xr sem_post 3 , -.Xr sem_trywait 3 , -.Xr sem_wait 3 , -.Xr sem 4 -.Sh STANDARDS -The -.Fn sem_getvalue -function conforms to -.St -p1003.1-96 . -.Pp -The value of the semaphore is never negative, even if there are threads blocked -on the semaphore. POSIX is somewhat ambiguous in its wording with regard to -what the value of the semaphore should be if there are blocked waiting threads, -but this behavior is conformant, given the wording of the specification. diff --git a/src/lib/libc/gen/sem_init.3 b/src/lib/libc/gen/sem_init.3 deleted file mode 100644 index 17cb1f2..0000000 --- a/src/lib/libc/gen/sem_init.3 +++ /dev/null @@ -1,102 +0,0 @@ -.\" Copyright (C) 2000 Jason Evans . -.\" 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(s), this list of conditions and the following disclaimer as -.\" the first lines of this file unmodified other than the possible -.\" addition of one or more copyright notices. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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: src/lib/libc/gen/sem_init.3,v 1.16 2004/01/14 20:54:16 ru Exp $ -.Dd February 15, 2000 -.Dt SEM_INIT 3 -.Os -.Sh NAME -.Nm sem_init -.Nd initialize an unnamed semaphore -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In semaphore.h -.Ft int -.Fn sem_init "sem_t *sem" "int pshared" "unsigned int value" -.Sh DESCRIPTION -The -.Fn sem_init -function initializes the unnamed semaphore pointed to by -.Fa sem -to have the value -.Fa value . -A non-zero value for -.Fa pshared -specifies a shared semaphore that can be used by multiple processes, which this -implementation is not capable of. -.Pp -Following a successful call to -.Fn sem_init , -.Fa sem -can be used as an argument in subsequent calls to -.Xr sem_wait 3 , -.Xr sem_trywait 3 , -.Xr sem_post 3 , -and -.Xr sem_destroy 3 . -The -.Fa sem -argument is no longer valid after a successful call to -.Xr sem_destroy 3 . -.Sh RETURN VALUES -.Rv -std sem_init -.Sh ERRORS -The -.Fn sem_init -function will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -.Fa value -exceeds SEM_VALUE_MAX. -.It Bq Er ENOSPC -Memory allocation error. -.It Bq Er EPERM -Unable to initialize a shared semaphore. -.El -.Sh SEE ALSO -.Xr sem_destroy 3 , -.Xr sem_post 3 , -.Xr sem_trywait 3 , -.Xr sem_wait 3 , -.Xr sem 4 -.Sh STANDARDS -The -.Fn sem_init -function conforms to -.St -p1003.1-96 . -.Pp -This implementation does not support shared semaphores, and reports this fact -by setting -.Va errno -to -.Er EPERM . -This is perhaps a stretch of the intention of POSIX, but is -compliant, with the caveat that -.Fn sem_init -always reports a permissions error when an attempt to create a shared semaphore -is made. diff --git a/src/lib/libc/gen/sem_open.3 b/src/lib/libc/gen/sem_open.3 deleted file mode 100644 index b3c43f6..0000000 --- a/src/lib/libc/gen/sem_open.3 +++ /dev/null @@ -1,227 +0,0 @@ -.\" Copyright (C) 2000 Jason Evans . -.\" 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(s), this list of conditions and the following disclaimer as -.\" the first lines of this file unmodified other than the possible -.\" addition of one or more copyright notices. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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: src/lib/libc/gen/sem_open.3,v 1.11 2004/01/14 20:54:16 ru Exp $ -.Dd January 15, 2003 -.Dt SEM_OPEN 3 -.Os -.Sh NAME -.Nm sem_open , -.Nm sem_close , -.Nm sem_unlink -.Nd named semaphore operations -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In semaphore.h -.Ft sem_t * -.Fn sem_open "const char *name" "int oflag" "..." -.Ft int -.Fn sem_close "sem_t *sem" -.Ft int -.Fn sem_unlink "const char *name" -.Sh DESCRIPTION -The -.Fn sem_open -function creates or opens the named semaphore specified by -.Fa name . -The returned semaphore may be used in subsequent calls to -.Fn sem_getvalue , -.Fn sem_wait , -.Fn sem_trywait , -.Fn sem_post -and -.Fn sem_close . -.Pp -The following bits may be set in the -.Fa oflag -argument: -.Bl -tag -width ".Dv O_CREAT" -.It Dv O_CREAT -Create the semaphore if it does not already exist. -.Pp -The third argument to the call to -.Fn sem_open -must be of type -.Vt mode_t -and specifies the mode for the semaphore. -Only the -.Dv S_IWUSR , -.Dv S_IWGRP , -and -.Dv S_IWOTH -bits are examined; -it is not possible to grant only -.Dq read -permission on a semaphore. -The mode is modified according to the process's file creation -mask; see -.Xr umask 2 . -.Pp -The fourth argument must be an -.Vt "unsigned int" -and specifies the initial value for the semaphore, -and must be no greater than -.Dv SEM_VALUE_MAX . -.It Dv O_EXCL -Create the semaphore if it does not exist. -If the semaphore already exists, -.Fn sem_open -will fail. -This flag is ignored unless -.Dv O_CREAT -is also specified. -.El -.Pp -The -.Fn sem_close -function closes a named semaphore that was opened by a call to -.Fn sem_open . -.Pp -The -.Fn sem_unlink -function removes the semaphore named -.Fa name . -Resources allocated to the semaphore are only deallocated when all -processes that have the semaphore open close it. -.Sh RETURN VALUES -If successful, -the -.Fn sem_open -function returns the address of the opened semaphore. -If the same -.Fa name -argument is given to multiple calls to -.Fn sem_open -by the same process without an intervening call to -.Fn sem_close , -the same address is returned each time. -If the semaphore cannot be opened, -.Fn sem_open -returns -.Dv SEM_FAILED -and the global variable -.Va errno -is set to indicate the error. -.Pp -.Rv -std sem_close sem_unlink -.Sh ERRORS -The -.Fn sem_open -function will fail if: -.Bl -tag -width Er -.It Bq Er EACCES -The semaphore exists and the permissions specified by -.Fa oflag -at the time it was created deny access to the this process. -.It Bq Er EACCES -The semaphore does not exist, but permission to create it is denied. -.It Bq Er EEXIST -.Dv O_CREAT -and -.Dv O_EXCL -are set but the semaphore already exists. -.It Bq Er EINTR -The call was interrupted by a signal. -.It Bq Er EINVAL -The -.Fn sem_open -operation is not supported for the given -.Fa name . -.It Bq Er EINVAL -The -.Fa value -argument is greater than -.Dv SEM_VALUE_MAX . -.\"FreeBSD never returns EMFILE -.\".It Bq Er EMFILE -.\"Too many semaphores are in use by this process. -.It Bq Er ENAMETOOLONG -The -.Fa name -argument is too long. -.It Bq Er ENFILE -The system limit on semaphores has been reached. -.It Bq Er ENOENT -.Dv O_CREAT -is set but the named semaphore does not exist. -.It Bq Er ENOSPC -There is not enough space to create the semaphore. -.El -.Pp -The -.Fn sem_close -function will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -The -.Fa sem -argument is not a valid semaphore. -.El -.Pp -The -.Fn sem_unlink -function will fail if: -.Bl -tag -width Er -.It Bq Er EACCES -Permission is denied to unlink the semaphore. -.It Bq Er ENAMETOOLONG -The specified -.Fa name -is too long. -.It Bq Er ENOENT -The named semaphore does not exist. -.El -.Sh SEE ALSO -.Xr close 2 , -.Xr open 2 , -.Xr umask 2 , -.Xr unlink 2 , -.Xr sem_getvalue 3 , -.Xr sem_post 3 , -.Xr sem_trywait 3 , -.Xr sem_wait 3 , -.Xr sem 4 -.Sh STANDARDS -The -.Fn sem_open , -.Fn sem_close , -and -.Fn sem_unlink -functions conform to -.St -p1003.1-96 . -.Sh HISTORY -Support for named semaphores first appeared in -.Fx 5.0 . -.Sh BUGS -This implementation places strict requirements on the value of -.Fa name : -it must begin with a slash -.Pq Ql / , -contain no other slash characters, -and be less than 14 characters in length -not including the terminating null character. diff --git a/src/lib/libc/gen/sem_post.3 b/src/lib/libc/gen/sem_post.3 deleted file mode 100644 index 24e04b8..0000000 --- a/src/lib/libc/gen/sem_post.3 +++ /dev/null @@ -1,74 +0,0 @@ -.\" Copyright (C) 2000 Jason Evans . -.\" 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(s), this list of conditions and the following disclaimer as -.\" the first lines of this file unmodified other than the possible -.\" addition of one or more copyright notices. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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: src/lib/libc/gen/sem_post.3,v 1.13 2004/01/14 20:54:16 ru Exp $ -.Dd February 15, 2000 -.Dt SEM_POST 3 -.Os -.Sh NAME -.Nm sem_post -.Nd increment (unlock) a semaphore -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In semaphore.h -.Ft int -.Fn sem_post "sem_t *sem" -.Sh DESCRIPTION -The -.Fn sem_post -function increments (unlocks) the semaphore pointed to by -.Fa sem . -If there are threads blocked on the semaphore when -.Fn sem_post -is called, then the highest priority thread that has been blocked the longest on -the semaphore will be allowed to return from -.Fn sem_wait . -.Pp -The -.Fn sem_post -function is signal-reentrant and may be called within signal handlers. -.Sh RETURN VALUES -.Rv -std sem_post -.Sh ERRORS -The -.Fn sem_post -function will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -.Fa sem -points to an invalid semaphore. -.El -.Sh SEE ALSO -.Xr sem_trywait 3 , -.Xr sem_wait 3 , -.Xr sem 4 -.Sh STANDARDS -The -.Fn sem_post -function conforms to -.St -p1003.1-96 . diff --git a/src/lib/libc/gen/sem_wait.3 b/src/lib/libc/gen/sem_wait.3 deleted file mode 100644 index 81eaf61..0000000 --- a/src/lib/libc/gen/sem_wait.3 +++ /dev/null @@ -1,89 +0,0 @@ -.\" Copyright (C) 2000 Jason Evans . -.\" 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(s), this list of conditions and the following disclaimer as -.\" the first lines of this file unmodified other than the possible -.\" addition of one or more copyright notices. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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: src/lib/libc/gen/sem_wait.3,v 1.11 2004/01/14 20:54:16 ru Exp $ -.Dd February 15, 2000 -.Dt SEM_WAIT 3 -.Os -.Sh NAME -.Nm sem_wait , -.Nm sem_trywait -.Nd decrement (lock) a semaphore -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In semaphore.h -.Ft int -.Fn sem_wait "sem_t *sem" -.Ft int -.Fn sem_trywait "sem_t *sem" -.Sh DESCRIPTION -The -.Fn sem_wait -function decrements (locks) the semaphore pointed to by -.Fa sem , -but blocks if the value of -.Fa sem -is zero, until the value is non-zero and the value can be decremented. -.Pp -The -.Fn sem_trywait -function decrements (locks) the semaphore pointed to by -.Fa sem -only if the value is non-zero. Otherwise, the semaphore is not decremented and -an error is returned. -.Sh RETURN VALUES -.Rv -std -.Sh ERRORS -The -.Fn sem_wait -and -.Fn sem_trywait -functions will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -.Fa sem -points to an invalid semaphore. -.El -.Pp -Additionally, -.Fn sem_trywait -will fail if: -.Bl -tag -width Er -.It Bq Er EAGAIN -The semaphore value was zero, and thus could not be decremented. -.El -.Sh SEE ALSO -.Xr sem_post 3 , -.Xr sem 4 -.Sh STANDARDS -The -.Fn sem_wait -and -.Fn sem_trywait -functions conform to -.St -p1003.1-96 . diff --git a/src/lib/libc/gen/setjmp.3 b/src/lib/libc/gen/setjmp.3 deleted file mode 100644 index 4c89fb7..0000000 --- a/src/lib/libc/gen/setjmp.3 +++ /dev/null @@ -1,176 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" the American National Standards Committee X3, on Information -.\" Processing Systems. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)setjmp.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/setjmp.3,v 1.10 2002/12/18 13:33:02 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt SETJMP 3 -.Os -.Sh NAME -.Nm sigsetjmp , -.Nm siglongjmp , -.Nm setjmp , -.Nm longjmp , -.Nm _setjmp , -.Nm _longjmp , -.Nm longjmperror -.Nd non-local jumps -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In setjmp.h -.Ft int -.Fn sigsetjmp "sigjmp_buf env" "int savemask" -.Ft void -.Fn siglongjmp "sigjmp_buf env" "int val" -.Ft int -.Fn setjmp "jmp_buf env" -.Ft void -.Fn longjmp "jmp_buf env" "int val" -.Ft int -.Fn _setjmp "jmp_buf env" -.Ft void -.Fn _longjmp "jmp_buf env" "int val" -.Ft void -.Fn longjmperror void -.Sh DESCRIPTION -The -.Fn sigsetjmp , -.Fn setjmp , -and -.Fn _setjmp -functions save their calling environment in -.Fa env . -Each of these functions returns 0. -.Pp -The corresponding -.Fn longjmp -functions restore the environment saved by their most recent respective -invocations -of the -.Fn setjmp -function. -They then return so that program execution continues as if the corresponding -invocation of the -.Fn setjmp -call had just returned the value specified by -.Fa val , -instead of 0. -.Pp -Pairs of calls may be intermixed, i.e. both -.Fn sigsetjmp -and -.Fn siglongjmp -and -.Fn setjmp -and -.Fn longjmp -combinations may be used in the same program, however, individual -calls may not, e.g. the -.Fa env -argument to -.Fn setjmp -may not be passed to -.Fn siglongjmp . -.Pp -The -.Fn longjmp -routines may not be called after the routine which called the -.Fn setjmp -routines returns. -.Pp -All accessible objects have values as of the time -.Fn longjmp -routine was called, except that the values of objects of automatic storage -invocation duration that do not have the -.Vt volatile -type and have been changed between the -.Fn setjmp -invocation and -.Fn longjmp -call are indeterminate. -.Pp -The -.Fn setjmp Ns / Ns Fn longjmp -pairs save and restore the signal mask while -.Fn _setjmp Ns / Ns Fn _longjmp -pairs save and restore only the register set and the stack. -(See -.Fn sigprocmask 2 . ) -.Pp -The -.Fn sigsetjmp Ns / Ns Fn siglongjmp -function -pairs save and restore the signal mask if the argument -.Fa savemask -is non-zero, otherwise only the register set and the stack are saved. -.Sh ERRORS -If the contents of the -.Fa env -are corrupted, or correspond to an environment that has already returned, -the -.Fn longjmp -routine calls the routine -.Fn longjmperror 3 . -If -.Fn longjmperror -returns the program is aborted (see -.Xr abort 3 ) . -The default version of -.Fn longjmperror -prints the message -.Dq Li longjmp botch -to standard error and returns. -User programs wishing to exit more gracefully should write their own -versions of -.Fn longjmperror . -.Sh SEE ALSO -.Xr sigaction 2 , -.Xr sigaltstack 2 , -.Xr signal 3 -.Sh STANDARDS -The -.Fn setjmp -and -.Fn longjmp -functions conform to -.St -isoC . -The -.Fn sigsetjmp -and -.Fn siglongjmp -functions conform to -.St -p1003.1-88 . diff --git a/src/lib/libc/gen/setmode.3 b/src/lib/libc/gen/setmode.3 deleted file mode 100644 index ac41f4c..0000000 --- a/src/lib/libc/gen/setmode.3 +++ /dev/null @@ -1,118 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)setmode.3 8.2 (Berkeley) 4/28/95 -.\" $FreeBSD: src/lib/libc/gen/setmode.3,v 1.11 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd April 28, 1995 -.Dt SETMODE 3 -.Os -.Sh NAME -.Nm getmode , -.Nm setmode -.Nd modify mode bits -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft mode_t -.Fn getmode "const void *set" "mode_t mode" -.Ft void * -.Fn setmode "const char *mode_str" -.Sh DESCRIPTION -The -.Fn getmode -function -returns a copy of the file permission bits -.Fa mode -as altered by the values pointed to by -.Fa set . -While only the mode bits are altered, other parts of the file mode -may be examined. -.Pp -The -.Fn setmode -function -takes an absolute (octal) or symbolic value, as described in -.Xr chmod 1 , -as an argument -and returns a pointer to mode values to be supplied to -.Fn getmode . -Because some of the symbolic values are relative to the file -creation mask, -.Fn setmode -may call -.Xr umask 2 . -If this occurs, the file creation mask will be restored before -.Fn setmode -returns. -If the calling program changes the value of its file creation mask -after calling -.Fn setmode , -.Fn setmode -must be called again if -.Fn getmode -is to modify future file modes correctly. -.Pp -If the mode passed to -.Fn setmode -is invalid or if memory cannot be allocated for the return value, -.Fn setmode -returns -.Dv NULL . -.Pp -The value returned from -.Fn setmode -is obtained from -.Fn malloc -and should be returned to the system with -.Fn free -when the program is done with it, generally after a call to -.Fn getmode . -.Sh ERRORS -The -.Fn setmode -function -may fail and set errno for any of the errors specified for the library -routine -.Xr malloc 3 . -.Sh SEE ALSO -.Xr chmod 1 , -.Xr stat 2 , -.Xr umask 2 , -.Xr malloc 3 -.Sh HISTORY -The -.Fn getmode -and -.Fn setmode -functions first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/gen/setproctitle.3 b/src/lib/libc/gen/setproctitle.3 deleted file mode 100644 index d1ebd15..0000000 --- a/src/lib/libc/gen/setproctitle.3 +++ /dev/null @@ -1,118 +0,0 @@ -.\" Copyright (c) 1995 Peter Wemm -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, is permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice immediately at the beginning of the file, without modification, -.\" 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. -.\" 3. This work was done expressly for inclusion into FreeBSD. Other use -.\" is permitted provided this notation is included. -.\" 4. Absolutely no warranty of function or purpose is made by the author -.\" Peter Wemm. -.\" 5. Modifications may be freely made to this file providing the above -.\" conditions are met. -.\" -.\" $FreeBSD: src/lib/libc/gen/setproctitle.3,v 1.24 2002/12/18 10:13:54 ru Exp $ -.\" -.\" The following requests are required for all man pages. -.Dd December 16, 1995 -.Os -.Dt SETPROCTITLE 3 -.Sh NAME -.Nm setproctitle -.Nd set process title -.Sh SYNOPSIS -.In sys/types.h -.In unistd.h -.Ft void -.Fn setproctitle "const char *fmt" "..." -.Sh DESCRIPTION -The -.Fn setproctitle -library routine sets the process title that appears on the -.Xr ps 1 -command. -.Pp -The title is set from the executable's name, followed by the -result of a -.Xr printf 3 -style expansion of the arguments as specified by the -.Va fmt -argument. -If the -.Va fmt -argument begins with a -.Dq - -character, the executable's name is skipped. -.Pp -If -.Va fmt -is NULL, the process title is restored. -.Sh EXAMPLES -To set the title on a daemon to indicate its activity: -.Bd -literal -offset indent -setproctitle("talking to %s", inet_ntoa(addr)); -.Ed -.Sh SEE ALSO -.Xr ps 1 , -.Xr w 1 , -.Xr kvm 3 , -.Xr kvm_getargv 3 , -.Xr printf 3 -.Sh STANDARDS -The -.Fn setproctitle -function -is implicitly non-standard. Other methods of causing the -.Xr ps 1 -command line to change, including copying over the argv[0] string are -also implicitly non-portable. It is preferable to use an operating system -supplied -.Fn setproctitle -if present. -.Pp -Unfortunately, it is possible that there are other calling conventions -to other versions of -.Fn setproctitle , -although none have been found by the author as yet. This is believed to be -the predominant convention. -.Pp -It is thought that the implementation is compatible with other systems, -including -.Nx -and -.Bsx . -.Sh HISTORY -The -.Fn setproctitle -function -first appeared in -.Fx 2.2 . -Other operating systems have -similar functions. -.Sh AUTHORS -.An -nosplit -.An Peter Wemm Aq peter@FreeBSD.org -stole the idea from the -.Sy "Sendmail 8.7.3" -source code by -.An Eric Allman Aq eric@sendmail.org . -.Sh BUGS -Never pass a string with user-supplied data as a format without using -.Ql %s . -An attacker can put format specifiers in the string to mangle your stack, -leading to a possible security hole. -This holds true even if the string was built using a function like -.Fn snprintf , -as the resulting string may still contain user-supplied conversion specifiers -for later interpolation by -.Fn setproctitle . -.Pp -Always use the proper secure idiom: -.Pp -.Dl setproctitle("%s", string); diff --git a/src/lib/libc/gen/shm_open.3 b/src/lib/libc/gen/shm_open.3 deleted file mode 100644 index f325a9d..0000000 --- a/src/lib/libc/gen/shm_open.3 +++ /dev/null @@ -1,193 +0,0 @@ -.\" -.\" Copyright 2000 Massachusetts Institute of Technology -.\" -.\" Permission to use, copy, modify, and distribute this software and -.\" its documentation for any purpose and without fee is hereby -.\" granted, provided that both the above copyright notice and this -.\" permission notice appear in all copies, that both the above -.\" copyright notice and this permission notice appear in all -.\" supporting documentation, and that the name of M.I.T. not be used -.\" in advertising or publicity pertaining to distribution of the -.\" software without specific, written prior permission. M.I.T. makes -.\" no representations about the suitability of this software for any -.\" purpose. It is provided "as is" without express or implied -.\" warranty. -.\" -.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS -.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, -.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT -.\" SHALL M.I.T. 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: src/lib/libc/gen/shm_open.3,v 1.9 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd March 24, 2000 -.Dt SHM_OPEN 3 -.Os -.Sh NAME -.Nm shm_open -.Nd open or create a shared memory object -.Nm shm_unlink -.Nd remove a shared memory object -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In sys/mman.h -.Ft int -.Fn shm_open "const char *path" "int flags" "mode_t mode" -.Ft int -.Fn shm_unlink "const char *path" -.Sh DESCRIPTION -The -.Fn shm_open -function opens (or optionally creates) a -.Tn POSIX -shared memory object named -.Fa path . -The -.Fn shm_unlink -function removes a shared memory object named -.Fa path . -.Pp -In the -.Fx -implementation, -.Tn POSIX -shared memory objects are implemented as ordinary files. -The -.Fn shm_open -and -.Fn shm_unlink -act as wrappers around the -.Xr open 2 -and -.Xr unlink 2 -routines, and -.Fa path , -.Fa flags , -and -.Fa mode -arguments are as specified for those functions. -The -.Fa flags -argument is checked to ensure that the access mode specified is not -.Dv O_WRONLY -(which is not defined for shared memory objects). -.Pp -In addition, the -.Fx -implementation causes -.Fn mmap -of a descriptor returned by -.Fn shm_open -to behave as if the -.Dv MAP_NOSYNC -flag had been specified to -.Xr mmap 2 . -(It does so by setting a special file flag using -.Xr fcntl 2 . ) -.Pp -The -.Fn shm_unlink -function makes no effort to ensure that -.Fa path -refers to a shared memory object. -.Sh COMPATIBILITY -The -.Fa path -argument does not necessarily represent a pathname (although it does in this -and most other implementations). -Two processes opening the same -.Fa path -are guaranteed to access the same shared memory object if and only if -.Fa path -begins with a slash -.Pq Ql \&/ -character. -.Pp -Only the -.Dv O_RDONLY , -.Dv O_RDWR , -.Dv O_CREAT , -.Dv O_EXCL , -and -.Dv O_TRUNC -flags may be used in portable programs. -.Pp -The result of using -.Xr open 2 , -.Xr read 2 , -or -.Xr write 2 -on a shared memory object, or on the descriptor returned by -.Fn shm_open , -is undefined. -It is also undefined whether the shared memory object itself, or its -contents, persist across reboots. -.Sh RETURN VALUES -If successful, -.Fn shm_open -returns a non-negative integer; -.Fn shm_unlink -returns zero. -Both functions return -1 on failure, and set -.Va errno -to indicate the error. -.Sh ERRORS -The -.Fn shm_open -and -.Fn shm_unlink -functions can fail with any error defined for -.Fn open -and -.Fn unlink , -respectively. In addition, the following errors are defined for -.Fn shm_open : -.Bl -tag -width Er -.It Bq Er EINVAL -The object named by -.Fa path -is not a shared memory object -(i.e., it is not a regular file). -.It Bq Er EINVAL -The -.Fa flags -argument to -.Fn shm_open -specifies an access mode of -.Dv O_WRONLY . -.El -.Sh SEE ALSO -.Xr mmap 2 , -.Xr munmap 2 , -.Xr open 2 , -.Xr unlink 2 -.Sh STANDARDS -The -.Fn shm_open -and -.Fn shm_unlink -functions are believed to conform to -.St -p1003.1b-93 . -.Sh HISTORY -The -.Fn shm_open -and -.Fn shm_unlink -functions first appeared in -.Fx 4.3 . -.Sh AUTHORS -.An Garrett A. Wollman Aq wollman@FreeBSD.org -(C library support and this manual page) -.Pp -.An Matthew Dillon Aq dillon@FreeBSD.org -.Pq Dv MAP_NOSYNC diff --git a/src/lib/libc/gen/siginterrupt.3 b/src/lib/libc/gen/siginterrupt.3 deleted file mode 100644 index 34e1a9c..0000000 --- a/src/lib/libc/gen/siginterrupt.3 +++ /dev/null @@ -1,124 +0,0 @@ -.\" Copyright (c) 1985, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)siginterrupt.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/siginterrupt.3,v 1.14 2002/12/19 09:40:21 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt SIGINTERRUPT 3 -.Os -.Sh NAME -.Nm siginterrupt -.Nd allow signals to interrupt system calls -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In signal.h -.Ft int -.Fn siginterrupt "int sig" "int flag" -.Sh DESCRIPTION -The -.Fn siginterrupt -function -is used to change the system call restart -behavior when a system call is interrupted by the specified signal. -If the flag is false (0), then system calls will be restarted if -they are interrupted by the specified signal -and no data has been transferred yet. -System call restart has been the default behavior since -.Bx 4.2 , -and is the default behaviour for -.Xr signal 3 -on -.Fx . -.Pp -If the flag is true (1), -then restarting of system calls is disabled. -If a system call is interrupted by the specified signal -and no data has been transferred, -the system call will return \-1 with the global variable -.Va errno -set to -.Er EINTR . -Interrupted system calls that have started transferring -data will return the amount of data actually transferred. -System call interrupt is the signal behavior found on -.Bx 4.1 -and -.At V -systems. -.Pp -Note that the new -.Bx 4.2 -signal handling semantics are not -altered in any other way. -Most notably, signal handlers always remain installed until -explicitly changed by a subsequent -.Xr sigaction 2 -call, and the signal mask operates as documented in -.Xr sigaction 2 . -Programs may switch between restartable and interruptible -system call operation as often as desired in the execution of a program. -.Pp -Issuing a -.Fn siginterrupt 3 -call during the execution of a signal handler will cause -the new action to take place on the next signal to be caught. -.Sh NOTES -This library routine uses an extension of the -.Xr sigaction 2 -system call that is not available in -.Bx 4.2 , -hence it should not be used if backward compatibility is needed. -.Sh RETURN VALUES -.Rv -std siginterrupt -.Sh ERRORS -The -.Fn siginterrupt -call fails if: -.Bl -tag -width Er -.It Bq Er EINVAL -The -.Fa sig -argument -is not a valid signal number. -.El -.Sh SEE ALSO -.Xr sigaction 2 , -.Xr sigblock 2 , -.Xr sigpause 2 , -.Xr sigsetmask 2 , -.Xr signal 3 -.Sh HISTORY -The -.Fn siginterrupt -function appeared in -.Bx 4.3 . diff --git a/src/lib/libc/gen/signal.3 b/src/lib/libc/gen/signal.3 deleted file mode 100644 index 5192241..0000000 --- a/src/lib/libc/gen/signal.3 +++ /dev/null @@ -1,271 +0,0 @@ -.\" Copyright (c) 1980, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)signal.3 8.3 (Berkeley) 4/19/94 -.\" $FreeBSD: src/lib/libc/gen/signal.3,v 1.36 2004/06/07 11:01:39 yar Exp $ -.\" -.Dd June 7, 2004 -.Dt SIGNAL 3 -.Os -.Sh NAME -.Nm signal -.Nd simplified software signal facilities -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In signal.h -.\" The following is Quite Ugly, but syntactically correct. Don't try to -.\" fix it. -.Ft void \*(lp* -.Fn signal "int sig" "void \*(lp*func\*(rp\*(lpint\*(rp\*(rp\*(rp\*(lpint" -.Pp -or in -.Fx Ns 's -equivalent but easier to read typedef'd version: -.Ft typedef "void \*(lp*sig_t\*(rp \*(lpint\*(rp" ; -.Ft sig_t -.Fn signal "int sig" "sig_t func" -.Sh DESCRIPTION -This -.Fn signal -facility -is a simplified interface to the more general -.Xr sigaction 2 -facility. -.Pp -Signals allow the manipulation of a process from outside its -domain as well as allowing the process to manipulate itself or -copies of itself (children). There are two general types of signals: -those that cause termination of a process and those that do not. -Signals which cause termination of a program might result from -an irrecoverable error or might be the result of a user at a terminal -typing the `interrupt' character. -Signals are used when a process is stopped because it wishes to access -its control terminal while in the background (see -.Xr tty 4 ) . -Signals are optionally generated -when a process resumes after being stopped, -when the status of child processes changes, -or when input is ready at the control terminal. -Most signals result in the termination of the process receiving them -if no action -is taken; some signals instead cause the process receiving them -to be stopped, or are simply discarded if the process has not -requested otherwise. -Except for the -.Dv SIGKILL -and -.Dv SIGSTOP -signals, the -.Fn signal -function allows for a signal to be caught, to be ignored, or to generate -an interrupt. -These signals are defined in the file -.In signal.h : -.Bl -column No ".Dv SIGVTALRM" "create core image" -.It Sy "No Name Default Action Description" -.It 1 Ta Dv SIGHUP Ta "terminate process" Ta "terminal line hangup" -.It 2 Ta Dv SIGINT Ta "terminate process" Ta "interrupt program" -.It 3 Ta Dv SIGQUIT Ta "create core image" Ta "quit program" -.It 4 Ta Dv SIGILL Ta "create core image" Ta "illegal instruction" -.It 5 Ta Dv SIGTRAP Ta "create core image" Ta "trace trap" -.It 6 Ta Dv SIGABRT Ta "create core image" Ta "abort program" -(formerly -.Dv SIGIOT ) -.It 7 Ta Dv SIGEMT Ta "create core image" Ta "emulate instruction executed" -.It 8 Ta Dv SIGFPE Ta "create core image" Ta "floating-point exception" -.It 9 Ta Dv SIGKILL Ta "terminate process" Ta "kill program" -.It 10 Ta Dv SIGBUS Ta "create core image" Ta "bus error" -.It 11 Ta Dv SIGSEGV Ta "create core image" Ta "segmentation violation" -.It 12 Ta Dv SIGSYS Ta "create core image" Ta "non-existent system call invoked" -.It 13 Ta Dv SIGPIPE Ta "terminate process" Ta "write on a pipe with no reader" -.It 14 Ta Dv SIGALRM Ta "terminate process" Ta "real-time timer expired" -.It 15 Ta Dv SIGTERM Ta "terminate process" Ta "software termination signal" -.It 16 Ta Dv SIGURG Ta "discard signal" Ta "urgent condition present on socket" -.It 17 Ta Dv SIGSTOP Ta "stop process" Ta "stop (cannot be caught or ignored)" -.It 18 Ta Dv SIGTSTP Ta "stop process" Ta "stop signal generated from keyboard" -.It 19 Ta Dv SIGCONT Ta "discard signal" Ta "continue after stop" -.It 20 Ta Dv SIGCHLD Ta "discard signal" Ta "child status has changed" -.It 21 Ta Dv SIGTTIN Ta "stop process" Ta "background read attempted from" -control terminal -.It 22 Ta Dv SIGTTOU Ta "stop process" Ta "background write attempted to" -control terminal -.It 23 Ta Dv SIGIO Ta "discard signal" Ta Tn "I/O" -is possible on a descriptor (see -.Xr fcntl 2 ) -.It 24 Ta Dv SIGXCPU Ta "terminate process" Ta "cpu time limit exceeded (see" -.Xr setrlimit 2 ) -.It 25 Ta Dv SIGXFSZ Ta "terminate process" Ta "file size limit exceeded (see" -.Xr setrlimit 2 ) -.It 26 Ta Dv SIGVTALRM Ta "terminate process" Ta "virtual time alarm (see" -.Xr setitimer 2 ) -.It 27 Ta Dv SIGPROF Ta "terminate process" Ta "profiling timer alarm (see" -.Xr setitimer 2 ) -.It 28 Ta Dv SIGWINCH Ta "discard signal" Ta "Window size change" -.It 29 Ta Dv SIGINFO Ta "discard signal" Ta "status request from keyboard" -.It 30 Ta Dv SIGUSR1 Ta "terminate process" Ta "User defined signal 1" -.It 31 Ta Dv SIGUSR2 Ta "terminate process" Ta "User defined signal 2" -.It 32 Ta Dv SIGTHR Ta "terminate process" Ta "thread interrupt" -.El -.Pp -The -.Fa sig -argument specifies which signal was received. -The -.Fa func -procedure allows a user to choose the action upon receipt of a signal. -To set the default action of the signal to occur as listed above, -.Fa func -should be -.Dv SIG_DFL . -A -.Dv SIG_DFL -resets the default action. -To ignore the signal -.Fa func -should be -.Dv SIG_IGN . -This will cause subsequent instances of the signal to be ignored -and pending instances to be discarded. -If -.Dv SIG_IGN -is not used, -further occurrences of the signal are -automatically blocked and -.Fa func -is called. -.Pp -The handled signal is unblocked when the -function returns and -the process continues from where it left off when the signal occurred. -.Bf -symbolic -Unlike previous signal facilities, the handler -func() remains installed after a signal has been delivered. -.Ef -.Pp -For some system calls, if a signal is caught while the call is -executing and the call is prematurely terminated, -the call is automatically restarted. -(The handler is installed using the -.Dv SA_RESTART -flag with -.Xr sigaction 2 . ) -The affected system calls include -.Xr read 2 , -.Xr write 2 , -.Xr sendto 2 , -.Xr recvfrom 2 , -.Xr sendmsg 2 -and -.Xr recvmsg 2 -on a communications channel or a low speed device -and during a -.Xr ioctl 2 -or -.Xr wait 2 . -However, calls that have already committed are not restarted, -but instead return a partial success (for example, a short read count). -These semantics could be changed with -.Xr siginterrupt 3 . -.Pp -When a process which has installed signal handlers forks, -the child process inherits the signals. -All caught signals may be reset to their default action by a call -to the -.Xr execve 2 -function; -ignored signals remain ignored. -.Pp -If a process explicitly specifies -.Dv SIG_IGN -as the action for the signal -.Dv SIGCHLD , -the system will not create zombie processes when children -of the calling process exit. -As a consequence, the system will discard the exit status -from the child processes. -If the calling process subsequently issues a call to -.Xr wait 2 -or equivalent, it will block until all of the calling process's -children terminate, and then return a value of \-1 with -.Va errno -set to -.Er ECHILD . -.Pp -See -.Xr sigaction 2 -for a list of functions -that are considered safe for use in signal handlers. -.Sh RETURN VALUES -The previous action is returned on a successful call. -Otherwise, SIG_ERR is returned and the global variable -.Va errno -is set to indicate the error. -.Sh ERRORS -The -.Fn signal -function -will fail and no action will take place if one of the -following occur: -.Bl -tag -width Er -.It Bq Er EINVAL -The -.Fa sig -argument -is not a valid signal number. -.It Bq Er EINVAL -An attempt is made to ignore or supply a handler for -.Dv SIGKILL -or -.Ev SIGSTOP . -.El -.Sh SEE ALSO -.Xr kill 1 , -.Xr kill 2 , -.Xr ptrace 2 , -.Xr sigaction 2 , -.Xr sigaltstack 2 , -.Xr sigprocmask 2 , -.Xr sigsuspend 2 , -.Xr wait 2 , -.Xr fpsetmask 3 , -.Xr setjmp 3 , -.Xr siginterrupt 3 , -.Xr tty 4 -.Sh HISTORY -This -.Fn signal -facility appeared in -.Bx 4.0 . -The option to avoid the creation of child zombies through ignoring -.Dv SIGCHLD -appeared in -.Fx 5.0 . diff --git a/src/lib/libc/gen/signbit.3 b/src/lib/libc/gen/signbit.3 deleted file mode 100644 index 42d810d..0000000 --- a/src/lib/libc/gen/signbit.3 +++ /dev/null @@ -1,57 +0,0 @@ -.\" Copyright (c) 2003 Mike Barcroft -.\" 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: src/lib/libc/gen/signbit.3,v 1.3 2003/02/24 22:53:20 ru Exp $ -.\" -.Dd February 11, 2003 -.Dt SIGNBIT 3 -.Os -.Sh NAME -.Nm signbit -.Nd "determine whether a floating-point number's sign is negative" -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In math.h -.Ft int -.Fn signbit "real-floating x" -.Sh DESCRIPTION -The -.Fn signbit -macro takes an argument of -.Fa x -and returns non-zero if the value of its sign is negative, otherwise 0. -.Sh SEE ALSO -.Xr fpclassify 3 , -.Xr math 3 -.Sh STANDARDS -The -.Fn signbit -macro conforms to -.St -isoC-99 . -.Sh HISTORY -The -.Fn signbit -macro was added in -.Fx 5.1 . diff --git a/src/lib/libc/gen/sigsetops.3 b/src/lib/libc/gen/sigsetops.3 deleted file mode 100644 index 40caa53..0000000 --- a/src/lib/libc/gen/sigsetops.3 +++ /dev/null @@ -1,118 +0,0 @@ -.\" Copyright (c) 1983, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)sigsetops.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/sigsetops.3,v 1.8 2003/06/24 15:27:31 yar Exp $ -.\" -.Dd June 4, 1993 -.Dt SIGSETOPS 3 -.Os -.Sh NAME -.Nm sigemptyset , -.Nm sigfillset , -.Nm sigaddset , -.Nm sigdelset , -.Nm sigismember -.Nd manipulate signal sets -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In signal.h -.Ft int -.Fn sigemptyset "sigset_t *set" -.Ft int -.Fn sigfillset "sigset_t *set" -.Ft int -.Fn sigaddset "sigset_t *set" "int signo" -.Ft int -.Fn sigdelset "sigset_t *set" "int signo" -.Ft int -.Fn sigismember "const sigset_t *set" "int signo" -.Sh DESCRIPTION -These functions manipulate signal sets stored in a -.Fa sigset_t . -Either -.Fn sigemptyset -or -.Fn sigfillset -must be called for every object of type -.Fa sigset_t -before any other use of the object. -.Pp -The -.Fn sigemptyset -function initializes a signal set to be empty. -.Pp -The -.Fn sigfillset -function initializes a signal set to contain all signals. -.Pp -The -.Fn sigaddset -function adds the specified signal -.Fa signo -to the signal set. -.Pp -The -.Fn sigdelset -function deletes the specified signal -.Fa signo -from the signal set. -.Pp -The -.Fn sigismember -function returns whether a specified signal -.Fa signo -is contained in the signal set. -.Pp -These functions -are provided as macros in the include file . -Actual functions are available -if their names are undefined (with -.Ic #undef Ar name ) . -.Sh RETURN VALUES -The -.Fn sigismember -function returns 1 -if the signal is a member of the set, -0 otherwise. -The other functions return 0. -.Sh ERRORS -Currently no errors are detected. -.Sh SEE ALSO -.Xr kill 2 , -.Xr sigaction 2 , -.Xr sigpending 2 , -.Xr sigprocmask 2 , -.Xr sigsuspend 2 -.Sh STANDARDS -These functions are defined by -.St -p1003.1-88 . diff --git a/src/lib/libc/gen/sleep.3 b/src/lib/libc/gen/sleep.3 deleted file mode 100644 index ba5985f..0000000 --- a/src/lib/libc/gen/sleep.3 +++ /dev/null @@ -1,86 +0,0 @@ -.\" Copyright (c) 1986, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)sleep.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/sleep.3,v 1.15 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd February 13, 1998 -.Dt SLEEP 3 -.Os -.Sh NAME -.Nm sleep -.Nd suspend process execution for an interval measured in seconds -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft unsigned int -.Fn sleep "unsigned int seconds" -.Sh DESCRIPTION -The -.Fn sleep -function suspends execution of the calling process until either -.Fa seconds -seconds have elapsed or a signal is delivered to the process and its -action is to invoke a signal-catching function or to terminate the -process. -System activity may lengthen the sleep by an indeterminate amount. -.Pp -This function is implemented using -.Xr nanosleep 2 -by pausing for -.Fa seconds -seconds or until a signal occurs. -Consequently, in this implementation, -sleeping has no effect on the state of process timers, -and there is no special handling for SIGALRM. -.Sh RETURN VALUES -If the -.Fn sleep -function returns because the requested time has elapsed, the value -returned will be zero. If the -.Fn sleep -function returns due to the delivery of a signal, the value returned -will be the unslept amount (the requested time minus the time actually -slept) in seconds. -.Sh SEE ALSO -.Xr nanosleep 2 , -.Xr usleep 3 -.Sh STANDARDS -The -.Fn sleep -function conforms to -.St -p1003.1-90 . -.Sh HISTORY -A -.Fn sleep -function appeared in -.At v7 . diff --git a/src/lib/libc/gen/statvfs.3 b/src/lib/libc/gen/statvfs.3 deleted file mode 100644 index 82e4d0f..0000000 --- a/src/lib/libc/gen/statvfs.3 +++ /dev/null @@ -1,187 +0,0 @@ -.\" -.\" Copyright 2002 Massachusetts Institute of Technology -.\" -.\" Permission to use, copy, modify, and distribute this software and -.\" its documentation for any purpose and without fee is hereby -.\" granted, provided that both the above copyright notice and this -.\" permission notice appear in all copies, that both the above -.\" copyright notice and this permission notice appear in all -.\" supporting documentation, and that the name of M.I.T. not be used -.\" in advertising or publicity pertaining to distribution of the -.\" software without specific, written prior permission. M.I.T. makes -.\" no representations about the suitability of this software for any -.\" purpose. It is provided "as is" without express or implied -.\" warranty. -.\" -.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS -.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, -.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT -.\" SHALL M.I.T. 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: src/lib/libc/gen/statvfs.3,v 1.7 2003/06/08 10:01:51 charnier Exp $ -.\" -.Dd July 13, 2002 -.Dt STATVFS 3 -.Os -.Sh NAME -.Nm statvfs , -.Nm fstatvfs -.Nd retrieve file system information -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/statvfs.h -.Ft int -.Fn statvfs "const char * restrict path" "struct statvfs * restrict buf" -.Ft int -.Fn fstatvfs "int fd" "struct statvfs *buf" -.Sh DESCRIPTION -The -.Fn statvfs -and -.Fn fstatvfs -functions fill the structure pointed to by -.Fa buf -with garbage. -This garbage will occasionally bear resemblance to file system -statistics, but portable applications must not depend on this. -Applications must pass a pathname or file descriptor which refers to a -file on the file system in which they are interested. -.Pp -The -.Vt statvfs -structure contains the following members: -.Bl -tag -offset indent -width ".Va f_namemax" -.It Va f_namemax -The maximum length in bytes of a file name on this file system. -Applications should use -.Xr pathconf 2 -instead. -.It Va f_fsid -Not meaningful in this implementation. -.It Va f_frsize -The size in bytes of the minimum unit of allocation on this -file system. -(This corresponds to the -.Va f_bsize -member of -.Vt "struct statfs" . ) -.It Va f_bsize -The preferred length of I/O requests for files on this file system. -(Corresponds to the -.Va f_iosize -member of -.Vt "struct statfs" . ) -.It Va f_flag -Flags describing mount options for this file system; see below. -.El -.Pp -In addition, there are three members of type -.Vt fsfilcnt_t , -which represent counts of file serial numbers -.Em ( i.e. , -inodes); these are named -.Va f_files , f_favail , -and -.Va f_ffree , -and represent the number of file serial numbers which exist in total, -are available to unprivileged processes, and are available to -privileged processes, respectively. -Likewise, the members -.Va f_blocks , f_bavail , -and -.Va f_bfree -(all of type -.Vt fsblkcnt_t ) -represent the respective allocation-block counts. -.Pp -There are two flags defined for the -.Va f_flag -member: -.Bl -tag -offset indent -width ".Dv ST_NOSUID" -.It Dv ST_RDONLY -The file system is mounted read-only. -.It Dv ST_NOSUID -The semantics of the -.Dv S_ISUID -and -.Dv S_ISGID -file mode bits -are not supported by, or are disabled on, this file system. -.El -.Sh IMPLEMENTATION NOTES -The -.Fn statvfs -and -.Fn fstatvfs -functions are implemented as wrappers around the -.Fn statfs -and -.Fn fstatfs -functions, respectively. -Not all the information provided by those functions is made available -through this interface. -.Sh RETURN VALUES -.Rv -std statvfs fstatvfs -.Sh ERRORS -The -.Fn statvfs -and -.Fn fstatvfs -functions may fail for any of the reasons documented for -.Xr statfs 2 -or -.Xr fstatfs 2 -and -.Xr pathconf 2 -or -.Xr fpathconf 2 , -respectively. -In addition, -.Fn statvfs -and -.Fn fstatvfs -functions may also fail for the following reason: -.Bl -tag -width Er -.It Bq Er EOVERFLOW -One or more of the file system statistics has a value which cannot be -represented by the data types used in -.Vt "struct statvfs" . -.El -.Sh SEE ALSO -.Xr pathconf 2 , -.Xr statfs 2 -.Sh STANDARDS -The -.Fn statvfs -and -.Fn fstatvfs -functions conform to -.St -p1003.1-2001 . -As standardized, portable applications cannot depend on these functions -returning any valid information at all. -This implementation attempts to provide as much useful information as -is provided by the underlying file system, subject to the limitations -of the specified data types. -.Sh HISTORY -The -.Fn statvfs -and -.Fn fstatvfs -functions first appeared in -.Fx 5.0 . -.Sh AUTHORS -The -.Fn statvfs -and -.Fn fstatvfs -functions and this manual page were written by -.An Garrett Wollman Aq wollman@FreeBSD.org . diff --git a/src/lib/libc/gen/stringlist.3 b/src/lib/libc/gen/stringlist.3 deleted file mode 100644 index f28dd5a..0000000 --- a/src/lib/libc/gen/stringlist.3 +++ /dev/null @@ -1,135 +0,0 @@ -.\" $NetBSD: stringlist.3,v 1.5 1999/03/22 19:44:46 garbled Exp $ -.\" -.\" Copyright (c) 1997, 1999 The NetBSD Foundation, Inc. -.\" All rights reserved. -.\" -.\" This file was contributed to The NetBSD Foundation by Luke Mewburn. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 REGENTS 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: src/lib/libc/gen/stringlist.3,v 1.10 2003/02/23 01:47:47 ru Exp $ -.\" -.Dd November 28, 1999 -.Os -.Dt STRINGLIST 3 -.Sh NAME -.Nm stringlist , -.Nm sl_init , -.Nm sl_add , -.Nm sl_free , -.Nm sl_find -.Nd stringlist manipulation functions -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In stringlist.h -.Ft StringList * -.Fn sl_init -.Ft int -.Fn sl_add "StringList *sl" "char *item" -.Ft void -.Fn sl_free "StringList *sl" "int freeall" -.Ft char * -.Fn sl_find "StringList *sl" "char *item" -.Sh DESCRIPTION -The -.Nm -functions manipulate stringlists, which are lists of -strings that extend automatically if necessary. -.Pp -The -.Vt StringList -structure has the following definition: -.Bd -literal -offset indent -typedef struct _stringlist { - char **sl_str; - size_t sl_max; - size_t sl_cur; -} StringList; -.Ed -.Pp -.Bl -tag -width "sl_str" -offset indent -.It Va sl_str -a pointer to the base of the array containing the list. -.It Va sl_max -the size of -.Va sl_str . -.It Va sl_cur -the offset in -.Va sl_str -of the current element. -.El -.Pp -The following stringlist manipulation functions are available: -.Bl -tag -width "sl_init()" -.It Fn sl_init -Create a stringlist. -Returns a pointer to a -.Vt StringList , -or -.Dv NULL -in case of failure. -.It Fn sl_free -Releases memory occupied by -.Fa sl -and the -.Fa sl->sl_str -array. -If -.Fa freeall -is non-zero, then each of the items within -.Fa sl->sl_str -is released as well. -.It Fn sl_add -Add -.Fa item -to -.Fa sl->sl_str -at -.Fa sl->sl_cur , -extending the size of -.Fa sl->sl_str . -Returns zero upon success, \-1 upon failure. -.It Fn sl_find -Find -.Fa item -in -.Fa sl , -returning NULL if it's not found. -.El -.Sh SEE ALSO -.Xr free 3 , -.Xr malloc 3 -.Sh HISTORY -The -.Nm -functions appeared in -.Fx 2.2.6 -and -.Nx 1.3 . diff --git a/src/lib/libc/gen/strtofflags.3 b/src/lib/libc/gen/strtofflags.3 deleted file mode 100644 index 355e81a..0000000 --- a/src/lib/libc/gen/strtofflags.3 +++ /dev/null @@ -1,99 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)setmode.3 8.2 (Berkeley) 4/28/95 -.\" $FreeBSD: src/lib/libc/gen/strtofflags.3,v 1.7 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd January 1, 2000 -.Dt STRTOFFLAGS 3 -.Os -.Sh NAME -.Nm fflagstostr , -.Nm strtofflags -.Nd convert between file flag bits and their string names -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft char * -.Fn fflagstostr "u_long flags" -.Ft int -.Fn strtofflags "char **stringp" "u_long *setp" "u_long *clrp" -.Sh DESCRIPTION -The -.Fn fflagstostr -function returns a comma separated string of the file flags represented by -.Fa flags . -If no flags are set a zero length string is returned. -.Pp -If memory cannot be allocated for the return value, -.Fn fflagstostr -returns -.Dv NULL . -.Pp -The value returned from -.Fn fflagstostr -is obtained from -.Fn malloc -and should be returned to the system with -.Fn free -when the program is done with it. -.Pp -The -.Fn strtofflags -function takes a string of file flags, as described in -.Xr chflags 1 , -parses it, and returns the 'set' flags and 'clear' flags -such as would be given as arguments to -.Xr chflags 2 . -On success -.Fn strtofflags -returns 0, otherwise it returns non-zero and -.Fa stringp -is left pointing to the offending token. -.Sh ERRORS -The -.Fn fflagstostr -function -may fail and set errno for any of the errors specified for the library -routine -.Xr malloc 3 . -.Sh SEE ALSO -.Xr chflags 1 , -.Xr chflags 2 , -.Xr malloc 3 -.Sh HISTORY -The -.Fn fflagstostr -and -.Fn strtofflags -functions first appeared in -.Fx 4.0 . diff --git a/src/lib/libc/gen/sysconf.3 b/src/lib/libc/gen/sysconf.3 deleted file mode 100644 index 815e2a7..0000000 --- a/src/lib/libc/gen/sysconf.3 +++ /dev/null @@ -1,212 +0,0 @@ -.\" Copyright (c) 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)sysconf.3 8.3 (Berkeley) 4/19/94 -.\" $FreeBSD: src/lib/libc/gen/sysconf.3,v 1.20 2003/12/23 18:42:55 trhodes Exp $ -.\" -.Dd June 18, 2001 -.Dt SYSCONF 3 -.Os -.Sh NAME -.Nm sysconf -.Nd get configurable system variables -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft long -.Fn sysconf "int name" -.Sh DESCRIPTION -This interface is defined by -.St -p1003.1-88 . -A far more complete interface is available using -.Xr sysctl 3 . -.Pp -The -.Fn sysconf -function provides a method for applications to determine the current -value of a configurable system limit or option variable. -The -.Fa name -argument specifies the system variable to be queried. -Symbolic constants for each name value are found in the include file -.In unistd.h . -Shell programmers who need access to these parameters should use the -.Xr getconf 1 -utility. -.Pp -The available values are as follows: -.Pp -.Bl -tag -width 6n -.Pp -.It Li _SC_ARG_MAX -The maximum bytes of argument to -.Xr execve 2 . -.It Li _SC_CHILD_MAX -The maximum number of simultaneous processes per user id. -.It Li _SC_CLK_TCK -The frequency of the statistics clock in ticks per second. -.It Li _SC_IOV_MAX -The maximum number of elements in the I/O vector used by -.Xr readv 2 , -.Xr writev 2 , -.Xr recvmsg 2 , -and -.Xr sendmsg 2 . -.It Li _SC_NGROUPS_MAX -The maximum number of supplemental groups. -.It Li _SC_NPROCESSORS_CONF -The number of processors configured. -.It Li _SC_NPROCESSORS_ONLN -The number of processors currently online. -.It Li _SC_OPEN_MAX -The maximum number of open files per user id. -.It Li _SC_STREAM_MAX -The minimum maximum number of streams that a process may have open -at any one time. -.It Li _SC_TZNAME_MAX -The minimum maximum number of types supported for the name of a -timezone. -.It Li _SC_JOB_CONTROL -Return 1 if job control is available on this system, otherwise \-1. -.It Li _SC_SAVED_IDS -Returns 1 if saved set-group and saved set-user ID is available, -otherwise \-1. -.It Li _SC_VERSION -The version of -.St -p1003.1 -with which the system -attempts to comply. -.It Li _SC_BC_BASE_MAX -The maximum ibase/obase values in the -.Xr bc 1 -utility. -.It Li _SC_BC_DIM_MAX -The maximum array size in the -.Xr bc 1 -utility. -.It Li _SC_BC_SCALE_MAX -The maximum scale value in the -.Xr bc 1 -utility. -.It Li _SC_BC_STRING_MAX -The maximum string length in the -.Xr bc 1 -utility. -.It Li _SC_COLL_WEIGHTS_MAX -The maximum number of weights that can be assigned to any entry of -the LC_COLLATE order keyword in the locale definition file. -.It Li _SC_EXPR_NEST_MAX -The maximum number of expressions that can be nested within -parenthesis by the -.Xr expr 1 -utility. -.It Li _SC_LINE_MAX -The maximum length in bytes of a text-processing utility's input -line. -.It Li _SC_RE_DUP_MAX -The maximum number of repeated occurrences of a regular expression -permitted when using interval notation. -.It Li _SC_2_VERSION -The version of -.St -p1003.2 -with which the system attempts to comply. -.It Li _SC_2_C_BIND -Return 1 if the system's C-language development facilities support the -C-Language Bindings Option, otherwise \-1. -.It Li _SC_2_C_DEV -Return 1 if the system supports the C-Language Development Utilities Option, -otherwise \-1. -.It Li _SC_2_CHAR_TERM -Return 1 if the system supports at least one terminal type capable of -all operations described in -.St -p1003.2 , -otherwise \-1. -.It Li _SC_2_FORT_DEV -Return 1 if the system supports the FORTRAN Development Utilities Option, -otherwise \-1. -.It Li _SC_2_FORT_RUN -Return 1 if the system supports the FORTRAN Runtime Utilities Option, -otherwise \-1. -.It Li _SC_2_LOCALEDEF -Return 1 if the system supports the creation of locales, otherwise \-1. -.It Li _SC_2_SW_DEV -Return 1 if the system supports the Software Development Utilities Option, -otherwise \-1. -.It Li _SC_2_UPE -Return 1 if the system supports the User Portability Utilities Option, -otherwise \-1. -.El -.Sh RETURN VALUES -If the call to -.Fn sysconf -is not successful, \-1 is returned and -.Va errno -is set appropriately. -Otherwise, if the variable is associated with functionality that is not -supported, \-1 is returned and -.Va errno -is not modified. -Otherwise, the current variable value is returned. -.Sh ERRORS -The -.Fn sysconf -function may fail and set -.Va errno -for any of the errors specified for the library function -.Xr sysctl 3 . -In addition, the following error may be reported: -.Bl -tag -width Er -.It Bq Er EINVAL -The value of the -.Fa name -argument is invalid. -.El -.Sh SEE ALSO -.Xr getconf 1 , -.Xr pathconf 2 , -.Xr confstr 3 , -.Xr sysctl 3 -.Sh BUGS -The value for _SC_STREAM_MAX is a minimum maximum, and required to be -the same as ANSI C's FOPEN_MAX, so the returned value is a ridiculously -small and misleading number. -.Sh STANDARDS -Except for the fact that values returned by -.Fn sysconf -may change over the lifetime of the calling process, -this function conforms to -.St -p1003.1-88 . -.Sh HISTORY -The -.Fn sysconf -function first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/gen/sysctl.3 b/src/lib/libc/gen/sysctl.3 deleted file mode 100644 index 985cf00..0000000 --- a/src/lib/libc/gen/sysctl.3 +++ /dev/null @@ -1,863 +0,0 @@ -.\" Copyright (c) 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 -.\" $FreeBSD: src/lib/libc/gen/sysctl.3,v 1.62 2004/03/25 10:08:46 bms Exp $ -.\" -.Dd January 23, 2001 -.Dt SYSCTL 3 -.Os -.Sh NAME -.Nm sysctl , -.Nm sysctlbyname , -.Nm sysctlnametomib -.Nd get or set system information -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In sys/sysctl.h -.Ft int -.Fn sysctl "int *name" "u_int namelen" "void *oldp" "size_t *oldlenp" "void *newp" "size_t newlen" -.Ft int -.Fn sysctlbyname "const char *name" "void *oldp" "size_t *oldlenp" "void *newp" "size_t newlen" -.Ft int -.Fn sysctlnametomib "const char *name" "int *mibp" "size_t *sizep" -.Sh DESCRIPTION -The -.Fn sysctl -function retrieves system information and allows processes with -appropriate privileges to set system information. -The information available from -.Fn sysctl -consists of integers, strings, and tables. -Information may be retrieved and set from the command interface -using the -.Xr sysctl 8 -utility. -.Pp -Unless explicitly noted below, -.Fn sysctl -returns a consistent snapshot of the data requested. -Consistency is obtained by locking the destination -buffer into memory so that the data may be copied out without blocking. -Calls to -.Fn sysctl -are serialized to avoid deadlock. -.Pp -The state is described using a ``Management Information Base'' (MIB) -style name, listed in -.Fa name , -which is a -.Fa namelen -length array of integers. -.Pp -The -.Fn sysctlbyname -function accepts an ASCII representation of the name and internally -looks up the integer name vector. Apart from that, it behaves the same -as the standard -.Fn sysctl -function. -.Pp -The information is copied into the buffer specified by -.Fa oldp . -The size of the buffer is given by the location specified by -.Fa oldlenp -before the call, -and that location gives the amount of data copied after a successful call -and after a call that returns with the error code -.Er ENOMEM . -If the amount of data available is greater -than the size of the buffer supplied, -the call supplies as much data as fits in the buffer provided -and returns with the error code -.Er ENOMEM . -If the old value is not desired, -.Fa oldp -and -.Fa oldlenp -should be set to NULL. -.Pp -The size of the available data can be determined by calling -.Fn sysctl -with the -.Dv NULL -argument for -.Fa oldp . -The size of the available data will be returned in the location pointed to by -.Fa oldlenp . -For some operations, the amount of space may change often. -For these operations, -the system attempts to round up so that the returned size is -large enough for a call to return the data shortly thereafter. -.Pp -To set a new value, -.Fa newp -is set to point to a buffer of length -.Fa newlen -from which the requested value is to be taken. -If a new value is not to be set, -.Fa newp -should be set to NULL and -.Fa newlen -set to 0. -.Pp -The -.Fn sysctlnametomib -function accepts an ASCII representation of the name, -looks up the integer name vector, -and returns the numeric representation in the mib array pointed to by -.Fa mibp . -The number of elements in the mib array is given by the location specified by -.Fa sizep -before the call, -and that location gives the number of entries copied after a successful call. -The resulting -.Fa mib -and -.Fa size -may be used in subsequent -.Fn sysctl -calls to get the data associated with the requested ASCII name. -This interface is intended for use by applications that want to -repeatedly request the same variable (the -.Fn sysctl -function runs in about a third the time as the same request made via the -.Fn sysctlbyname -function). -The -.Fn sysctlnametomib -function is also useful for fetching mib prefixes and then adding -a final component. -For example, to fetch process information -for processes with pid's less than 100: -.Pp -.Bd -literal -offset indent -compact -int i, mib[4]; -size_t len; -struct kinfo_proc kp; - -/* Fill out the first three components of the mib */ -len = 4; -sysctlnametomib("kern.proc.pid", mib, &len); - -/* Fetch and print entries for pid's < 100 */ -for (i = 0; i < 100; i++) { - mib[3] = i; - len = sizeof(kp); - if (sysctl(mib, 4, &kp, &len, NULL, 0) == -1) - perror("sysctl"); - else if (len > 0) - printkproc(&kp); -} -.Ed -.Pp -The top level names are defined with a CTL_ prefix in -.In sys/sysctl.h , -and are as follows. -The next and subsequent levels down are found in the include files -listed here, and described in separate sections below. -.Pp -.Bl -column CTLXMACHDEPXXX "Next level namesXXXXXX" -offset indent -.It Sy "Name Next level names Description" -.It "CTL_DEBUG sys/sysctl.h Debugging" -.It "CTL_VFS sys/mount.h File system" -.It "CTL_HW sys/sysctl.h Generic CPU, I/O" -.It "CTL_KERN sys/sysctl.h High kernel limits" -.It "CTL_MACHDEP sys/sysctl.h Machine dependent" -.It "CTL_NET sys/socket.h Networking" -.It "CTL_USER sys/sysctl.h User-level" -.It "CTL_VM vm/vm_param.h Virtual memory" -.El -.Pp -For example, the following retrieves the maximum number of processes allowed -in the system: -.Pp -.Bd -literal -offset indent -compact -int mib[2], maxproc; -size_t len; - -mib[0] = CTL_KERN; -mib[1] = KERN_MAXPROC; -len = sizeof(maxproc); -sysctl(mib, 2, &maxproc, &len, NULL, 0); -.Ed -.Pp -To retrieve the standard search path for the system utilities: -.Pp -.Bd -literal -offset indent -compact -int mib[2]; -size_t len; -char *p; - -mib[0] = CTL_USER; -mib[1] = USER_CS_PATH; -sysctl(mib, 2, NULL, &len, NULL, 0); -p = malloc(len); -sysctl(mib, 2, p, &len, NULL, 0); -.Ed -.Ss CTL_DEBUG -The debugging variables vary from system to system. -A debugging variable may be added or deleted without need to recompile -.Fn sysctl -to know about it. -Each time it runs, -.Fn sysctl -gets the list of debugging variables from the kernel and -displays their current values. -The system defines twenty -.Pq Vt "struct ctldebug" -variables named -.Va debug0 -through -.Va debug19 . -They are declared as separate variables so that they can be -individually initialized at the location of their associated variable. -The loader prevents multiple use of the same variable by issuing errors -if a variable is initialized in more than one place. -For example, to export the variable -.Va dospecialcheck -as a debugging variable, the following declaration would be used: -.Pp -.Bd -literal -offset indent -compact -int dospecialcheck = 1; -struct ctldebug debug5 = { "dospecialcheck", &dospecialcheck }; -.Ed -.Ss CTL_VFS -A distinguished second level name, VFS_GENERIC, -is used to get general information about all file systems. -One of its third level identifiers is VFS_MAXTYPENUM -that gives the highest valid file system type number. -Its other third level identifier is VFS_CONF that -returns configuration information about the file system -type given as a fourth level identifier (see -.Xr getvfsbyname 3 -as an example of its use). -The remaining second level identifiers are the -file system type number returned by a -.Xr statfs 2 -call or from VFS_CONF. -The third level identifiers available for each file system -are given in the header file that defines the mount -argument structure for that file system. -.Ss CTL_HW -The string and integer information available for the CTL_HW level -is detailed below. -The changeable column shows whether a process with appropriate -privilege may change the value. -.Bl -column "Second level nameXXXXXX" integerXXX -offset indent -.It Sy "Second level name Type Changeable" -.It "HW_MACHINE string no" -.It "HW_MODEL string no" -.It "HW_NCPU integer no" -.It "HW_BYTEORDER integer no" -.It "HW_PHYSMEM integer no" -.It "HW_USERMEM integer no" -.It "HW_PAGESIZE integer no" -.It "HW_FLOATINGPOINT integer no" -.It "HW_MACHINE_ARCH string no" -.\".It "HW_DISKNAMES integer no" -.\".It "HW_DISKSTATS integer no" -.El -.Pp -.Bl -tag -width 6n -.It Li HW_MACHINE -The machine class. -.It Li HW_MODEL -The machine model -.It Li HW_NCPU -The number of cpus. -.It Li HW_BYTEORDER -The byteorder (4,321, or 1,234). -.It Li HW_PHYSMEM -The bytes of physical memory. -.It Li HW_USERMEM -The bytes of non-kernel memory. -.It Li HW_PAGESIZE -The software page size. -.It Li HW_FLOATINGPOINT -Nonzero if the floating point support is in hardware. -.It Li HW_MACHINE_ARCH -The machine dependent architecture type. -.\".It Fa HW_DISKNAMES -.\".It Fa HW_DISKSTATS -.El -.Ss CTL_KERN -The string and integer information available for the CTL_KERN level -is detailed below. -The changeable column shows whether a process with appropriate -privilege may change the value. -The types of data currently available are process information, -system vnodes, the open file entries, routing table entries, -virtual memory statistics, load average history, and clock rate -information. -.Bl -column "KERNXMAXFILESPERPROCXXX" "struct clockrateXXX" -offset indent -.It Sy "Second level name Type Changeable" -.It "KERN_ARGMAX integer no" -.It "KERN_BOOTFILE string yes" -.It "KERN_BOOTTIME struct timeval no" -.It "KERN_CLOCKRATE struct clockinfo no" -.It "KERN_FILE struct file no" -.It "KERN_HOSTID integer yes" -.It "KERN_HOSTNAME string yes" -.It "KERN_JOB_CONTROL integer no" -.It "KERN_MAXFILES integer yes" -.It "KERN_MAXFILESPERPROC integer yes" -.It "KERN_MAXPROC integer no" -.It "KERN_MAXPROCPERUID integer yes" -.It "KERN_MAXVNODES integer yes" -.It "KERN_NGROUPS integer no" -.It "KERN_NISDOMAINNAME string yes" -.It "KERN_OSRELDATE integer no" -.It "KERN_OSRELEASE string no" -.It "KERN_OSREV integer no" -.It "KERN_OSTYPE string no" -.It "KERN_POSIX1 integer no" -.It "KERN_PROC struct proc no" -.It "KERN_PROF node not applicable" -.It "KERN_QUANTUM integer yes" -.It "KERN_SAVED_IDS integer no" -.It "KERN_SECURELVL integer raise only" -.It "KERN_UPDATEINTERVAL integer no" -.It "KERN_VERSION string no" -.It "KERN_VNODE struct vnode no" -.El -.Pp -.Bl -tag -width 6n -.It Li KERN_ARGMAX -The maximum bytes of argument to -.Xr execve 2 . -.It Li KERN_BOOTFILE -The full pathname of the file from which the kernel was loaded. -.It Li KERN_BOOTTIME -A -.Va struct timeval -structure is returned. -This structure contains the time that the system was booted. -.It Li KERN_CLOCKRATE -A -.Va struct clockinfo -structure is returned. -This structure contains the clock, statistics clock and profiling clock -frequencies, the number of micro-seconds per hz tick and the skew rate. -.It Li KERN_FILE -Return the entire file table. -The returned data consists of a single -.Va struct filehead -followed by an array of -.Va struct file , -whose size depends on the current number of such objects in the system. -.It Li KERN_HOSTID -Get or set the host id. -.It Li KERN_HOSTNAME -Get or set the hostname. -.It Li KERN_JOB_CONTROL -Return 1 if job control is available on this system, otherwise 0. -.It Li KERN_MAXFILES -The maximum number of files that may be open in the system. -.It Li KERN_MAXFILESPERPROC -The maximum number of files that may be open for a single process. -This limit only applies to processes with an effective uid of nonzero -at the time of the open request. -Files that have already been opened are not affected if the limit -or the effective uid is changed. -.It Li KERN_MAXPROC -The maximum number of concurrent processes the system will allow. -.It Li KERN_MAXPROCPERUID -The maximum number of concurrent processes the system will allow -for a single effective uid. -This limit only applies to processes with an effective uid of nonzero -at the time of a fork request. -Processes that have already been started are not affected if the limit -is changed. -.It Li KERN_MAXVNODES -The maximum number of vnodes available on the system. -.It Li KERN_NGROUPS -The maximum number of supplemental groups. -.It Li KERN_NISDOMAINNAME -The name of the current YP/NIS domain. -.It Li KERN_OSRELDATE -The kernel release version in the format -.Ar M Ns Ar mm Ns Ar R Ns Ar xx , -where -.Ar M -is the major version, -.Ar mm -is the two digit minor version, -.Ar R -is 0 if release branch, otherwise 1, -and -.Ar xx -is updated when the available APIs change. -.Pp -The userland release version is available from -.In osreldate.h ; -parse this file if you need to get the release version of -the currently installed userland. -.It Li KERN_OSRELEASE -The system release string. -.It Li KERN_OSREV -The system revision string. -.It Li KERN_OSTYPE -The system type string. -.It Li KERN_POSIX1 -The version of -.St -p1003.1 -with which the system -attempts to comply. -.It Li KERN_PROC -Return the entire process table, or a subset of it. -An array of pairs of -.Va struct proc -followed by corresponding -.Va struct eproc -structures is returned, -whose size depends on the current number of such objects in the system. -The third and fourth level names are as follows: -.Bl -column "Third level nameXXXXXX" "Fourth level is:XXXXXX" -offset indent -.It "Third level name Fourth level is:" -.It "KERN_PROC_ALL None" -.It "KERN_PROC_PID A process ID" -.It "KERN_PROC_PGRP A process group" -.It "KERN_PROC_TTY A tty device" -.It "KERN_PROC_UID A user ID" -.It "KERN_PROC_RUID A real user ID" -.El -.Pp -If the third level name is KERN_PROC_ARGS then the command line argument -array is returned in a flattened form, i.e. zero-terminated arguments -follow each other. -The total size of array is returned. -It is also possible for a process to set its own process title this way. -.Bl -column "Third level nameXXXXXX" "Fourth level is:XXXXXX" -offset indent -.It Sy "Third level name Fourth level is:" -.It "KERN_PROC_ARGS A process ID" -.El -.It Li KERN_PROF -Return profiling information about the kernel. -If the kernel is not compiled for profiling, -attempts to retrieve any of the KERN_PROF values will -fail with -.Er ENOENT . -The third level names for the string and integer profiling information -is detailed below. -The changeable column shows whether a process with appropriate -privilege may change the value. -.Bl -column "GPROFXGMONPARAMXXX" "struct gmonparamXXX" -offset indent -.It Sy "Third level name Type Changeable" -.It "GPROF_STATE integer yes" -.It "GPROF_COUNT u_short[\|] yes" -.It "GPROF_FROMS u_short[\|] yes" -.It "GPROF_TOS struct tostruct yes" -.It "GPROF_GMONPARAM struct gmonparam no" -.El -.Pp -The variables are as follows: -.Bl -tag -width 6n -.It Li GPROF_STATE -Returns GMON_PROF_ON or GMON_PROF_OFF to show that profiling -is running or stopped. -.It Li GPROF_COUNT -Array of statistical program counter counts. -.It Li GPROF_FROMS -Array indexed by program counter of call-from points. -.It Li GPROF_TOS -Array of -.Va struct tostruct -describing destination of calls and their counts. -.It Li GPROF_GMONPARAM -Structure giving the sizes of the above arrays. -.El -.It Li KERN_QUANTUM -The maximum period of time, in microseconds, for which a process is allowed -to run without being preempted if other processes are in the run queue. -.It Li KERN_SAVED_IDS -Returns 1 if saved set-group and saved set-user ID is available. -.It Li KERN_SECURELVL -The system security level. -This level may be raised by processes with appropriate privilege. -It may not be lowered. -.It Li KERN_VERSION -The system version string. -.It Li KERN_VNODE -Return the entire vnode table. -Note, the vnode table is not necessarily a consistent snapshot of -the system. -The returned data consists of an array whose size depends on the -current number of such objects in the system. -Each element of the array contains the kernel address of a vnode -.Va struct vnode * -followed by the vnode itself -.Va struct vnode . -.El -.Ss CTL_MACHDEP -The set of variables defined is architecture dependent. -The following variables are defined for the i386 architecture. -.Bl -column "CONSOLE_DEVICEXXX" "struct bootinfoXXX" -offset indent -.It Sy "Second level name Type Changeable" -.It Li "CPU_CONSDEV dev_t no" -.It Li "CPU_ADJKERNTZ int yes" -.It Li "CPU_DISRTCSET int yes" -.It Li "CPU_BOOTINFO struct bootinfo no" -.It Li "CPU_WALLCLOCK int yes" -.El -.Ss CTL_NET -The string and integer information available for the CTL_NET level -is detailed below. -The changeable column shows whether a process with appropriate -privilege may change the value. -.Bl -column "Second level nameXXXXXX" "routing messagesXXX" -offset indent -.It Sy "Second level name Type Changeable" -.It "PF_ROUTE routing messages no" -.It "PF_INET IPv4 values yes" -.It "PF_INET6 IPv6 values yes" -.El -.Pp -.Bl -tag -width 6n -.It Li PF_ROUTE -Return the entire routing table or a subset of it. -The data is returned as a sequence of routing messages (see -.Xr route 4 -for the header file, format and meaning). -The length of each message is contained in the message header. -.Pp -The third level name is a protocol number, which is currently always 0. -The fourth level name is an address family, which may be set to 0 to -select all address families. -The fifth and sixth level names are as follows: -.Bl -column "Fifth level nameXXXXXX" "Sixth level is:XXX" -offset indent -.It Sy "Fifth level name Sixth level is:" -.It "NET_RT_FLAGS rtflags" -.It "NET_RT_DUMP None" -.It "NET_RT_IFLIST 0 or if_index" -.It "NET_RT_IFMALIST 0 or if_index" -.El -.Pp -The -.Dv NET_RT_IFMALIST -name returns information about multicast group memberships on all interfaces -if 0 is specified, or for the interface specified by -.Va if_index . -.It Li PF_INET -Get or set various global information about the IPv4 -(Internet Protocol version 4). -The third level name is the protocol. -The fourth level name is the variable name. -The currently defined protocols and names are: -.Bl -column ProtocolXX VariableXX TypeXX ChangeableXX -.It Sy "Protocol Variable Type Changeable" -.It "icmp bmcastecho integer yes" -.It "icmp maskrepl integer yes" -.It "ip forwarding integer yes" -.It "ip redirect integer yes" -.It "ip ttl integer yes" -.It "udp checksum integer yes" -.El -.Pp -The variables are as follows: -.Bl -tag -width 6n -.It Li icmp.bmcastecho -Returns 1 if an ICMP echo request to a broadcast or multicast address is -to be answered. -.It Li icmp.maskrepl -Returns 1 if ICMP network mask requests are to be answered. -.It Li ip.forwarding -Returns 1 when IP forwarding is enabled for the host, -meaning that the host is acting as a router. -.It Li ip.redirect -Returns 1 when ICMP redirects may be sent by the host. -This option is ignored unless the host is routing IP packets, -and should normally be enabled on all systems. -.It Li ip.ttl -The maximum time-to-live (hop count) value for an IP packet sourced by -the system. -This value applies to normal transport protocols, not to ICMP. -.It Li udp.checksum -Returns 1 when UDP checksums are being computed and checked. -Disabling UDP checksums is strongly discouraged. -.Pp -For variables net.inet.*.ipsec, please refer to -.Xr ipsec 4 . -.El -.It Li PF_INET6 -Get or set various global information about the IPv6 -(Internet Protocol version 6). -The third level name is the protocol. -The fourth level name is the variable name. -.Pp -For variables net.inet6.* please refer to -.Xr inet6 4 . -For variables net.inet6.*.ipsec6, please refer to -.Xr ipsec 4 . -.El -.Ss CTL_USER -The string and integer information available for the CTL_USER level -is detailed below. -The changeable column shows whether a process with appropriate -privilege may change the value. -.Bl -column "USER_COLL_WEIGHTS_MAXXXX" "integerXXX" -offset indent -.It Sy "Second level name Type Changeable" -.It "USER_BC_BASE_MAX integer no" -.It "USER_BC_DIM_MAX integer no" -.It "USER_BC_SCALE_MAX integer no" -.It "USER_BC_STRING_MAX integer no" -.It "USER_COLL_WEIGHTS_MAX integer no" -.It "USER_CS_PATH string no" -.It "USER_EXPR_NEST_MAX integer no" -.It "USER_LINE_MAX integer no" -.It "USER_POSIX2_CHAR_TERM integer no" -.It "USER_POSIX2_C_BIND integer no" -.It "USER_POSIX2_C_DEV integer no" -.It "USER_POSIX2_FORT_DEV integer no" -.It "USER_POSIX2_FORT_RUN integer no" -.It "USER_POSIX2_LOCALEDEF integer no" -.It "USER_POSIX2_SW_DEV integer no" -.It "USER_POSIX2_UPE integer no" -.It "USER_POSIX2_VERSION integer no" -.It "USER_RE_DUP_MAX integer no" -.It "USER_STREAM_MAX integer no" -.It "USER_TZNAME_MAX integer no" -.El -.Bl -tag -width 6n -.Pp -.It Li USER_BC_BASE_MAX -The maximum ibase/obase values in the -.Xr bc 1 -utility. -.It Li USER_BC_DIM_MAX -The maximum array size in the -.Xr bc 1 -utility. -.It Li USER_BC_SCALE_MAX -The maximum scale value in the -.Xr bc 1 -utility. -.It Li USER_BC_STRING_MAX -The maximum string length in the -.Xr bc 1 -utility. -.It Li USER_COLL_WEIGHTS_MAX -The maximum number of weights that can be assigned to any entry of -the LC_COLLATE order keyword in the locale definition file. -.It Li USER_CS_PATH -Return a value for the -.Ev PATH -environment variable that finds all the standard utilities. -.It Li USER_EXPR_NEST_MAX -The maximum number of expressions that can be nested within -parenthesis by the -.Xr expr 1 -utility. -.It Li USER_LINE_MAX -The maximum length in bytes of a text-processing utility's input -line. -.It Li USER_POSIX2_CHAR_TERM -Return 1 if the system supports at least one terminal type capable of -all operations described in -.St -p1003.2 , -otherwise 0. -.It Li USER_POSIX2_C_BIND -Return 1 if the system's C-language development facilities support the -C-Language Bindings Option, otherwise 0. -.It Li USER_POSIX2_C_DEV -Return 1 if the system supports the C-Language Development Utilities Option, -otherwise 0. -.It Li USER_POSIX2_FORT_DEV -Return 1 if the system supports the FORTRAN Development Utilities Option, -otherwise 0. -.It Li USER_POSIX2_FORT_RUN -Return 1 if the system supports the FORTRAN Runtime Utilities Option, -otherwise 0. -.It Li USER_POSIX2_LOCALEDEF -Return 1 if the system supports the creation of locales, otherwise 0. -.It Li USER_POSIX2_SW_DEV -Return 1 if the system supports the Software Development Utilities Option, -otherwise 0. -.It Li USER_POSIX2_UPE -Return 1 if the system supports the User Portability Utilities Option, -otherwise 0. -.It Li USER_POSIX2_VERSION -The version of -.St -p1003.2 -with which the system attempts to comply. -.It Li USER_RE_DUP_MAX -The maximum number of repeated occurrences of a regular expression -permitted when using interval notation. -.It Li USER_STREAM_MAX -The minimum maximum number of streams that a process may have open -at any one time. -.It Li USER_TZNAME_MAX -The minimum maximum number of types supported for the name of a -timezone. -.El -.Ss CTL_VM -The string and integer information available for the CTL_VM level -is detailed below. -The changeable column shows whether a process with appropriate -privilege may change the value. -.Bl -column "Second level nameXXXXXX" "struct loadavgXXX" -offset indent -.It Sy "Second level name Type Changeable" -.It "VM_LOADAVG struct loadavg no" -.It "VM_METER struct vmtotal no" -.It "VM_PAGEOUT_ALGORITHM integer yes" -.It "VM_SWAPPING_ENABLED integer maybe" -.It "VM_V_CACHE_MAX integer yes" -.It "VM_V_CACHE_MIN integer yes" -.It "VM_V_FREE_MIN integer yes" -.It "VM_V_FREE_RESERVED integer yes" -.It "VM_V_FREE_TARGET integer yes" -.It "VM_V_INACTIVE_TARGET integer yes" -.It "VM_V_PAGEOUT_FREE_MIN integer yes" -.El -.Pp -.Bl -tag -width 6n -.It Li VM_LOADAVG -Return the load average history. -The returned data consists of a -.Va struct loadavg . -.It Li VM_METER -Return the system wide virtual memory statistics. -The returned data consists of a -.Va struct vmtotal . -.It Li VM_PAGEOUT_ALGORITHM -0 if the statistics-based page management algorithm is in use -or 1 if the near-LRU algorithm is in use. -.It Li VM_SWAPPING_ENABLED -1 if process swapping is enabled or 0 if disabled. This variable is -permanently set to 0 if the kernel was built with swapping disabled. -.It Li VM_V_CACHE_MAX -Maximum desired size of the cache queue. -.It Li VM_V_CACHE_MIN -Minimum desired size of the cache queue. If the cache queue size -falls very far below this value, the pageout daemon is awakened. -.It Li VM_V_FREE_MIN -Minimum amount of memory (cache memory plus free memory) -required to be available before a process waiting on memory will be -awakened. -.It Li VM_V_FREE_RESERVED -Processes will awaken the pageout daemon and wait for memory if the -number of free and cached pages drops below this value. -.It Li VM_V_FREE_TARGET -The total amount of free memory (including cache memory) that the -pageout daemon tries to maintain. -.It Li VM_V_INACTIVE_TARGET -The desired number of inactive pages that the pageout daemon should -achieve when it runs. Inactive pages can be quickly inserted into -process address space when needed. -.It Li VM_V_PAGEOUT_FREE_MIN -If the amount of free and cache memory falls below this value, the -pageout daemon will enter "memory conserving mode" to avoid deadlock. -.El -.Sh RETURN VALUES -.Rv -std -.Sh ERRORS -The following errors may be reported: -.Bl -tag -width Er -.It Bq Er EFAULT -The buffer -.Fa name , -.Fa oldp , -.Fa newp , -or length pointer -.Fa oldlenp -contains an invalid address. -.It Bq Er EINVAL -The -.Fa name -array is less than two or greater than CTL_MAXNAME. -.It Bq Er EINVAL -A non-null -.Fa newp -is given and its specified length in -.Fa newlen -is too large or too small. -.It Bq Er ENOMEM -The length pointed to by -.Fa oldlenp -is too short to hold the requested value. -.It Bq Er ENOMEM -The smaller of either the length pointed to by -.Fa oldlenp -or the estimated size of the returned data exceeds the -system limit on locked memory. -.It Bq Er ENOMEM -Locking the buffer -.Fa oldp , -or a portion of the buffer if the estimated size of the data -to be returned is smaller, -would cause the process to exceed its per-process locked memory limit. -.It Bq Er ENOTDIR -The -.Fa name -array specifies an intermediate rather than terminal name. -.It Bq Er EISDIR -The -.Fa name -array specifies a terminal name, but the actual name is not terminal. -.It Bq Er ENOENT -The -.Fa name -array specifies a value that is unknown. -.It Bq Er EPERM -An attempt is made to set a read-only value. -.It Bq Er EPERM -A process without appropriate privilege attempts to set a value. -.El -.Sh FILES -.Bl -tag -width -compact -.It In sys/sysctl.h -definitions for top level identifiers, second level kernel and hardware -identifiers, and user level identifiers -.It In sys/socket.h -definitions for second level network identifiers -.It In sys/gmon.h -definitions for third level profiling identifiers -.It In vm/vm_param.h -definitions for second level virtual memory identifiers -.It In netinet/in.h -definitions for third level IPv4/IPv6 identifiers and -fourth level IPv4/v6 identifiers -.It In netinet/icmp_var.h -definitions for fourth level ICMP identifiers -.It In netinet/icmp6.h -definitions for fourth level ICMPv6 identifiers -.It In netinet/udp_var.h -definitions for fourth level UDP identifiers -.El -.Sh SEE ALSO -.Xr sysconf 3 , -.Xr sysctl 8 -.Sh HISTORY -The -.Fn sysctl -function first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/gen/syslog.3 b/src/lib/libc/gen/syslog.3 deleted file mode 100644 index 9e87ae5..0000000 --- a/src/lib/libc/gen/syslog.3 +++ /dev/null @@ -1,297 +0,0 @@ -.\" Copyright (c) 1985, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/syslog.3,v 1.23 2002/12/19 09:40:21 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt SYSLOG 3 -.Os -.Sh NAME -.Nm syslog , -.Nm vsyslog , -.Nm openlog , -.Nm closelog , -.Nm setlogmask -.Nd control system log -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In syslog.h -.In stdarg.h -.Ft void -.Fn syslog "int priority" "const char *message" "..." -.Ft void -.Fn vsyslog "int priority" "const char *message" "va_list args" -.Ft void -.Fn openlog "const char *ident" "int logopt" "int facility" -.Ft void -.Fn closelog void -.Ft int -.Fn setlogmask "int maskpri" -.Sh DESCRIPTION -The -.Fn syslog -function -writes -.Fa message -to the system message logger. -The message is then written to the system console, log files, -logged-in users, or forwarded to other machines as appropriate. -(See -.Xr syslogd 8 . ) -.Pp -The message is identical to a -.Xr printf 3 -format string, except that -.Ql %m -is replaced by the current error -message. -(As denoted by the global variable -.Va errno ; -see -.Xr strerror 3 . ) -A trailing newline is added if none is present. -.Pp -The -.Fn vsyslog -function -is an alternate form in which the arguments have already been captured -using the variable-length argument facilities of -.Xr stdarg 3 . -.Pp -The message is tagged with -.Fa priority . -Priorities are encoded as a -.Fa facility -and a -.Em level . -The facility describes the part of the system -generating the message. -The level is selected from the following -.Em ordered -(high to low) list: -.Bl -tag -width LOG_AUTHPRIV -.It Dv LOG_EMERG -A panic condition. -This is normally broadcast to all users. -.It Dv LOG_ALERT -A condition that should be corrected immediately, such as a corrupted -system database. -.It Dv LOG_CRIT -Critical conditions, e.g., hard device errors. -.It Dv LOG_ERR -Errors. -.It Dv LOG_WARNING -Warning messages. -.It Dv LOG_NOTICE -Conditions that are not error conditions, -but should possibly be handled specially. -.It Dv LOG_INFO -Informational messages. -.It Dv LOG_DEBUG -Messages that contain information -normally of use only when debugging a program. -.El -.Pp -The -.Fn openlog -function -provides for more specialized processing of the messages sent -by -.Fn syslog -and -.Fn vsyslog . -The -.Fa ident -argument -is a string that will be prepended to every message. -The -.Fa logopt -argument -is a bit field specifying logging options, which is formed by -.Tn OR Ns 'ing -one or more of the following values: -.Bl -tag -width LOG_AUTHPRIV -.It Dv LOG_CONS -If -.Fn syslog -cannot pass the message to -.Xr syslogd 8 -it will attempt to write the message to the console -.Pq Dq Pa /dev/console . -.It Dv LOG_NDELAY -Open the connection to -.Xr syslogd 8 -immediately. -Normally the open is delayed until the first message is logged. -Useful for programs that need to manage the order in which file -descriptors are allocated. -.It Dv LOG_PERROR -Write the message to standard error output as well to the system log. -.It Dv LOG_PID -Log the process id with each message: useful for identifying -instantiations of daemons. -.El -.Pp -The -.Fa facility -argument encodes a default facility to be assigned to all messages -that do not have an explicit facility encoded: -.Bl -tag -width LOG_AUTHPRIV -.It Dv LOG_AUTH -The authorization system: -.Xr login 1 , -.Xr su 1 , -.Xr getty 8 , -etc. -.It Dv LOG_AUTHPRIV -The same as -.Dv LOG_AUTH , -but logged to a file readable only by -selected individuals. -.It Dv LOG_CONSOLE -Messages written to -.Pa /dev/console -by the kernel console output driver. -.It Dv LOG_CRON -The cron daemon: -.Xr cron 8 . -.It Dv LOG_DAEMON -System daemons, such as -.Xr routed 8 , -that are not provided for explicitly by other facilities. -.It Dv LOG_FTP -The file transfer protocol daemons: -.Xr ftpd 8 , -.Xr tftpd 8 . -.It Dv LOG_KERN -Messages generated by the kernel. -These cannot be generated by any user processes. -.It Dv LOG_LPR -The line printer spooling system: -.Xr lpr 1 , -.Xr lpc 8 , -.Xr lpd 8 , -etc. -.It Dv LOG_MAIL -The mail system. -.It Dv LOG_NEWS -The network news system. -.It Dv LOG_SECURITY -Security subsystems, such as -.Xr ipfw 4 . -.It Dv LOG_SYSLOG -Messages generated internally by -.Xr syslogd 8 . -.It Dv LOG_USER -Messages generated by random user processes. -This is the default facility identifier if none is specified. -.It Dv LOG_UUCP -The uucp system. -.It Dv LOG_LOCAL0 -Reserved for local use. -Similarly for -.Dv LOG_LOCAL1 -through -.Dv LOG_LOCAL7 . -.El -.Pp -The -.Fn closelog -function -can be used to close the log file. -.Pp -The -.Fn setlogmask -function -sets the log priority mask to -.Fa maskpri -and returns the previous mask. -Calls to -.Fn syslog -with a priority not set in -.Fa maskpri -are rejected. -The mask for an individual priority -.Fa pri -is calculated by the macro -.Fn LOG_MASK pri ; -the mask for all priorities up to and including -.Fa toppri -is given by the macro -.Fn LOG_UPTO toppri ; . -The default allows all priorities to be logged. -.Sh RETURN VALUES -The routines -.Fn closelog , -.Fn openlog , -.Fn syslog -and -.Fn vsyslog -return no value. -.Pp -The routine -.Fn setlogmask -always returns the previous log mask level. -.Sh EXAMPLES -.Bd -literal -offset indent -compact -syslog(LOG_ALERT, "who: internal error 23"); - -openlog("ftpd", LOG_PID | LOG_NDELAY, LOG_FTP); - -setlogmask(LOG_UPTO(LOG_ERR)); - -syslog(LOG_INFO, "Connection from host %d", CallingHost); - -syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m"); -.Ed -.Sh SEE ALSO -.Xr logger 1 , -.Xr syslogd 8 -.Sh HISTORY -These -functions appeared in -.Bx 4.2 . -.Sh BUGS -Never pass a string with user-supplied data as a format without using -.Ql %s . -An attacker can put format specifiers in the string to mangle your stack, -leading to a possible security hole. -This holds true even if the string was built using a function like -.Fn snprintf , -as the resulting string may still contain user-supplied conversion specifiers -for later interpolation by -.Fn syslog . -.Pp -Always use the proper secure idiom: -.Pp -.Dl syslog("%s", string); diff --git a/src/lib/libc/gen/tcgetpgrp.3 b/src/lib/libc/gen/tcgetpgrp.3 deleted file mode 100644 index b155763..0000000 --- a/src/lib/libc/gen/tcgetpgrp.3 +++ /dev/null @@ -1,82 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)tcgetpgrp.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/tcgetpgrp.3,v 1.8 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt TCGETPGRP 3 -.Os -.Sh NAME -.Nm tcgetpgrp -.Nd get foreground process group ID -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In unistd.h -.Ft pid_t -.Fn tcgetpgrp "int fd" -.Sh DESCRIPTION -The -.Fn tcgetpgrp -function returns the value of the process group ID of the foreground -process group associated with the terminal device. -If there is no foreground process group, -.Fn tcgetpgrp -returns an invalid process ID. -.Sh ERRORS -If an error occurs, -.Fn tcgetpgrp -returns -1 and the global variable -.Va errno -is set to indicate the error, as follows: -.Bl -tag -width Er -.It Bq Er EBADF -The -.Fa fd -argument is not a valid file descriptor. -.It Bq Er ENOTTY -The calling process does not have a controlling terminal or the -underlying terminal device represented by -.Fa fd -is not the controlling terminal. -.El -.Sh SEE ALSO -.Xr setpgid 2 , -.Xr setsid 2 , -.Xr tcsetpgrp 3 -.Sh STANDARDS -The -.Fn tcgetpgrp -function is expected to be compliant with the -.St -p1003.1-88 -specification. diff --git a/src/lib/libc/gen/tcsendbreak.3 b/src/lib/libc/gen/tcsendbreak.3 deleted file mode 100644 index c1be0be..0000000 --- a/src/lib/libc/gen/tcsendbreak.3 +++ /dev/null @@ -1,157 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)tcsendbreak.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/tcsendbreak.3,v 1.9 2002/12/19 09:40:21 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt TCSENDBREAK 3 -.Os -.Sh NAME -.Nm tcsendbreak , -.Nm tcdrain , -.Nm tcflush , -.Nm tcflow -.Nd line control functions -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In termios.h -.Ft int -.Fn tcdrain "int fd" -.Ft int -.Fn tcflow "int fd" "int action" -.Ft int -.Fn tcflush "int fd" "int action" -.Ft int -.Fn tcsendbreak "int fd" "int len" -.Sh DESCRIPTION -The -.Fn tcdrain -function waits until all output written to the terminal referenced by -.Fa fd -has been transmitted to the terminal. -.Pp -The -.Fn tcflow -function suspends transmission of data to or the reception of data from -the terminal referenced by -.Fa fd -depending on the value of -.Fa action . -The value of -.Fa action -must be one of the following: -.Bl -tag -width "TCIOFF" -.It Fa TCOOFF -Suspend output. -.It Fa TCOON -Restart suspended output. -.It Fa TCIOFF -Transmit a STOP character, which is intended to cause the terminal to stop -transmitting data to the system. -(See the description of IXOFF in the -.Ql Input Modes -section of -.Xr termios 4 ) . -.It Fa TCION -Transmit a START character, which is intended to cause the terminal to start -transmitting data to the system. -(See the description of IXOFF in the -.Ql Input Modes -section of -.Xr termios 4 ) . -.El -.Pp -The -.Fn tcflush -function discards any data written to the terminal referenced by -.Fa fd -which has not been transmitted to the terminal, or any data received -from the terminal but not yet read, depending on the value of -.Fa action . -The value of -.Fa action -must be one of the following: -.Bl -tag -width "TCIOFLUSH" -.It Fa TCIFLUSH -Flush data received but not read. -.It Fa TCOFLUSH -Flush data written but not transmitted. -.It Fa TCIOFLUSH -Flush both data received but not read and data written but not transmitted. -.El -.Pp -The -.Fn tcsendbreak -function transmits a continuous stream of zero-valued bits for four-tenths -of a second to the terminal referenced by -.Fa fd . -The -.Fa len -argument is ignored in this implementation. -.Sh RETURN VALUES -Upon successful completion, all of these functions return a value of zero. -.Sh ERRORS -If any error occurs, a value of -1 is returned and the global variable -.Va errno -is set to indicate the error, as follows: -.Bl -tag -width Er -.It Bq Er EBADF -The -.Fa fd -argument is not a valid file descriptor. -.It Bq Er EINVAL -The -.Fa action -argument is not a proper value. -.It Bq Er ENOTTY -The file associated with -.Fa fd -is not a terminal. -.It Bq Er EINTR -A signal interrupted the -.Fn tcdrain -function. -.El -.Sh SEE ALSO -.Xr tcsetattr 3 , -.Xr termios 4 -.Sh STANDARDS -The -.Fn tcsendbreak , -.Fn tcdrain , -.Fn tcflush -and -.Fn tcflow -functions are expected to be compliant with the -.St -p1003.1-88 -specification. diff --git a/src/lib/libc/gen/tcsetattr.3 b/src/lib/libc/gen/tcsetattr.3 deleted file mode 100644 index 56c9e0e..0000000 --- a/src/lib/libc/gen/tcsetattr.3 +++ /dev/null @@ -1,333 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)tcsetattr.3 8.3 (Berkeley) 1/2/94 -.\" $FreeBSD: src/lib/libc/gen/tcsetattr.3,v 1.13 2003/09/08 19:57:14 ru Exp $ -.\" -.Dd January 2, 1994 -.Dt TCSETATTR 3 -.Os -.Sh NAME -.Nm cfgetispeed , -.Nm cfsetispeed , -.Nm cfgetospeed , -.Nm cfsetospeed , -.Nm cfsetspeed , -.Nm cfmakeraw , -.Nm tcgetattr , -.Nm tcsetattr -.Nd manipulating the termios structure -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In termios.h -.Ft speed_t -.Fn cfgetispeed "const struct termios *t" -.Ft int -.Fn cfsetispeed "struct termios *t" "speed_t speed" -.Ft speed_t -.Fn cfgetospeed "const struct termios *t" -.Ft int -.Fn cfsetospeed "struct termios *t" "speed_t speed" -.Ft int -.Fn cfsetspeed "struct termios *t" "speed_t speed" -.Ft void -.Fn cfmakeraw "struct termios *t" -.Ft int -.Fn tcgetattr "int fd" "struct termios *t" -.Ft int -.Fn tcsetattr "int fd" "int action" "const struct termios *t" -.Sh DESCRIPTION -The -.Fn cfmakeraw , -.Fn tcgetattr -and -.Fn tcsetattr -functions are provided for getting and setting the termios structure. -.Pp -The -.Fn cfgetispeed , -.Fn cfsetispeed , -.Fn cfgetospeed , -.Fn cfsetospeed -and -.Fn cfsetspeed -functions are provided for getting and setting the baud rate values in -the termios structure. -The effects of the functions on the terminal as described below -do not become effective, nor are all errors detected, until the -.Fn tcsetattr -function is called. -Certain values for baud rates set in the termios structure and passed to -.Fn tcsetattr -have special meanings. -These are discussed in the portion of the manual page that describes the -.Fn tcsetattr -function. -.Sh GETTING AND SETTING THE BAUD RATE -The input and output baud rates are found in the termios structure. -The unsigned integer -.Li speed_t -is typedef'd in the include file -.In termios.h . -The value of the integer corresponds directly to the baud rate being -represented, however, the following symbolic values are defined. -.Bd -literal -#define B0 0 -#define B50 50 -#define B75 75 -#define B110 110 -#define B134 134 -#define B150 150 -#define B200 200 -#define B300 300 -#define B600 600 -#define B1200 1200 -#define B1800 1800 -#define B2400 2400 -#define B4800 4800 -#define B9600 9600 -#define B19200 19200 -#define B38400 38400 -#ifndef _POSIX_SOURCE -#define EXTA 19200 -#define EXTB 38400 -#endif /*_POSIX_SOURCE */ -.Ed -.Pp -The -.Fn cfgetispeed -function returns the input baud rate in the termios structure referenced by -.Fa tp . -.Pp -The -.Fn cfsetispeed -function sets the input baud rate in the termios structure referenced by -.Fa tp -to -.Fa speed . -.Pp -The -.Fn cfgetospeed -function returns the output baud rate in the termios structure referenced by -.Fa tp . -.Pp -The -.Fn cfsetospeed -function sets the output baud rate in the termios structure referenced by -.Fa tp -to -.Fa speed . -.Pp -The -.Fn cfsetspeed -function sets both the input and output baud rate in the termios structure -referenced by -.Fa tp -to -.Fa speed . -.Pp -Upon successful completion, the functions -.Fn cfsetispeed , -.Fn cfsetospeed , -and -.Fn cfsetspeed -return a value of 0. -Otherwise, a value of -1 is returned and the global variable -.Va errno -is set to indicate the error. -.Sh GETTING AND SETTING THE TERMIOS STATE -This section describes the functions that are used to control the general -terminal interface. -Unless otherwise noted for a specific command, these functions are restricted -from use by background processes. -Attempts to perform these operations shall cause the process group to be sent -a SIGTTOU signal. -If the calling process is blocking or ignoring SIGTTOU signals, the process -is allowed to perform the operation and the SIGTTOU signal is not sent. -.Pp -In all the functions, although -.Fa fd -is an open file descriptor, the functions affect the underlying terminal -file, not just the open file description associated with the particular -file descriptor. -.Pp -The -.Fn cfmakeraw -function sets the flags stored in the termios structure to a state disabling -all input and output processing, giving a -.Dq raw I/O path . -It should be noted that there is no function to reverse this effect. -This is because there are a variety of processing options that could be -re-enabled and the correct method is for an application to snapshot the -current terminal state using the function -.Fn tcgetattr , -setting raw mode with -.Fn cfmakeraw -and the subsequent -.Fn tcsetattr , -and then using another -.Fn tcsetattr -with the saved state to revert to the previous terminal state. -.Pp -The -.Fn tcgetattr -function copies the parameters associated with the terminal referenced -by -.Fa fd -in the termios structure referenced by -.Fa tp . -This function is allowed from a background process, however, the terminal -attributes may be subsequently changed by a foreground process. -.Pp -The -.Fn tcsetattr -function sets the parameters associated with the terminal from the -termios structure referenced by -.Fa tp . -The -.Fa action -argument is created by -.Em or Ns 'ing -the following values, as specified in the include file -.In termios.h . -.Bl -tag -width "TCSADRAIN" -.It Fa TCSANOW -The change occurs immediately. -.It Fa TCSADRAIN -The change occurs after all output written to -.Fa fd -has been transmitted to the terminal. -This value of -.Fa action -should be used when changing parameters that affect output. -.It Fa TCSAFLUSH -The change occurs after all output written to -.Fa fd -has been transmitted to the terminal. -Additionally, any input that has been received but not read is discarded. -.It Fa TCSASOFT -If this value is -.Em or Ns 'ed -into the -.Fa action -value, the values of the -.Va c_cflag , -.Va c_ispeed , -and -.Va c_ospeed -fields are ignored. -.El -.Pp -The 0 baud rate is used to terminate the connection. -If 0 is specified as the output speed to the function -.Fn tcsetattr , -modem control will no longer be asserted on the terminal, disconnecting -the terminal. -.Pp -If zero is specified as the input speed to the function -.Fn tcsetattr , -the input baud rate will be set to the same value as that specified by -the output baud rate. -.Pp -If -.Fn tcsetattr -is unable to make any of the requested changes, it returns -1 and -sets errno. -Otherwise, it makes all of the requested changes it can. -If the specified input and output baud rates differ and are a combination -that is not supported, neither baud rate is changed. -.Pp -Upon successful completion, the functions -.Fn tcgetattr -and -.Fn tcsetattr -return a value of 0. -Otherwise, they -return -1 and the global variable -.Va errno -is set to indicate the error, as follows: -.Bl -tag -width Er -.It Bq Er EBADF -The -.Fa fd -argument to -.Fn tcgetattr -or -.Fn tcsetattr -was not a valid file descriptor. -.It Bq Er EINTR -The -.Fn tcsetattr -function was interrupted by a signal. -.It Bq Er EINVAL -The -.Fa action -argument to the -.Fn tcsetattr -function was not valid, or an attempt was made to change an attribute -represented in the termios structure to an unsupported value. -.It Bq Er ENOTTY -The file associated with the -.Fa fd -argument to -.Fn tcgetattr -or -.Fn tcsetattr -is not a terminal. -.El -.Sh SEE ALSO -.Xr tcsendbreak 3 , -.Xr termios 4 -.Sh STANDARDS -The -.Fn cfgetispeed , -.Fn cfsetispeed , -.Fn cfgetospeed , -.Fn cfsetospeed , -.Fn tcgetattr -and -.Fn tcsetattr -functions are expected to be compliant with the -.St -p1003.1-88 -specification. -The -.Fn cfmakeraw -and -.Fn cfsetspeed -functions, -as well as the -.Li TCSASOFT -option to the -.Fn tcsetattr -function are extensions to the -.St -p1003.1-88 -specification. diff --git a/src/lib/libc/gen/tcsetpgrp.3 b/src/lib/libc/gen/tcsetpgrp.3 deleted file mode 100644 index b50e6a8..0000000 --- a/src/lib/libc/gen/tcsetpgrp.3 +++ /dev/null @@ -1,99 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)tcsetpgrp.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/tcsetpgrp.3,v 1.9 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt TCSETPGRP 3 -.Os -.Sh NAME -.Nm tcsetpgrp -.Nd set foreground process group ID -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In unistd.h -.Ft int -.Fn tcsetpgrp "int fd" "pid_t pgrp_id" -.Sh DESCRIPTION -If the process has a controlling terminal, the -.Fn tcsetpgrp -function sets the foreground process group ID associated with the -terminal device to -.Fa pgrp_id . -The terminal device associated with -.Fa fd -must be the controlling terminal of the calling process and the -controlling terminal must be currently associated with the session -of the calling process. -The value of -.Fa pgrp_id -must be the same as the process group ID of a process in the same -session as the calling process. -.Sh RETURN VALUES -.Rv -std tcsetpgrp -.Sh ERRORS -The -.Fn tcsetpgrp -function will fail if: -.Bl -tag -width Er -.It Bq Er EBADF -The -.Fa fd -argument is not a valid file descriptor. -.It Bq Er EINVAL -An invalid value of -.Fa pgrp_id -was specified. -.It Bq Er ENOTTY -The calling process does not have a controlling terminal, or the file -represented by -.Fa fd -is not the controlling terminal, or the controlling terminal is no -longer associated with the session of the calling process. -.It Bq Er EPERM -The -.Fa pgrp_id -argument does not match the process group ID of a process in the same -session as the calling process. -.El -.Sh SEE ALSO -.Xr setpgid 2 , -.Xr setsid 2 , -.Xr tcgetpgrp 3 -.Sh STANDARDS -The -.Fn tcsetpgrp -function is expected to be compliant with the -.St -p1003.1-88 -specification. diff --git a/src/lib/libc/gen/time.3 b/src/lib/libc/gen/time.3 deleted file mode 100644 index 1f8682a..0000000 --- a/src/lib/libc/gen/time.3 +++ /dev/null @@ -1,104 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" the American National Standards Committee X3, on Information -.\" Processing Systems. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)time.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/time.3,v 1.12 2003/07/19 03:19:59 wollman Exp $ -.\" -.Dd July 18, 2003 -.Dt TIME 3 -.Os -.Sh NAME -.Nm time -.Nd get time of day -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In time.h -.Ft time_t -.Fn time "time_t *tloc" -.Sh DESCRIPTION -The -.Fn time -function -returns the value of time in seconds since 0 hours, 0 minutes, -0 seconds, January 1, 1970, Coordinated Universal Time. -If an error occurs, -.Fn time -returns the value -.Po Vt time_t Pc Ns \-1 . -.Pp -The return value is also stored in -.No \&* Ns Va tloc , -provided that -.Va tloc -is non-null. -.Sh ERRORS -The -.Fn time -function may fail for any of the reasons described in -.Xr gettimeofday 2 . -.Sh SEE ALSO -.Xr gettimeofday 2 , -.Xr ctime 3 -.Sh STANDARDS -The -.Nm -function conforms to -.St -p1003.1-2001 . -.Sh BUGS -Neither -.St -isoC-99 -nor -.St -p1003.1-2001 -requires -.Fn time -to set -.Va errno -on failure; thus, it is impossible for an application to distinguish -the valid time value \-1 (representing the last UTC second of 1969) -from the error return value. -.Pp -Systems conforming to earlier versions of the C and -.Tn POSIX -standards (including older versions of -.Fx ) -did not set -.No \&* Ns Va tloc -in the error case. -.Sh HISTORY -A -.Fn time -function appeared in -.At v6 . diff --git a/src/lib/libc/gen/times.3 b/src/lib/libc/gen/times.3 deleted file mode 100644 index 6aa58c3..0000000 --- a/src/lib/libc/gen/times.3 +++ /dev/null @@ -1,144 +0,0 @@ -.\" Copyright (c) 1990, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)times.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/times.3,v 1.10 2001/10/01 16:08:51 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt TIMES 3 -.Os -.Sh NAME -.Nm times -.Nd process times -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/times.h -.Ft clock_t -.Fn times "struct tms *tp" -.Sh DESCRIPTION -.Bf -symbolic -This interface is obsoleted by -.Xr getrusage 2 -and -.Xr gettimeofday 2 . -.Ef -.Pp -The -.Fn times -function returns the value of time in -.Dv CLK_TCK Ns 's -of a second since -0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal -Time. -.Pp -It also fills in the structure pointed to by -.Fa tp -with time-accounting information. -.Pp -The -.Vt tms -structure is defined as follows: -.Bd -literal -offset indent -struct tms { - clock_t tms_utime; - clock_t tms_stime; - clock_t tms_cutime; - clock_t tms_cstime; -}; -.Ed -.Pp -The elements of this structure are defined as follows: -.Bl -tag -width ".Va tms_cutime" -.It Va tms_utime -The -.Tn CPU -time charged for the execution of user instructions. -.It Va tms_stime -The -.Tn CPU -time charged for execution by the system on behalf of -the process. -.It Va tms_cutime -The sum of the -.Va tms_utime Ns s -and -.Va tms_cutime Ns s -of the child processes. -.It Va tms_cstime -The sum of the -.Fa tms_stime Ns s -and -.Fa tms_cstime Ns s -of the child processes. -.El -.Pp -All times are in -.Dv CLK_TCK Ns 's -of a second. -.Pp -The times of a terminated child process are included in the -.Va tms_cutime -and -.Va tms_cstime -elements of the parent when one of the -.Xr wait 2 -functions returns the process ID of the terminated child to the parent. -If an error occurs, -.Fn times -returns the value -.Pq Po Vt clock_t Pc Ns \-1 , -and sets -.Va errno -to indicate the error. -.Sh ERRORS -The -.Fn times -function -may fail and set the global variable -.Va errno -for any of the errors specified for the library -routines -.Xr getrusage 2 -and -.Xr gettimeofday 2 . -.Sh SEE ALSO -.Xr time 1 , -.Xr getrusage 2 , -.Xr gettimeofday 2 , -.Xr wait 2 , -.Xr clocks 7 -.Sh STANDARDS -The -.Fn times -function -conforms to -.St -p1003.1-88 . diff --git a/src/lib/libc/gen/timezone.3 b/src/lib/libc/gen/timezone.3 deleted file mode 100644 index 27caaa2..0000000 --- a/src/lib/libc/gen/timezone.3 +++ /dev/null @@ -1,73 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)timezone.3 8.2 (Berkeley) 4/19/94 -.\" $FreeBSD: src/lib/libc/gen/timezone.3,v 1.9 2002/12/19 09:40:21 ru Exp $ -.\" -.Dd April 19, 1994 -.Dt TIMEZONE 3 -.Os -.Sh NAME -.Nm timezone -.Nd return the timezone abbreviation -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.Ft char * -.Fn timezone "int zone" "int dst" -.Sh DESCRIPTION -.Bf Sy -This interface is for compatibility only; it is impossible to reliably -map timezone's arguments to a time zone abbreviation. -See -.Xr ctime 3 . -.Ef -.Pp -The -.Fn timezone -function returns a pointer to a time zone abbreviation for the specified -.Fa zone -and -.Fa dst -values. -The -.Fa zone -argument -is the number of minutes west of GMT and -.Fa dst -is non-zero if daylight savings time is in effect. -.Sh SEE ALSO -.Xr ctime 3 -.Sh HISTORY -A -.Fn timezone -function appeared in -.At v7 . diff --git a/src/lib/libc/gen/ttyname.3 b/src/lib/libc/gen/ttyname.3 deleted file mode 100644 index c1d1b4f..0000000 --- a/src/lib/libc/gen/ttyname.3 +++ /dev/null @@ -1,131 +0,0 @@ -.\" Copyright (c) 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)ttyname.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/ttyname.3,v 1.10 2002/12/18 13:33:02 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt TTYNAME 3 -.Os -.Sh NAME -.Nm ttyname , -.Nm isatty , -.Nm ttyslot -.Nd get name of associated terminal (tty) from file descriptor -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft char * -.Fn ttyname "int fd" -.Ft int -.Fn isatty "int fd" -.Ft int -.Fn ttyslot void -.Sh DESCRIPTION -These functions operate on the system file descriptors for terminal -type devices. -These descriptors are not related to the standard -.Tn I/O -.Dv FILE -typedef, but refer to the special device files found in -.Pa /dev -and named -.Pa /dev/tty Ns Ar xx -and for which an entry exists -in the initialization file -.Pa /etc/ttys . -(See -.Xr ttys 5 . ) -.Pp -The -.Fn isatty -function -determines if the file descriptor -.Fa fd -refers to a valid -terminal type device. -.Pp -The -.Fn ttyname -function -gets the related device name of -a file descriptor for which -.Fn isatty -is true -.Pp -The -.Fn ttyslot -function -fetches the current process' control terminal number from the -.Xr ttys 5 -file entry. -.Sh RETURN VALUES -The -.Fn ttyname -function -returns the null terminated name if the device is found and -.Fn isatty -is true; otherwise -a -.Dv NULL -pointer is returned. -.Pp -The -.Fn ttyslot -function -returns the unit number of the device file if found; otherwise -the value zero is returned. -.Sh FILES -.Bl -tag -width /etc/ttys -compact -.It Pa /dev/\(** -.It Pa /etc/ttys -.El -.Sh SEE ALSO -.Xr ioctl 2 , -.Xr ttys 5 -.Sh HISTORY -A -.Fn isatty , -.Fn ttyname , -and -.Fn ttyslot -function -appeared in -.At v7 . -.Sh BUGS -The -.Fn ttyname -function leaves its result in an internal static object and returns -a pointer to that object. -Subsequent calls to -.Fn ttyname -will modify the same object. diff --git a/src/lib/libc/gen/tzset.3 b/src/lib/libc/gen/tzset.3 deleted file mode 100644 index 0e49209..0000000 --- a/src/lib/libc/gen/tzset.3 +++ /dev/null @@ -1,327 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Arthur Olson. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)tzset.3 8.2 (Berkeley) 11/17/93 -.\" $FreeBSD: src/lib/libc/gen/tzset.3,v 1.13 2003/06/08 10:01:51 charnier Exp $ -.\" -.Dd November 17, 1993 -.Dt TZSET 3 -.Os -.Sh NAME -.Nm tzset , -.Nm tzsetwall -.Nd initialize time conversion information -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In time.h -.Ft void -.Fn tzset void -.Ft void -.Fn tzsetwall void -.Sh DESCRIPTION -The -.Fn tzset -function -initializes time conversion information used by the library routine -.Xr localtime 3 . -The environment variable -.Ev TZ -specifies how this is done. -.Pp -If -.Ev TZ -does not appear in the environment, the best available approximation to -local wall clock time, as specified by the -.Xr tzfile 5 Ns -format -file -.Pa /etc/localtime -is used. -.Pp -If -.Ev TZ -appears in the environment but its value is a null string, Coordinated -Universal Time -.Pq Tn UTC -is used (without leap second correction). -.Pp -If -.Ev TZ -appears in the environment and its value begins with a colon -.Pq Ql \&: , -the rest of its value is used as a pathname of a -.Xr tzfile 5 Ns -format -file from which to read the time conversion information. -If the first character of the pathname is a slash -.Pq Ql / -it is used as -an absolute pathname; otherwise, it is used as a pathname relative to -the system time conversion information directory. -.Pp -If its value does not begin with a colon, it is first used as the pathname -of a file (as described above) from which to read the time conversion -information. -If that file cannot be read, the value is then interpreted as a direct -specification (the format is described below) of the time conversion -information. -.Pp -If the -.Ev TZ -environment variable does not specify a -.Xr tzfile 5 Ns -format -file and cannot be interpreted as a direct specification, -.Tn UTC -is used. -.Pp -The -.Fn tzsetwall -function -sets things up so that -.Xr localtime 3 -returns the best available approximation of local wall clock time. -.Sh SPECIFICATION FORMAT -When -.Ev TZ -is used directly as a specification of the time conversion information, -it must have the following syntax (spaces inserted for clarity): -.Bd -ragged -offset indent -.Em std offset -.Bo -.Em dst -.Bq Em offset -.Bq , Em rule -.Bc -.Ed -.Pp -Where: -.Bl -tag -width std_and_dst -offset indent -.It Em std No and Em dst -Three or more bytes that are the designation for the standard -.Pq Em std -or summer -.Pq Em dst -time zone. Only -.Em std -is required; if -.Em dst -is missing, then summer time does not apply in this locale. -Upper and lowercase letters are explicitly allowed. Any characters -except a leading colon -.Pq Ql \&: , -digits, comma -.Pq Ql \&, , -minus -.Pq Ql \- , -plus -.Pq Ql + , -and -.Tn ASCII -.Dv NUL -are allowed. -.It Em offset -Indicates the value one must add to the local time to arrive at -Coordinated Universal Time. The -.Em offset -has the form: -.Bd -ragged -offset indent -.Sm off -.Em hh Bo -.Em : mm -.Bq Em : ss -.Bc -.Sm on -.Ed -.Pp -The minutes -.Pq Em mm -and seconds -.Pq Em ss -are optional. The hour -.Pq Em hh -is required and may be a single digit. The -.Em offset -following -.Em std -is required. If no -.Em offset -follows -.Em dst , -summer time is assumed to be one hour ahead of standard time. One or -more digits may be used; the value is always interpreted as a decimal -number. The hour must be between zero and 24, and the minutes (and -seconds) \(em if present \(em between zero and 59. If preceded by a -.Pq Ql \- -the time zone shall be east of the Prime Meridian; otherwise it shall be -west (which may be indicated by an optional preceding -.Pq Ql + ) . -.It Em rule -Indicates when to change to and back from summer time. The -.Em rule -has the form: -.Bd -ragged -offset indent -.Em date/time,date/time -.Ed -.Pp -where the first -.Em date -describes when the change from standard to summer time occurs and the -second -.Em date -describes when the change back happens. Each -.Em time -field describes when, in current local time, the change to the other -time is made. -.Pp -The format of -.Em date -is one of the following: -.Bl -tag -width "M.m.n.d" -.It Sy J Em n -The Julian day -.Em n -(1 \*(Le -.Em n -\*(Le 365). -Leap days are not counted; that is, in all years \(em including leap -years \(em February 28 is day 59 and March 1 is day 60. It is -impossible to explicitly refer to the occasional February 29. -.It Em n -The zero-based Julian day -(0 \*(Le -.Em n -\*(Le 365 ) . -Leap days are counted, and it is possible to refer to February 29. -.It Sy M Em m.n.d -The -.Em d Ns 'th -day (0 \*(Le -.Em d -\*(Le 6) -of week -.Em n -of month -.Em m -of the year -(1 \*(Le -.Em n -\*(Le 5), -(1 \*(Le -.Em m -\*(Le 12), -where week 5 means -.Do -the last -.Em d -day in month -.Em m -.Dc -which may occur in either the fourth or the fifth week). Week 1 is the -first week in which the -.Em d Ns 'th -day occurs. Day zero is Sunday. -.Pp -The -.Em time -has the same format as -.Em offset -except that no leading sign -.Pq Ql \- -or -.Pq Ql + -is allowed. The default, if -.Em time -is not given, is -.Sy 02:00:00 . -.El -.Pp -If no -.Em rule -is present in the -.Ev TZ -specification, the rules specified -by the -.Xr tzfile 5 Ns -format -file -.Em posixrules -in the system time conversion information directory are used, with the -standard and summer time offsets from -.Tn UTC -replaced by those specified by -the -.Em offset -values in -.Ev TZ . -.El -.Pp -For compatibility with System V Release 3.1, a semicolon -.Pq Ql \&; -may be used to separate the -.Em rule -from the rest of the specification. -.Sh FILES -.Bl -tag -width /usr/share/zoneinfo/posixrules -compact -.It Pa /etc/localtime -local time zone file -.It Pa /usr/share/zoneinfo -time zone directory -.It Pa /usr/share/zoneinfo/posixrules -rules for -.Tn POSIX Ns -style -.Tn TZ Ns 's -.It Pa /usr/share/zoneinfo/GMT -for -.Tn UTC -leap seconds -.El -.Pp -If the file -.Pa /usr/share/zoneinfo/GMT -does not exist, -.Tn UTC -leap seconds are loaded from -.Pa /usr/share/zoneinfo/posixrules . -.Sh SEE ALSO -.Xr date 1 , -.Xr gettimeofday 2 , -.Xr ctime 3 , -.Xr getenv 3 , -.Xr time 3 , -.Xr tzfile 5 -.Sh HISTORY -The -.Fn tzset -and -.Fn tzsetwall -functions first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/gen/ualarm.3 b/src/lib/libc/gen/ualarm.3 deleted file mode 100644 index dc34d8d..0000000 --- a/src/lib/libc/gen/ualarm.3 +++ /dev/null @@ -1,101 +0,0 @@ -.\" Copyright (c) 1986, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" From: @(#)ualarm.3 8.2 (Berkeley) 4/19/94 -.\" $FreeBSD: src/lib/libc/gen/ualarm.3,v 1.18 2004/05/09 11:11:21 brueffer Exp $ -.\" -.Dd April 19, 1994 -.Dt UALARM 3 -.Os -.Sh NAME -.Nm ualarm -.Nd schedule signal after specified time -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft useconds_t -.Fn ualarm "useconds_t microseconds" "useconds_t interval" -.Sh DESCRIPTION -.Bf -symbolic -This is a simplified interface to -.Xr setitimer 2 . -.Ef -.Pp -The -.Fn ualarm -function -waits a count of -.Fa microseconds -before asserting the terminating signal -.Dv SIGALRM . -System activity or time used in processing the call may cause a slight -delay. -.Pp -If the -.Fa interval -argument is non-zero, the -.Dv SIGALRM -signal will be sent -to the process every -.Fa interval -microseconds after the timer expires (e.g. after -.Fa microseconds -number of microseconds have passed). -.Pp -Due to -.Xr setitimer 2 -restriction the maximum number of -.Fa microseconds -and -.Fa interval -is limited to 100000000000000 -(in case this value fits in the unsigned integer). -.Sh RETURN VALUES -When the signal has successfully been caught, -.Fn ualarm -returns the amount of time left on the clock. -.Sh NOTES -A microsecond is 0.000001 seconds. -.Sh SEE ALSO -.Xr getitimer 2 , -.Xr setitimer 2 , -.Xr sigpause 2 , -.Xr sigvec 2 , -.Xr alarm 3 , -.Xr signal 3 , -.Xr sleep 3 , -.Xr usleep 3 -.Sh HISTORY -The -.Fn ualarm -function appeared in -.Bx 4.3 . diff --git a/src/lib/libc/gen/ucontext.3 b/src/lib/libc/gen/ucontext.3 deleted file mode 100644 index 9df5b50..0000000 --- a/src/lib/libc/gen/ucontext.3 +++ /dev/null @@ -1,107 +0,0 @@ -.\" Copyright (c) 2002 Packet Design, LLC. -.\" All rights reserved. -.\" -.\" Subject to the following obligations and disclaimer of warranty, -.\" use and redistribution of this software, in source or object code -.\" forms, with or without modifications are expressly permitted by -.\" Packet Design; provided, however, that: -.\" -.\" (i) Any and all reproductions of the source or object code -.\" must include the copyright notice above and the following -.\" disclaimer of warranties; and -.\" (ii) No rights are granted, in any manner or form, to use -.\" Packet Design trademarks, including the mark "PACKET DESIGN" -.\" on advertising, endorsements, or otherwise except as such -.\" appears in the above copyright notice or in the software. -.\" -.\" THIS SOFTWARE IS BEING PROVIDED BY PACKET DESIGN "AS IS", AND -.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, PACKET DESIGN MAKES NO -.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING -.\" THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED -.\" WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, -.\" OR NON-INFRINGEMENT. PACKET DESIGN DOES NOT WARRANT, GUARANTEE, -.\" OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS -.\" OF THE USE OF THIS SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, -.\" RELIABILITY OR OTHERWISE. IN NO EVENT SHALL PACKET DESIGN BE -.\" LIABLE FOR ANY DAMAGES RESULTING FROM OR ARISING OUT OF ANY USE -.\" OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY DIRECT, -.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE, OR CONSEQUENTIAL -.\" DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF -.\" USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER 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 PACKET DESIGN IS ADVISED OF -.\" THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD: src/lib/libc/gen/ucontext.3,v 1.2 2002/12/04 15:47:41 ru Exp $ -.\" -.Dd September 10, 2002 -.Dt UCONTEXT 3 -.Os -.Sh NAME -.Nm ucontext -.Nd user thread context -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In ucontext.h -.Sh DESCRIPTION -The -.Vt ucontext_t -type is a structure type suitable for holding the context for a user -thread of execution. -A thread's context includes its stack, saved registers, and list of -blocked signals. -.Pp -The -.Vt ucontext_t -structure contains at least these fields: -.Pp -.Bl -tag -width ".Va mcontext_t\ \ uc_mcontext" -offset 3n -compact -.It Va "ucontext_t *uc_link" -context to assume when this one returns -.It Va "sigset_t uc_sigmask" -signals being blocked -.It Va "stack_t uc_stack" -stack area -.It Va "mcontext_t uc_mcontext" -saved registers -.El -.Pp -The -.Va uc_link -field points to the context to resume when this context's entry point -function returns. -If -.Va uc_link -is equal to -.Dv NULL , -then the process exits when this context returns. -.Pp -The -.Va uc_mcontext -field is machine-dependent and should be treated as opaque by -portable applications. -.Pp -The following functions are defined to manipulate -.Vt ucontext_t -structures: -.Pp -.Bl -item -offset 3n -compact -.It -.Ft int -.Fn getcontext "ucontext_t *" ; -.It -.Ft int -.Fn setcontext "const ucontext_t *" ; -.It -.Ft void -.Fn makecontext "ucontext_t *" "void \*[lp]*\*[rp]\*[lp]void\*[rp]" int ... ; -.It -.Ft int -.Fn swapcontext "ucontext_t *" "const ucontext_t *" ; -.El -.Sh SEE ALSO -.Xr sigaltstack 2 , -.Xr getcontext 3 , -.Xr makecontext 3 diff --git a/src/lib/libc/gen/ulimit.3 b/src/lib/libc/gen/ulimit.3 deleted file mode 100644 index 3dc745f..0000000 --- a/src/lib/libc/gen/ulimit.3 +++ /dev/null @@ -1,98 +0,0 @@ -.\" Copyright (c) 2002 Kyle Martin. 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 REGENTS 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: src/lib/libc/gen/ulimit.3,v 1.5 2003/01/04 01:11:49 tjr Exp $ -.\" -.Dd January 4, 2003 -.Dt ULIMIT 3 -.Os -.Sh NAME -.Nm ulimit -.Nd get and set process limits -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In ulimit.h -.Ft long -.Fn ulimit "int cmd" "..." -.Sh DESCRIPTION -The -.Fn ulimit -function will get and set process limits. -Currently this is limited to the maximum file size. -The -.Fa cmd -argument is one of the following: -.Bl -tag -width ".Dv UL_GETFSIZE" -.It Dv UL_GETFSIZE -will return the maximum file size in units of 512 blocks of -the current process. -.It Dv UL_SETFSIZE -will attempt to set the maximum file size of the current -process and its children with the second argument expressed as a long. -.El -.Sh RETURN VALUES -Upon successful completion, -.Fn ulimit -returns the value requested; -otherwise the value \-1 is returned and the global variable -.Va errno -is set to indicate the error. -.Sh ERRORS -The -.Fn ulimit -function will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -The command specified was invalid. -.It Bq Er EPERM -The limit specified to -.Fn ulimit -would have raised the maximum limit value, -and the caller is not the super-user. -.El -.Sh SEE ALSO -.Xr getrlimit 2 -.Sh STANDARDS -The -.Fn ulimit -function conforms to -.St -p1003.1-2001 . -.Sh HISTORY -The -.Fn ulimit -function first appeared in -.Fx 5.0 . -.Sh BUGS -The -.Fn ulimit -function provides limited precision for -setting and retrieving process limits. -If there is a need for greater precision than the -type -.Vt long -provides, the -.Xr getrlimit 2 -and -.Xr setrlimit 2 -functions should be considered. diff --git a/src/lib/libc/gen/uname.3 b/src/lib/libc/gen/uname.3 deleted file mode 100644 index cfca201..0000000 --- a/src/lib/libc/gen/uname.3 +++ /dev/null @@ -1,94 +0,0 @@ -.\" Copyright (c) 1994 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)uname.3 8.1 (Berkeley) 1/4/94 -.\" $FreeBSD: src/lib/libc/gen/uname.3,v 1.12 2003/09/08 19:57:14 ru Exp $ -.\" -.Dd January 4, 1994 -.Dt UNAME 3 -.Os -.Sh NAME -.Nm uname -.Nd get system identification -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/utsname.h -.Ft int -.Fn uname "struct utsname *name" -.Sh DESCRIPTION -The -.Fn uname -function stores -.Dv NUL Ns -terminated -strings of information identifying -the current system into the structure referenced by -.Fa name . -.Pp -The -.Vt utsname -structure is defined in the -.In sys/utsname.h -header file, and contains the following members: -.Bl -tag -width nodenameXXXX -offset indent -.It sysname -Name of the operating system implementation. -.It nodename -Network name of this machine. -.It release -Release level of the operating system. -.It version -Version level of the operating system. -.It machine -Machine hardware platform. -.El -.Sh RETURN VALUES -.Rv -std uname -.Sh ERRORS -The -.Fn uname -function may fail and set -.Va errno -for any of the errors specified for the library functions -.Xr sysctl 3 . -.Sh SEE ALSO -.Xr uname 1 , -.Xr sysctl 3 -.Sh STANDARDS -The -.Fn uname -function conforms to -.St -p1003.1-88 . -.Sh HISTORY -The -.Fn uname -function first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/gen/unvis.3 b/src/lib/libc/gen/unvis.3 deleted file mode 100644 index 24492cc..0000000 --- a/src/lib/libc/gen/unvis.3 +++ /dev/null @@ -1,196 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)unvis.3 8.2 (Berkeley) 12/11/93 -.\" $FreeBSD: src/lib/libc/gen/unvis.3,v 1.15 2002/12/18 13:33:02 ru Exp $ -.\" -.Dd December 11, 1993 -.Dt UNVIS 3 -.Os -.Sh NAME -.Nm unvis , -.Nm strunvis -.Nd decode a visual representation of characters -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In vis.h -.Ft int -.Fn unvis "char *cp" "int c" "int *astate" "int flag" -.Ft int -.Fn strunvis "char *dst" "const char *src" -.Ft int -.Fn strunvisx "char *dst" "const char *src" "int flag" -.Sh DESCRIPTION -The -.Fn unvis , -.Fn strunvis -and -.Fn strunvisx -functions -are used to decode a visual representation of characters, as produced -by the -.Xr vis 3 -function, back into -the original form. Unvis is called with successive characters in -.Fa c -until a valid -sequence is recognized, at which time the decoded character is -available at the character pointed to by -.Fa cp . -Strunvis decodes the -characters pointed to by -.Fa src -into the buffer pointed to by -.Fa dst . -.Pp -The -.Fn strunvis -function -simply copies -.Fa src -to -.Fa dst , -decoding any escape sequences along the way, -and returns the number of characters placed into -.Fa dst , -or \-1 if an -invalid escape sequence was detected. The size of -.Fa dst -should be -equal to the size of -.Fa src -(that is, no expansion takes place during -decoding). -.Pp -The -.Fn strunvisx -function does the same as the -.Fn strunvis -function, -but it allows you to add a flag that specifies the style the string -.Fa src -is encoded with. -Currently, the only supported flag is -.Dv VIS_HTTPSTYLE . -.Pp -The -.Fn unvis -function -implements a state machine that can be used to decode an arbitrary -stream of bytes. All state associated with the bytes being decoded -is stored outside the -.Fn unvis -function (that is, a pointer to the state is passed in), so -calls decoding different streams can be freely intermixed. To -start decoding a stream of bytes, first initialize an integer -to zero. Call -.Fn unvis -with each successive byte, along with a pointer -to this integer, and a pointer to a destination character. -The -.Fn unvis -function -has several return codes that must be handled properly. They are: -.Bl -tag -width UNVIS_VALIDPUSH -.It Li \&0 (zero) -Another character is necessary; nothing has been recognized yet. -.It Dv UNVIS_VALID -A valid character has been recognized and is available at the location -pointed to by cp. -.It Dv UNVIS_VALIDPUSH -A valid character has been recognized and is available at the location -pointed to by cp; however, the character currently passed in should -be passed in again. -.It Dv UNVIS_NOCHAR -A valid sequence was detected, but no character was produced. This -return code is necessary to indicate a logical break between characters. -.It Dv UNVIS_SYNBAD -An invalid escape sequence was detected, or the decoder is in an -unknown state. The decoder is placed into the starting state. -.El -.Pp -When all bytes in the stream have been processed, call -.Fn unvis -one more time with -.Fa flag -set to -.Dv UNVIS_END -to extract any remaining character (the character passed in is ignored). -.Pp -The -.Fa flag -argument is also used to specify the encoding style of the source. -If set to -.Dv VIS_HTTPSTYLE , -.Fn unvis -will decode URI strings as specified in RFC 1808. -.Pp -The following code fragment illustrates a proper use of -.Fn unvis . -.Bd -literal -offset indent -int state = 0; -char out; - -while ((ch = getchar()) != EOF) { -again: - switch(unvis(&out, ch, &state, 0)) { - case 0: - case UNVIS_NOCHAR: - break; - case UNVIS_VALID: - (void) putchar(out); - break; - case UNVIS_VALIDPUSH: - (void) putchar(out); - goto again; - case UNVIS_SYNBAD: - (void)fprintf(stderr, "bad sequence!\en"); - exit(1); - } -} -if (unvis(&out, (char)0, &state, UNVIS_END) == UNVIS_VALID) - (void) putchar(out); -.Ed -.Sh SEE ALSO -.Xr vis 1 , -.Xr vis 3 -.Rs -.%A R. Fielding -.%T Relative Uniform Resource Locators -.%O RFC1808 -.Re -.Sh HISTORY -The -.Fn unvis -function -first appeared in -.Bx 4.4 . diff --git a/src/lib/libc/gen/usleep.3 b/src/lib/libc/gen/usleep.3 deleted file mode 100644 index 72fb098..0000000 --- a/src/lib/libc/gen/usleep.3 +++ /dev/null @@ -1,84 +0,0 @@ -.\" Copyright (c) 1986, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)usleep.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/usleep.3,v 1.18 2002/12/29 00:59:09 mike Exp $ -.\" -.Dd February 13, 1998 -.Dt USLEEP 3 -.Os -.Sh NAME -.Nm usleep -.Nd suspend process execution for an interval measured in microseconds -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft int -.Fn usleep "useconds_t microseconds" -.Sh DESCRIPTION -The -.Fn usleep -function suspends execution of the calling process until either -.Fa microseconds -microseconds have elapsed or a signal is delivered to the process and its -action is to invoke a signal-catching function or to terminate the -process. -System activity may lengthen the sleep by an indeterminate amount. -.Pp -This function is implemented using -.Xr nanosleep 2 -by pausing for -.Fa microseconds -microseconds or until a signal occurs. -Consequently, in this implementation, -sleeping has no effect on the state of process timers, -and there is no special handling for SIGALRM. -.Sh RETURN VALUES -.Rv -std usleep -.Sh ERRORS -The -.Fn usleep -function -will fail if: -.Bl -tag -width Er -.It Bq Er EINTR -A signal was delivered to the process and its -action was to invoke a signal-catching function. -.El -.Sh SEE ALSO -.Xr nanosleep 2 , -.Xr sleep 3 -.Sh HISTORY -The -.Fn usleep -function appeared in -.Bx 4.3 . diff --git a/src/lib/libc/gen/utime.3 b/src/lib/libc/gen/utime.3 deleted file mode 100644 index 7dc3611..0000000 --- a/src/lib/libc/gen/utime.3 +++ /dev/null @@ -1,90 +0,0 @@ -.\" Copyright (c) 1980, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)utime.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/utime.3,v 1.11 2002/08/24 00:39:43 mike Exp $ -.\" -.Dd June 4, 1993 -.Dt UTIME 3 -.Os -.Sh NAME -.Nm utime -.Nd set file times -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In utime.h -.Ft int -.Fn utime "const char *file" "const struct utimbuf *timep" -.Sh DESCRIPTION -.Bf -symbolic -This interface is obsoleted by -.Xr utimes 2 . -.Ef -.Pp -The -.Fn utime -function sets the access and modification times of the named file from -the structures in the argument array -.Fa timep . -.Pp -If the times are specified (the -.Fa timep -argument is -.Pf non- Dv NULL ) -the caller must be the owner of the file or be the super-user. -.Pp -If the times are not specified (the -.Fa timep -argument is -.Dv NULL ) -the caller must be the owner of the file, have permission to write -the file, or be the super-user. -.Sh ERRORS -The -.Fn utime -function may fail and set -.Va errno -for any of the errors specified for the library function -.Xr utimes 2 . -.Sh SEE ALSO -.Xr stat 2 , -.Xr utimes 2 -.Sh HISTORY -A -.Fn utime -function appeared in -.At v7 . -.Sh STANDARDS -The -.Fn utime -function conforms to -.St -p1003.1-88 . diff --git a/src/lib/libc/gen/valloc.3 b/src/lib/libc/gen/valloc.3 deleted file mode 100644 index e40f19f..0000000 --- a/src/lib/libc/gen/valloc.3 +++ /dev/null @@ -1,81 +0,0 @@ -.\" Copyright (c) 1980, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)valloc.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/gen/valloc.3,v 1.10 2002/12/18 13:33:02 ru Exp $ -.\" -.Dd June 4, 1993 -.Dt VALLOC 3 -.Os -.Sh NAME -.Nm valloc -.Nd aligned memory allocation function -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In unistd.h -.Ft void * -.Fn valloc "size_t size" -.Sh DESCRIPTION -.Bf -symbolic -The -.Fn valloc -function is obsoleted by the current version of -.Xr malloc 3 , -which aligns page-sized and larger allocations. -.Ef -.Pp -The -.Fn valloc -function -allocates -.Fa size -bytes aligned on a page boundary. -It is implemented by calling -.Xr malloc 3 -with a slightly larger request, saving the true beginning of the block -allocated, and returning a properly aligned pointer. -.Sh RETURN VALUES -The -.Fn valloc -function returns -a pointer to the allocated space if successful; otherwise -a null pointer is returned -.Sh HISTORY -The -.Fn valloc -function appeared in -.Bx 3.0 . -.Sh BUGS -A -.Fn vfree -function -has not been implemented. diff --git a/src/lib/libc/gen/vis.3 b/src/lib/libc/gen/vis.3 deleted file mode 100644 index 93d025d..0000000 --- a/src/lib/libc/gen/vis.3 +++ /dev/null @@ -1,290 +0,0 @@ -.\" Copyright (c) 1989, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" From: @(#)vis.3 8.1 (Berkeley) 6/9/93 -.\" $FreeBSD: src/lib/libc/gen/vis.3,v 1.23 2004/03/21 11:31:37 tjr Exp $ -.\" -.Dd March 21, 2004 -.Dt VIS 3 -.Os -.Sh NAME -.Nm vis -.Nd visually encode characters -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In vis.h -.Ft char * -.Fn vis "char *dst" "int c" "int flag" "int nextc" -.Ft int -.Fn strvis "char *dst" "const char *src" "int flag" -.Ft int -.Fn strvisx "char *dst" "const char *src" "size_t len" "int flag" -.Sh DESCRIPTION -The -.Fn vis -function -copies into -.Fa dst -a string which represents the character -.Fa c . -If -.Fa c -needs no encoding, it is copied in unaltered. The string is -null terminated, and a pointer to the end of the string is -returned. The maximum length of any encoding is four -characters (not including the trailing -.Dv NUL ) ; -thus, when -encoding a set of characters into a buffer, the size of the buffer should -be four times the number of characters encoded, plus one for the trailing -.Dv NUL . -The -.Fa flag -argument is used for altering the default range of -characters considered for encoding and for altering the visual -representation. -The additional character, -.Fa nextc , -is only used when selecting the -.Dv VIS_CSTYLE -encoding format (explained below). -.Pp -The -.Fn strvis -and -.Fn strvisx -functions copy into -.Fa dst -a visual representation of -the string -.Fa src . -The -.Fn strvis -function encodes characters from -.Fa src -up to the -first -.Dv NUL . -The -.Fn strvisx -function encodes exactly -.Fa len -characters from -.Fa src -(this -is useful for encoding a block of data that may contain -.Dv NUL Ns 's ) . -Both forms -.Dv NUL -terminate -.Fa dst . -The size of -.Fa dst -must be four times the number -of characters encoded from -.Fa src -(plus one for the -.Dv NUL ) . -Both -forms return the number of characters in dst (not including -the trailing -.Dv NUL ) . -.Pp -The encoding is a unique, invertible representation composed entirely of -graphic characters; it can be decoded back into the original form using -the -.Xr unvis 3 -or -.Xr strunvis 3 -functions. -.Pp -There are two parameters that can be controlled: the range of -characters that are encoded, and the type -of representation used. -By default, all non-graphic characters -except space, tab, and newline are encoded. -(See -.Xr isgraph 3 . ) -The following flags -alter this: -.Bl -tag -width VIS_WHITEX -.It Dv VIS_GLOB -Also encode magic characters ('*', '?', '[' and '#') recognized by -.Xr glob 3 -.It Dv VIS_SP -Also encode space. -.It Dv VIS_TAB -Also encode tab. -.It Dv VIS_NL -Also encode newline. -.It Dv VIS_WHITE -Synonym for -.Dv VIS_SP -\&| -.Dv VIS_TAB -\&| -.Dv VIS_NL . -.It Dv VIS_SAFE -Only encode "unsafe" characters. Unsafe means control -characters which may cause common terminals to perform -unexpected functions. Currently this form allows space, -tab, newline, backspace, bell, and return - in addition -to all graphic characters - unencoded. -.El -.Pp -There are four forms of encoding. -Most forms use the backslash character -.Ql \e -to introduce a special -sequence; two backslashes are used to represent a real backslash. -These are the visual formats: -.Bl -tag -width VIS_HTTPSTYLE -.It (default) -Use an -.Ql M -to represent meta characters (characters with the 8th -bit set), and use carat -.Ql ^ -to represent control characters see -.Pf ( Xr iscntrl 3 ) . -The following formats are used: -.Bl -tag -width xxxxx -.It Dv \e^C -Represents the control character -.Ql C . -Spans characters -.Ql \e000 -through -.Ql \e037 , -and -.Ql \e177 -(as -.Ql \e^? ) . -.It Dv \eM-C -Represents character -.Ql C -with the 8th bit set. -Spans characters -.Ql \e241 -through -.Ql \e376 . -.It Dv \eM^C -Represents control character -.Ql C -with the 8th bit set. -Spans characters -.Ql \e200 -through -.Ql \e237 , -and -.Ql \e377 -(as -.Ql \eM^? ) . -.It Dv \e040 -Represents -.Tn ASCII -space. -.It Dv \e240 -Represents Meta-space. -.El -.Pp -.It Dv VIS_CSTYLE -Use C-style backslash sequences to represent standard non-printable -characters. -The following sequences are used to represent the indicated characters: -.Bd -unfilled -offset indent -.Li \ea Tn - BEL No (007) -.Li \eb Tn - BS No (010) -.Li \ef Tn - NP No (014) -.Li \en Tn - NL No (012) -.Li \er Tn - CR No (015) -.Li \et Tn - HT No (011) -.Li \ev Tn - VT No (013) -.Li \e0 Tn - NUL No (000) -.Ed -.Pp -When using this format, the -.Fa nextc -argument is looked at to determine -if a -.Dv NUL -character can be encoded as -.Ql \e0 -instead of -.Ql \e000 . -If -.Fa nextc -is an octal digit, the latter representation is used to -avoid ambiguity. -.It Dv VIS_HTTPSTYLE -Use URI encoding as described in RFC 1808. -The form is -.Ql %dd -where -.Ar d -represents a hexadecimal digit. -.It Dv VIS_OCTAL -Use a three digit octal sequence. The form is -.Ql \eddd -where -.Ar d -represents an octal digit. -.El -.Pp -There is one additional flag, -.Dv VIS_NOSLASH , -which inhibits the -doubling of backslashes and the backslash before the default -format (that is, control characters are represented by -.Ql ^C -and -meta characters as -.Ql M-C ) . -With this flag set, the encoding is -ambiguous and non-invertible. -.Sh SEE ALSO -.Xr unvis 1 , -.Xr unvis 3 -.Rs -.%A R. Fielding -.%T Relative Uniform Resource Locators -.%O RFC1808 -.Re -.Sh HISTORY -These functions first appeared in -.Bx 4.4 . -.Sh BUGS -The -.Nm -family of functions do not recognize multibyte characters, and thus -may consider them to be non-printable when they are in fact printable -(and vice versa.) diff --git a/src/lib/libc/gen/wordexp.3 b/src/lib/libc/gen/wordexp.3 deleted file mode 100644 index 54be32d..0000000 --- a/src/lib/libc/gen/wordexp.3 +++ /dev/null @@ -1,201 +0,0 @@ -.\" -.\" Copyright (c) 2002 Tim J. Robbins -.\" 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: src/lib/libc/gen/wordexp.3,v 1.6 2003/09/08 19:57:14 ru Exp $ -.\" -.Dd December 27, 2002 -.Dt WORDEXP 3 -.Os -.Sh NAME -.Nm wordexp -.Nd "perform shell-style word expansions" -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In wordexp.h -.Ft int -.Fn wordexp "const char * restrict words" "wordexp_t * restrict we" "int flags" -.Ft void -.Fn wordfree "wordexp_t *we" -.Sh DESCRIPTION -The -.Fn wordexp -function performs shell-style word expansion on -.Fa words -and places the list of words into the -.Va we_wordv -member of -.Fa we , -and the number of words into -.Va we_wordc . -.Pp -The -.Fa flags -argument is the bitwise inclusive OR of any of the following constants: -.Bl -tag -width ".Dv WRDE_SHOWERR" -.It Dv WRDE_APPEND -Append the words to those generated by a previous call to -.Fn wordexp . -.It Dv WRDE_DOOFS -As many -.Dv NULL -pointers as are specified by the -.Va we_offs -member of -.Fa we -are added to the front of -.Va we_wordv . -.It Dv WRDE_NOCMD -Disallow command substitution in -.Fa words . -See the note in -.Sx BUGS -before using this. -.It Dv WRDE_REUSE -The -.Fa we -argument was passed to a previous successful call to -.Fn wordexp -but has not been passed to -.Fn wordfree . -The implementation may reuse the space allocated to it. -.It Dv WRDE_SHOWERR -Do not redirect shell error messages to -.Pa /dev/null . -.It Dv WRDE_UNDEF -Report error on an attempt to expand an undefined shell variable. -.El -.Pp -The -.Vt wordexp_t -structure is defined in -.In wordexp.h -as: -.Bd -literal -offset indent -typedef struct { - size_t we_wordc; /* count of words matched */ - char **we_wordv; /* pointer to list of words */ - size_t we_offs; /* slots to reserve in we_wordv */ -} wordexp_t; -.Ed -.Pp -The -.Fn wordfree -function frees the memory allocated by -.Fn wordexp . -.Sh IMPLEMENTATION NOTES -The -.Fn wordexp -function is implemented as a wrapper around the undocumented -.Ic wordexp -shell built-in command. -.Sh RETURN VALUES -The -.Fn wordexp -function returns zero if successful, otherwise it returns one of the following -error codes: -.Bl -tag -width ".Dv WRDE_NOSPACE" -.It Dv WRDE_BADCHAR -The -.Fa words -argument contains one of the following unquoted characters: -.Aq newline , -.Ql | , -.Ql & , -.Ql \&; , -.Ql < , -.Ql > , -.Ql \&( , -.Ql \&) , -.Ql { , -.Ql } . -.It Dv WRDE_BADVAL -An attempt was made to expand an undefined shell variable and -.Dv WRDE_UNDEF -is set in -.Fa flags . -.It Dv WRDE_CMDSUB -An attempt was made to use command substitution and -.Dv WRDE_NOCMD -is set in -.Fa flags . -.It Dv WRDE_NOSPACE -Not enough memory to store the result. -.It Dv WRDE_SYNTAX -Shell syntax error in -.Fa words . -.El -.Pp -The -.Fn wordfree -function returns no value. -.Sh ENVIRONMENT -.Bl -tag -width ".Ev IFS" -.It Ev IFS -Field separator. -.El -.Sh EXAMPLES -Invoke the editor on all -.Pa .c -files in the current directory -and -.Pa /etc/motd -(error checking omitted): -.Bd -literal -offset indent -wordexp_t we; - -wordexp("${EDITOR:-vi} *.c /etc/motd", &we, 0); -execvp(we->we_wordv[0], we->we_wordv); -.Ed -.Sh DIAGNOSTICS -Diagnostic messages from the shell are written to the standard error output -if -.Dv WRDE_SHOWERR -is set in -.Fa flags . -.Sh SEE ALSO -.Xr sh 1 , -.Xr fnmatch 3 , -.Xr glob 3 , -.Xr popen 3 , -.Xr system 3 -.Sh STANDARDS -The -.Fn wordexp -and -.Fn wordfree -functions conform to -.St -p1003.1-2001 . -.Sh BUGS -Do not pass untrusted user data to -.Fn wordexp , -regardless of whether the -.Dv WRDE_NOCMD -flag is set. -The -.Fn wordexp -function attempts to detect input that would cause commands to be -executed before passing it to the shell -but it does not use the same parser so it may be fooled.