diff --git a/lib/libc/compat-43/sigvec.2 b/lib/libc/compat-43/sigvec.2 index 12cf81fe0508..33b6869be82d 100644 --- a/lib/libc/compat-43/sigvec.2 +++ b/lib/libc/compat-43/sigvec.2 @@ -1,342 +1,351 @@ .\" 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. 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. .\" .\" @(#)sigvec.2 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 19, 1994 +.Dd April 2, 2022 .Dt SIGVEC 2 .Os .Sh NAME .Nm sigvec .Nd software signal facilities .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In signal.h .Bd -literal struct sigvec { void (*sv_handler)(); int sv_mask; int sv_flags; }; .Ed .Ft int .Fn sigvec "int sig" "struct sigvec *vec" "struct sigvec *ovec" .Sh DESCRIPTION .Bf -symbolic This interface is made obsolete by .Xr sigaction 2 . .Ef .Pp The system defines a set of signals that may be delivered to a process. Signal delivery resembles the occurrence of a hardware interrupt: the signal is blocked from further occurrence, the current process context is saved, and a new one is built. A process may specify a .Em handler to which a signal is delivered, or specify that a signal is to be .Em blocked or .Em ignored . A process may also specify that a default action is to be taken by the system when a signal occurs. Normally, signal handlers execute on the current stack of the process. This may be changed, on a per-handler basis, so that signals are taken on a special .Em "signal stack" . .Pp All signals have the same .Em priority . Signal routines execute with the signal that caused their invocation .Em blocked , but other signals may yet occur. A global .Em "signal mask" defines the set of signals currently blocked from delivery to a process. The signal mask for a process is initialized from that of its parent (normally 0). It may be changed with a .Xr sigblock 2 or .Xr sigsetmask 2 call, or when a signal is delivered to the process. .Pp When a signal condition arises for a process, the signal is added to a set of signals pending for the process. If the signal is not currently .Em blocked by the process then it is delivered to the process. When a signal is delivered, the current state of the process is saved, a new signal mask is calculated (as described below), and the signal handler is invoked. The call to the handler is arranged so that if the signal handling routine returns normally the process will resume execution in the context from before the signal's delivery. If the process wishes to resume in a different context, then it must arrange to restore the previous context itself. .Pp When a signal is delivered to a process a new signal mask is installed for the duration of the process' signal handler (or until a .Xr sigblock 2 or .Xr sigsetmask 2 call is made). This mask is formed by taking the current signal mask, adding the signal to be delivered, and .Em or Ns 'ing in the signal mask associated with the handler to be invoked. .Pp The .Fn sigvec function assigns a handler for a specific signal. If .Fa vec is non-zero, it specifies a handler routine and mask to be used when delivering the specified signal. Further, if the .Dv SV_ONSTACK bit is set in .Fa sv_flags , the system will deliver the signal to the process on a .Em "signal stack" , specified with .Xr sigaltstack 2 . If .Fa ovec is non-zero, the previous handling information for the signal is returned to the user. .Pp The following is a list of all signals with names as in the include file .In signal.h : .Bl -column SIGVTALARMXX "create core imagexxx" .It Sy "NAME Default Action Description" .It Dv SIGHUP No " terminate process" " terminal line hangup" .It Dv SIGINT No " terminate process" " interrupt program" .It Dv SIGQUIT No " create core image" " quit program" .It Dv SIGILL No " create core image" " illegal instruction" .It Dv SIGTRAP No " create core image" " trace trap" .It Dv SIGABRT No " create core image" Ta Xr abort 3 call (formerly .Dv SIGIOT ) .It Dv SIGEMT No " create core image" " emulate instruction executed" .It Dv SIGFPE No " create core image" " floating-point exception" .It Dv SIGKILL No " terminate process" " kill program" .It Dv SIGBUS No " create core image" " bus error" .It Dv SIGSEGV No " create core image" " segmentation violation" .It Dv SIGSYS No " create core image" " non-existent system call invoked" .It Dv SIGPIPE No " terminate process" " write on a pipe with no reader" .It Dv SIGALRM No " terminate process" " real-time timer expired" .It Dv SIGTERM No " terminate process" " software termination signal" .It Dv SIGURG No " discard signal" " urgent condition present on socket" .It Dv SIGSTOP No " stop process" " stop (cannot be caught or ignored)" .It Dv SIGTSTP No " stop process" " stop signal generated from keyboard" .It Dv SIGCONT No " discard signal" " continue after stop" .It Dv SIGCHLD No " discard signal" " child status has changed" .It Dv SIGTTIN No " stop process" " background read attempted from control terminal" .It Dv SIGTTOU No " stop process" " background write attempted to control terminal" .It Dv SIGIO No " discard signal" Tn " I/O" is possible on a descriptor (see .Xr fcntl 2 ) .It Dv SIGXCPU No " terminate process" " cpu time limit exceeded (see" .Xr setrlimit 2 ) .It Dv SIGXFSZ No " terminate process" " file size limit exceeded (see" .Xr setrlimit 2 ) .It Dv SIGVTALRM No " terminate process" " virtual time alarm (see" .Xr setitimer 2 ) .It Dv SIGPROF No " terminate process" " profiling timer alarm (see" .Xr setitimer 2 ) .It Dv SIGWINCH No " discard signal" " Window size change" .It Dv SIGINFO No " discard signal" " status request from keyboard" .It Dv SIGUSR1 No " terminate process" " User defined signal 1" .It Dv SIGUSR2 No " terminate process" " User defined signal 2" .El .Pp Once a signal handler is installed, it remains installed until another .Fn sigvec call is made, or an .Xr execve 2 is performed. A signal-specific default action may be reset by setting .Fa sv_handler to .Dv SIG_DFL . The defaults are process termination, possibly with core dump; no action; stopping the process; or continuing the process. See the above signal list for each signal's default action. If .Fa sv_handler is .Dv SIG_IGN current and pending instances of the signal are ignored and discarded. .Pp If a signal is caught during the system calls listed below, the call is normally restarted. The call can be forced to terminate prematurely with an .Er EINTR error return by setting the .Dv SV_INTERRUPT bit in .Fa sv_flags . 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 slow device (such as a terminal, but not a regular file) and during a .Xr wait 2 or .Xr ioctl 2 . However, calls that have already committed are not restarted, but instead return a partial success (for example, a short read count). .Pp After a .Xr fork 2 or .Xr vfork 2 all signals, the signal mask, the signal stack, and the restart/interrupt flags are inherited by the child. .Pp The .Xr execve 2 system call reinstates the default action for all signals which were caught and resets all signals to be caught on the user stack. Ignored signals remain ignored; the signal mask remains the same; signals that interrupt system calls continue to do so. .Sh NOTES The mask specified in .Fa vec is not allowed to block .Dv SIGKILL or .Dv SIGSTOP . This is done silently by the system. .Pp The .Dv SV_INTERRUPT flag is not available in .Bx 4.2 , hence it should not be used if backward compatibility is needed. .Sh RETURN VALUES .Rv -std sigvec .Sh EXAMPLES On the .Tn VAX\-11 The handler routine can be declared: .Bd -literal -offset indent void handler(sig, code, scp) int sig, code; struct sigcontext *scp; .Ed .Pp Here .Fa sig is the signal number, into which the hardware faults and traps are mapped as defined below. The .Fa code argument is either a constant as given below or, for compatibility mode faults, the code provided by the hardware (Compatibility mode faults are distinguished from the other .Dv SIGILL traps by having .Dv PSL_CM set in the psl). The .Fa scp argument is a pointer to the .Fa sigcontext structure (defined in .In signal.h ) , used to restore the context from before the signal. .Sh ERRORS The .Fn sigvec function will fail and no new signal handler will be installed if one of the following occurs: .Bl -tag -width Er .It Bq Er EFAULT Either .Fa vec or .Fa ovec points to memory that is not a valid part of the process address space. .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 .Dv SIGSTOP . .El .Sh SEE ALSO .Xr kill 1 , .Xr kill 2 , .Xr ptrace 2 , .Xr sigaction 2 , .Xr sigaltstack 2 , .Xr sigblock 2 , .Xr sigpause 2 , .Xr sigprocmask 2 , .Xr sigsetmask 2 , .Xr sigsuspend 2 , .Xr setjmp 3 , .Xr siginterrupt 3 , .Xr signal 3 , .Xr sigsetops 3 , .Xr tty 4 +.Sh HISTORY +A +.Fn sigvec +system call first appeared in +.Bx 4.2 . +It was reimplemented as a wrapper around +.Xr sigaction 2 +in +.Bx 4.3 Reno . .Sh BUGS This manual page is still confusing. diff --git a/lib/libc/db/man/dbm.3 b/lib/libc/db/man/dbm.3 index 4fe5d82d6902..dd7cc0a614e0 100644 --- a/lib/libc/db/man/dbm.3 +++ b/lib/libc/db/man/dbm.3 @@ -1,226 +1,237 @@ .\" Copyright (c) 1999 Tim Singletary .\" No copyright is claimed. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd May 30, 2016 +.Dd April 2, 2022 .Dt DBM 3 .Os .Sh NAME .Nm dbm_clearerr , .Nm dbm_close , .Nm dbm_delete , .Nm dbm_dirfno , .Nm dbm_error , .Nm dbm_fetch , .Nm dbm_firstkey , .Nm dbm_nextkey , .Nm dbm_open , .Nm dbm_store .Nd database access functions .Sh SYNOPSIS .In fcntl.h .In ndbm.h .Ft DBM * .Fn dbm_open "const char *base" "int flags" "mode_t mode" .Ft void .Fn dbm_close "DBM *db" .Ft int .Fn dbm_store "DBM *db" "datum key" "datum data" "int flags" .Ft datum .Fn dbm_fetch "DBM *db" "datum key" .Ft int .Fn dbm_delete "DBM *db" "datum key" .Ft datum .Fn dbm_firstkey "DBM *db" .Ft datum .Fn dbm_nextkey "DBM *db" .Ft int .Fn dbm_error "DBM *db" .Ft int .Fn dbm_clearerr "DBM *db" .Ft int .Fn dbm_dirfno "DBM *db" .Sh DESCRIPTION Database access functions. These functions are implemented using .Xr dbopen 3 with a .Xr hash 3 database. .Pp .Vt datum is declared in .In ndbm.h : .Bd -literal typedef struct { void *dptr; int dsize; } datum; .Ed .Pp The .Fn dbm_open base flags mode function opens or creates a database. The .Fa base argument is the basename of the file containing the database; the actual database has a .Pa .db suffix. I.e., if .Fa base is .Qq Li /home/me/mystuff then the actual database is in the file .Pa /home/me/mystuff.db . The .Fa flags and .Fa mode arguments are passed to .Xr open 2 . .Pq Dv O_RDWR | O_CREAT is a typical value for .Fa flags ; .Li 0660 is a typical value for .Fa mode . .Dv O_WRONLY is not allowed in .Fa flags . The pointer returned by .Fn dbm_open identifies the database and is the .Fa db argument to the other functions. The .Fn dbm_open function returns .Dv NULL and sets .Va errno if there were any errors. .Pp The .Fn dbm_close db function closes the database. .Pp The .Fn dbm_store db key data flags function inserts or replaces an entry in the database. The .Fa flags argument is either .Dv DBM_INSERT or .Dv DBM_REPLACE . If .Fa flags is .Dv DBM_INSERT and the database already contains an entry for .Fa key , that entry is not replaced. Otherwise the entry is replaced or inserted. The .Fn dbm_store function normally returns zero but returns 1 if the entry could not be inserted (because .Fa flags is .Dv DBM_INSERT , and an entry with .Fa key already exists) or returns -1 and sets .Va errno if there were any errors. .Pp The .Fn dbm_fetch db key function returns .Dv NULL or the .Fa data corresponding to .Fa key . .Pp The .Fn dbm_delete db key function deletes the entry for .Fa key . The .Fn dbm_delete function normally returns zero or returns -1 and sets .Va errno if there were any errors. .Pp The .Fn dbm_firstkey db function returns the first key in the database. The .Fn dbm_nextkey db function returns subsequent keys. The .Fn db_firstkey function must be called before .Fn dbm_nextkey . The order in which keys are returned is unspecified and may appear random. The .Fn dbm_nextkey function returns .Dv NULL after all keys have been returned. .Pp The .Fn dbm_error db function returns the .Va errno value of the most recent error. The .Fn dbm_clearerr db function resets this value to 0 and returns 0. .Pp The .Fn dbm_dirfno db function returns the file descriptor to the database. .Sh SEE ALSO .Xr open 2 , .Xr dbopen 3 , .Xr hash 3 .Sh STANDARDS These functions (except .Fn dbm_dirfno ) are included in the .St -susv2 . +.Sh HISTORY +The functions +.Fn dbminit , +.Fn fetch , +.Fn store , +.Fn delete , +.Fn firstkey , +and +.Fn nextkey +first appeared in +.At v7 . diff --git a/lib/libc/gen/alarm.3 b/lib/libc/gen/alarm.3 index deb455ea4a7f..d9e83fd410d9 100644 --- a/lib/libc/gen/alarm.3 +++ b/lib/libc/gen/alarm.3 @@ -1,93 +1,99 @@ .\" 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. 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$ .\" -.Dd April 19, 1994 +.Dd April 2, 2022 .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 sigsuspend 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 +system call appeared in the Programmer's Workbench (PWB/UNIX) +and was ported to .At v7 . +For +.Bx 4.1c , +it was reimplemented as a wrapper around the +.Xr setitimer 2 +system call. diff --git a/lib/libc/gen/fnmatch.3 b/lib/libc/gen/fnmatch.3 index 5503884665b6..8cc0ef9551f1 100644 --- a/lib/libc/gen/fnmatch.3 +++ b/lib/libc/gen/fnmatch.3 @@ -1,151 +1,155 @@ .\" 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. 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$ .\" -.Dd July 18, 2004 +.Dd April 2, 2022 .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 current implementation of the .Fn fnmatch function .Em does not conform to .St -p1003.2 . Collating symbol expressions, equivalence class expressions and character class expressions are not supported. .Sh HISTORY +A predecessor to +.Fn fnmatch , +.Fn gmatch , +first appeared in the Programmer's Workbench (PWB/UNIX). 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/lib/libc/gen/pause.3 b/lib/libc/gen/pause.3 index fc057c7aa634..128e81279efc 100644 --- a/lib/libc/gen/pause.3 +++ b/lib/libc/gen/pause.3 @@ -1,82 +1,94 @@ .\" 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. 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$ .\" -.Dd June 4, 1993 +.Dd April 3, 2022 .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 . +system call first appeared in the Programmer's Workbench (PWB/UNIX) +and was then ported to +.At v7 . +It was reimplemeted as a wrapper around the +.Fn sigpause +and +.Fn sigblock +system calls in +.Bx 4.2 , +and around the +.Xr sigsuspend 2 +and +.Xr sigprocmask 2 +system calls in +.Bx 4.3 Reno . diff --git a/lib/libc/gen/setjmp.3 b/lib/libc/gen/setjmp.3 index 5a5c0964ce10..2b6ea9afeb64 100644 --- a/lib/libc/gen/setjmp.3 +++ b/lib/libc/gen/setjmp.3 @@ -1,172 +1,178 @@ .\" 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. 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$ .\" -.Dd June 4, 1993 +.Dd April 2, 2022 .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 . +.Sh HISTORY +The +.Fn setjmp +and +.Fn longjmp +functions first appeared in the Programmer's Workbench (PWB/UNIX). diff --git a/lib/libc/locale/ctype.3 b/lib/libc/locale/ctype.3 index 5401fdb92b16..b7a3b1ccb05a 100644 --- a/lib/libc/locale/ctype.3 +++ b/lib/libc/locale/ctype.3 @@ -1,151 +1,166 @@ .\" 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. 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. .\" .\" @(#)ctype.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 30, 2004 +.Dd April 3, 2022 .Dt CTYPE 3 .Os .Sh NAME .Nm digittoint , .Nm isalnum , .Nm isalpha , .Nm isascii , .Nm isblank , .Nm iscntrl , .Nm isdigit , .Nm isgraph , .Nm ishexnumber , .Nm isideogram , .Nm islower , .Nm isnumber , .Nm isphonogram , .Nm isprint , .Nm ispunct , .Nm isrune , .Nm isspace , .Nm isspecial , .Nm isupper , .Nm isxdigit , .Nm toascii , .Nm tolower , .Nm toupper .Nd character classification functions .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn digittoint "int c" .Ft int .Fn isalnum "int c" .Ft int .Fn isalpha "int c" .Ft int .Fn isascii "int c" .Ft int .Fn iscntrl "int c" .Ft int .Fn isdigit "int c" .Ft int .Fn isgraph "int c" .Ft int .Fn ishexnumber "int c" .Ft int .Fn isideogram "int c" .Ft int .Fn islower "int c" .Ft int .Fn isnumber "int c" .Ft int .Fn isphonogram "int c" .Ft int .Fn isspecial "int c" .Ft int .Fn isprint "int c" .Ft int .Fn ispunct "int c" .Ft int .Fn isrune "int c" .Ft int .Fn isspace "int c" .Ft int .Fn isupper "int c" .Ft int .Fn isxdigit "int c" .Ft int .Fn toascii "int c" .Ft int .Fn tolower "int c" .Ft int .Fn toupper "int c" .Sh DESCRIPTION The above functions perform character tests and conversions on the integer .Fa c . They are available as macros, defined in the include file .In ctype.h , or as true functions in the C library. See the specific manual pages for more information. .Sh SEE ALSO .Xr digittoint 3 , .Xr isalnum 3 , .Xr isalpha 3 , .Xr isascii 3 , .Xr isblank 3 , .Xr iscntrl 3 , .Xr isdigit 3 , .Xr isgraph 3 , .Xr isideogram 3 , .Xr islower 3 , .Xr isphonogram 3 , .Xr isprint 3 , .Xr ispunct 3 , .Xr isrune 3 , .Xr isspace 3 , .Xr isspecial 3 , .Xr isupper 3 , .Xr isxdigit 3 , .Xr toascii 3 , .Xr tolower 3 , .Xr toupper 3 , .Xr wctype 3 , .Xr ascii 7 .Sh STANDARDS These functions, except for .Fn digittoint , .Fn isascii , .Fn ishexnumber , .Fn isideogram , .Fn isnumber , .Fn isphonogram , .Fn isrune , .Fn isspecial and .Fn toascii , conform to .St -isoC . +.Sh HISTORY +The functions +.Fn isalpha , +.Fn isupper , +.Fn islower , +.Fn isdigit , +.Fn isalnum , +.Fn isspace , +.Fn ispunct , +.Fn isprint , +.Fn iscntrl , +and +.Fn isascii +first appeared in +.At v7 . diff --git a/lib/libc/locale/isalnum.3 b/lib/libc/locale/isalnum.3 index 5dcc4cc1f12b..85e846332352 100644 --- a/lib/libc/locale/isalnum.3 +++ b/lib/libc/locale/isalnum.3 @@ -1,115 +1,120 @@ .\" 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. 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. .\" .\" @(#)isalnum.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd April 2, 2022 .Dt ISALNUM 3 .Os .Sh NAME .Nm isalnum .Nd alphanumeric character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isalnum "int c" .Ft int .Fn isalnum_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isalnum function tests for any character for which .Xr isalpha 3 or .Xr isdigit 3 is true. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&060\ ``0''" Ta "061\ ``1''" Ta "062\ ``2''" Ta "063\ ``3''" Ta "064\ ``4''" .It "\&065\ ``5''" Ta "066\ ``6''" Ta "067\ ``7''" Ta "070\ ``8''" Ta "071\ ``9''" .It "\&101\ ``A''" Ta "102\ ``B''" Ta "103\ ``C''" Ta "104\ ``D''" Ta "105\ ``E''" .It "\&106\ ``F''" Ta "107\ ``G''" Ta "110\ ``H''" Ta "111\ ``I''" Ta "112\ ``J''" .It "\&113\ ``K''" Ta "114\ ``L''" Ta "115\ ``M''" Ta "116\ ``N''" Ta "117\ ``O''" .It "\&120\ ``P''" Ta "121\ ``Q''" Ta "122\ ``R''" Ta "123\ ``S''" Ta "124\ ``T''" .It "\&125\ ``U''" Ta "126\ ``V''" Ta "127\ ``W''" Ta "130\ ``X''" Ta "131\ ``Y''" .It "\&132\ ``Z''" Ta "141\ ``a''" Ta "142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" .It "\&145\ ``e''" Ta "146\ ``f''" Ta "147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" .It "\&152\ ``j''" Ta "153\ ``k''" Ta "154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" .It "\&157\ ``o''" Ta "160\ ``p''" Ta "161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" .It "\&164\ ``t''" Ta "165\ ``u''" Ta "166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" .It "\&171\ ``y''" Ta "172\ ``z''" Ta \& Ta \& Ta \& .El .Pp The .Fn isalnum_l function takes an explicit locale argument, whereas the .Fn isalnum function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isalnum function returns zero if the character tests false and returns non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswalnum function should be used instead. .Sh SEE ALSO .Xr ctype 3 , .Xr isalpha 3 , .Xr isdigit 3 , .Xr iswalnum 3 , .Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isalnum function conforms to .St -isoC . The .Fn isalnum_l function conforms to .St -p1003.1-2008 . +.Sh HISTORY +The +.Fn isalnum +function first appeared in +.At v7 . diff --git a/lib/libc/locale/isascii.3 b/lib/libc/locale/isascii.3 index 933293ca8895..1d5d282a4fb3 100644 --- a/lib/libc/locale/isascii.3 +++ b/lib/libc/locale/isascii.3 @@ -1,53 +1,58 @@ .\" 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. 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. .\" .\" @(#)isascii.3 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd October 6, 2002 +.Dd April 2, 2022 .Dt ISASCII 3 .Os .Sh NAME .Nm isascii .Nd test for ASCII character .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isascii "int c" .Sh DESCRIPTION The .Fn isascii function tests for an .Tn ASCII character, which is any character between 0 and octal 0177 inclusive. .Sh SEE ALSO .Xr ctype 3 , .Xr iswascii 3 , .Xr ascii 7 +.Sh HISTORY +The +.Fn isascii +function first appeared in +.At v7 . diff --git a/lib/libc/locale/iscntrl.3 b/lib/libc/locale/iscntrl.3 index 717e1e568239..b61563735f74 100644 --- a/lib/libc/locale/iscntrl.3 +++ b/lib/libc/locale/iscntrl.3 @@ -1,103 +1,108 @@ .\" 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. 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. .\" .\" @(#)iscntrl.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd April 2, 2022 .Dt ISCNTRL 3 .Os .Sh NAME .Nm iscntrl .Nd control character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn iscntrl "int c" .Ft int .Fn iscntrl_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn iscntrl function tests for any control character. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&000\ NUL" Ta "001\ SOH" Ta "002\ STX" Ta "003\ ETX" Ta "004\ EOT" .It "\&005\ ENQ" Ta "006\ ACK" Ta "007\ BEL" Ta "010\ BS" Ta "011\ HT" .It "\&012\ NL" Ta "013\ VT" Ta "014\ NP" Ta "015\ CR" Ta "016\ SO" .It "\&017\ SI" Ta "020\ DLE" Ta "021\ DC1" Ta "022\ DC2" Ta "023\ DC3" .It "\&024\ DC4" Ta "025\ NAK" Ta "026\ SYN" Ta "027\ ETB" Ta "030\ CAN" .It "\&031\ EM" Ta "032\ SUB" Ta "033\ ESC" Ta "034\ FS" Ta "035\ GS" .It "\&036\ RS" Ta "037\ US" Ta "177\ DEL" Ta \& Ta \& .El .Pp The .Fn iscntrl_l function takes an explicit locale argument, whereas the .Fn iscntrl function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn iscntrl function returns zero if the character tests false and returns non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswcntrl function should be used instead. .Sh SEE ALSO .Xr ctype 3 , .Xr iswcntrl 3 , .Xr xlocale 3 , .Xr ascii 7 .Sh STANDARDS The .Fn iscntrl function conforms to .St -isoC . The .Fn iscntrl_l function conforms to .St -p1003.1-2008 . +.Sh HISTORY +The +.Fn iscntrl +function first appeared in +.At v7 . diff --git a/lib/libc/locale/islower.3 b/lib/libc/locale/islower.3 index 7f31ad9c7c5a..2097510acb93 100644 --- a/lib/libc/locale/islower.3 +++ b/lib/libc/locale/islower.3 @@ -1,103 +1,108 @@ .\" 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. 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. .\" .\" @(#)islower.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 30, 2012 +.Dd April 2, 2022 .Dt ISLOWER 3 .Os .Sh NAME .Nm islower .Nd lower-case character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn islower "int c" .Ft int .Fn islower_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn islower function tests for any lower-case letters. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&141\ ``a''" Ta "142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" Ta "145\ ``e''" .It "\&146\ ``f''" Ta "147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" Ta "152\ ``j''" .It "\&153\ ``k''" Ta "154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" Ta "157\ ``o''" .It "\&160\ ``p''" Ta "161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" Ta "164\ ``t''" .It "\&165\ ``u''" Ta "166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" Ta "171\ ``y''" .It "\&172\ ``z''" Ta \& Ta \& Ta \& Ta \& .El The .Fn islower_l function takes an explicit locale argument, whereas the .Fn islower function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn islower and .Fn islower_l functions return zero if the character tests false and return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswlower function should be used instead. .Sh SEE ALSO .Xr ctype 3 , .Xr iswlower 3 , .Xr tolower 3 , .Xr ascii 7 .Sh STANDARDS The .Fn islower function conforms to .St -isoC . The .Fn islower_l function conforms to .St -p1003.1-2008 . +.Sh HISTORY +The +.Fn islower +function first appeared in +.At v7 . diff --git a/lib/libc/locale/isprint.3 b/lib/libc/locale/isprint.3 index 4a374304dad2..6e740d3e850d 100644 --- a/lib/libc/locale/isprint.3 +++ b/lib/libc/locale/isprint.3 @@ -1,103 +1,108 @@ .\" 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. 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. .\" .\" @(#)isprint.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd April 2, 2022 .Dt ISPRINT 3 .Os .Sh NAME .Nm isprint .Nd printing character test (space character inclusive) .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isprint "int c" .Sh DESCRIPTION The .Fn isprint function tests for any printing character, including space .Pq Ql "\ " . The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&040\ sp" Ta "041\ ``!''" Ta "042\ ``""''" Ta "043\ ``#''" Ta "044\ ``$''" .It "\&045\ ``%''" Ta "046\ ``&''" Ta "047\ ``'''" Ta "050\ ``(''" Ta "051\ ``)''" .It "\&052\ ``*''" Ta "053\ ``+''" Ta "054\ ``,''" Ta "055\ ``-''" Ta "056\ ``.''" .It "\&057\ ``/''" Ta "060\ ``0''" Ta "061\ ``1''" Ta "062\ ``2''" Ta "063\ ``3''" .It "\&064\ ``4''" Ta "065\ ``5''" Ta "066\ ``6''" Ta "067\ ``7''" Ta "070\ ``8''" .It "\&071\ ``9''" Ta "072\ ``:''" Ta "073\ ``;''" Ta "074\ ``<''" Ta "075\ ``=''" .It "\&076\ ``>''" Ta "077\ ``?''" Ta "100\ ``@''" Ta "101\ ``A''" Ta "102\ ``B''" .It "\&103\ ``C''" Ta "104\ ``D''" Ta "105\ ``E''" Ta "106\ ``F''" Ta "107\ ``G''" .It "\&110\ ``H''" Ta "111\ ``I''" Ta "112\ ``J''" Ta "113\ ``K''" Ta "114\ ``L''" .It "\&115\ ``M''" Ta "116\ ``N''" Ta "117\ ``O''" Ta "120\ ``P''" Ta "121\ ``Q''" .It "\&122\ ``R''" Ta "123\ ``S''" Ta "124\ ``T''" Ta "125\ ``U''" Ta "126\ ``V''" .It "\&127\ ``W''" Ta "130\ ``X''" Ta "131\ ``Y''" Ta "132\ ``Z''" Ta "133\ ``[''" .It "\&134\ ``\e\|''" Ta "135\ ``]''" Ta "136\ ``^''" Ta "137\ ``_''" Ta "140\ ```''" .It "\&141\ ``a''" Ta "142\ ``b''" Ta "143\ ``c''" Ta "144\ ``d''" Ta "145\ ``e''" .It "\&146\ ``f''" Ta "147\ ``g''" Ta "150\ ``h''" Ta "151\ ``i''" Ta "152\ ``j''" .It "\&153\ ``k''" Ta "154\ ``l''" Ta "155\ ``m''" Ta "156\ ``n''" Ta "157\ ``o''" .It "\&160\ ``p''" Ta "161\ ``q''" Ta "162\ ``r''" Ta "163\ ``s''" Ta "164\ ``t''" .It "\&165\ ``u''" Ta "166\ ``v''" Ta "167\ ``w''" Ta "170\ ``x''" Ta "171\ ``y''" .It "\&172\ ``z''" Ta "173\ ``{''" Ta "174\ ``|''" Ta "175\ ``}''" Ta "176\ ``~''" .El .Sh RETURN VALUES The .Fn isprint function returns zero if the character tests false and returns non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswprint function should be used instead. .Sh SEE ALSO .Xr ctype 3 , .Xr iswprint 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isprint function conforms to .St -isoC . +.Sh HISTORY +The +.Fn isprint +function first appeared in +.At v7 . diff --git a/lib/libc/locale/ispunct.3 b/lib/libc/locale/ispunct.3 index 7ebfc06c4c87..f0c838d069a3 100644 --- a/lib/libc/locale/ispunct.3 +++ b/lib/libc/locale/ispunct.3 @@ -1,109 +1,114 @@ .\" 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. 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. .\" .\" @(#)ispunct.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 30, 2012 +.Dd April 2, 2022 .Dt ISPUNCT 3 .Os .Sh NAME .Nm ispunct .Nd punctuation character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn ispunct "int c" .Ft int .Fn ispunct_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn ispunct function tests for any printing character except for space .Pq Ql "\ " or a character for which .Xr isalnum 3 is true. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&041\ ``!''" Ta "042\ ``""''" Ta "043\ ``#''" Ta "044\ ``$''" Ta "045\ ``%''" .It "\&046\ ``&''" Ta "047\ ``'''" Ta "050\ ``(''" Ta "051\ ``)''" Ta "052\ ``*''" .It "\&053\ ``+''" Ta "054\ ``,''" Ta "055\ ``-''" Ta "056\ ``.''" Ta "057\ ``/''" .It "\&072\ ``:''" Ta "073\ ``;''" Ta "074\ ``<''" Ta "075\ ``=''" Ta "076\ ``>''" .It "\&077\ ``?''" Ta "100\ ``@''" Ta "133\ ``[''" Ta "134\ ``\e\|''" Ta "135\ ``]''" .It "\&136\ ``^''" Ta "137\ ``_''" Ta "140\ ```''" Ta "173\ ``{''" Ta "174\ ``|''" .It "\&175\ ``}''" Ta "176\ ``~''" Ta \& Ta \& Ta \& .El .Pp The .Fn ispunct_l function takes an explicit locale argument, whereas the .Fn ispunct function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn ispunct and .Fn ispunct_l functions return zero if the character tests false and return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswpunct function should be used instead. .Sh SEE ALSO .Xr ctype 3 , .Xr iswpunct 3 , .Xr ascii 7 .Sh STANDARDS The .Fn ispunct function conforms to .St -isoC . The .Fn ispunct_l function conforms to .St -p1003.1-2008 . +.Sh HISTORY +The +.Fn ispunct +function first appeared in +.At v7 . diff --git a/lib/libc/locale/isspace.3 b/lib/libc/locale/isspace.3 index 9c120c41917a..67eb1b956c83 100644 --- a/lib/libc/locale/isspace.3 +++ b/lib/libc/locale/isspace.3 @@ -1,101 +1,106 @@ .\" 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. 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. .\" .\" @(#)isspace.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 30, 2012 +.Dd April 2, 2022 .Dt ISSPACE 3 .Os .Sh NAME .Nm isspace .Nd white-space character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isspace "int c" .Ft int .Fn isspace_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isspace function tests for white-space characters. For any locale, this includes the following standard characters: .Bl -column \&`\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ \&``\et''___ .It "\&``\et''" Ta "``\en''" Ta "``\ev''" Ta "``\ef''" Ta "``\er''" Ta "`` ''" .El .Pp In the "C" locale, .Fn isspace returns non-zero for these characters only. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp The .Fn isspace_l function takes an explicit locale argument, whereas the .Fn isspace function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isspace and .Fn isspace_l functions return zero if the character tests false and return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswspace function should be used instead. .Sh SEE ALSO .Xr ctype 3 , .Xr iswspace 3 , .Xr multibyte 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isspace function conforms to .St -isoC . The .Fn isspace_l function conforms to .St -p1003.1-2008 . +.Sh HISTORY +The +.Fn isspace +function first appeared in +.At v7 . diff --git a/lib/libc/locale/isupper.3 b/lib/libc/locale/isupper.3 index 891ba2cffa40..a26fc9c610a9 100644 --- a/lib/libc/locale/isupper.3 +++ b/lib/libc/locale/isupper.3 @@ -1,90 +1,95 @@ .\" 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. 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. .\" .\" @(#)isupper.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd April 2, 2022 .Dt ISUPPER 3 .Os .Sh NAME .Nm isupper .Nd upper-case character test .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn isupper "int c" .Sh DESCRIPTION The .Fn isupper function tests for any upper-case letter. The value of the argument must be representable as an .Vt "unsigned char" or the value of .Dv EOF . .Pp In the ASCII character set, this includes the following characters (with their numeric values shown in octal): .Bl -column \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ \&000_``0''__ .It "\&101\ ``A''" Ta "102\ ``B''" Ta "103\ ``C''" Ta "104\ ``D''" Ta "105\ ``E''" .It "\&106\ ``F''" Ta "107\ ``G''" Ta "110\ ``H''" Ta "111\ ``I''" Ta "112\ ``J''" .It "\&113\ ``K''" Ta "114\ ``L''" Ta "115\ ``M''" Ta "116\ ``N''" Ta "117\ ``O''" .It "\&120\ ``P''" Ta "121\ ``Q''" Ta "122\ ``R''" Ta "123\ ``S''" Ta "124\ ``T''" .It "\&125\ ``U''" Ta "126\ ``V''" Ta "127\ ``W''" Ta "130\ ``X''" Ta "131\ ``Y''" .It "\&132\ ``Z''" Ta \& Ta \& Ta \& Ta \& .El .Sh RETURN VALUES The .Fn isupper function returns zero if the character tests false and returns non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 extension of accepting arguments outside of the range of the .Vt "unsigned char" type in locales with large character sets is considered obsolete and may not be supported in future releases. The .Fn iswupper function should be used instead. .Sh SEE ALSO .Xr ctype 3 , .Xr iswupper 3 , .Xr toupper 3 , .Xr ascii 7 .Sh STANDARDS The .Fn isupper function conforms to .St -isoC . +.Sh HISTORY +The +.Fn isupper +function first appeared in +.At v7 . diff --git a/lib/libc/stdio/ferror.3 b/lib/libc/stdio/ferror.3 index 1ff0dc48b8ff..51dbc386a84b 100644 --- a/lib/libc/stdio/ferror.3 +++ b/lib/libc/stdio/ferror.3 @@ -1,131 +1,140 @@ .\" 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 .\" Chris Torek and 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. 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. .\" .\" @(#)ferror.3 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd January 28, 2009 +.Dd April 2, 2022 .Dt FERROR 3 .Os .Sh NAME .Nm clearerr , .Nm clearerr_unlocked , .Nm feof , .Nm feof_unlocked , .Nm ferror , .Nm ferror_unlocked , .Nm fileno , .Nm fileno_unlocked .Nd check and reset stream status .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In stdio.h .Ft void .Fn clearerr "FILE *stream" .Ft void .Fn clearerr_unlocked "FILE *stream" .Ft int .Fn feof "FILE *stream" .Ft int .Fn feof_unlocked "FILE *stream" .Ft int .Fn ferror "FILE *stream" .Ft int .Fn ferror_unlocked "FILE *stream" .Ft int .Fn fileno "FILE *stream" .Ft int .Fn fileno_unlocked "FILE *stream" .Sh DESCRIPTION The function .Fn clearerr clears the end-of-file and error indicators for the stream pointed to by .Fa stream . .Pp The function .Fn feof tests the end-of-file indicator for the stream pointed to by .Fa stream , returning non-zero if it is set. The end-of-file indicator may be cleared by explicitly calling .Fn clearerr , or as a side-effect of other operations, e.g.\& .Fn fseek . .Pp The function .Fn ferror tests the error indicator for the stream pointed to by .Fa stream , returning non-zero if it is set. .Pp The function .Fn fileno examines the argument .Fa stream and returns its integer descriptor. .Pp The .Fn clearerr_unlocked , .Fn feof_unlocked , .Fn ferror_unlocked , and .Fn fileno_unlocked functions are equivalent to .Fn clearerr , .Fn feof , .Fn ferror , and .Fn fileno respectively, except that the caller is responsible for locking the stream with .Xr flockfile 3 before calling them. These functions may be used to avoid the overhead of locking the stream and to prevent races when multiple threads are operating on the same stream. .Sh ERRORS These functions should not fail and do not set the external variable .Va errno . .Sh SEE ALSO .Xr open 2 , .Xr fdopen 3 , .Xr flockfile 3 , .Xr stdio 3 .Sh STANDARDS The functions .Fn clearerr , .Fn feof , and .Fn ferror conform to .St -isoC . +.Sh HISTORY +The functions +.Fn clearerr , +.Fn feof , +.Fn ferror , +and +.Fn fileno +first appeared in +.At v7 . diff --git a/lib/libc/stdio/fgets.3 b/lib/libc/stdio/fgets.3 index 8b4bd388b7e3..0f48273b0ea8 100644 --- a/lib/libc/stdio/fgets.3 +++ b/lib/libc/stdio/fgets.3 @@ -1,149 +1,156 @@ .\" 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 .\" Chris Torek and 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. 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. .\" .\" @(#)fgets.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 1, 2019 +.Dd April 2, 2022 .Dt FGETS 3 .Os .Sh NAME .Nm fgets , .Nm gets_s .Nd get a line from a stream .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In stdio.h .Ft char * .Fn fgets "char * restrict str" "int size" "FILE * restrict stream" .Ft char * .Fn gets_s "char *str" "rsize_t size" .Sh DESCRIPTION The .Fn fgets function reads at most one less than the number of characters specified by .Fa size from the given .Fa stream and stores them in the string .Fa str . Reading stops when a newline character is found, at end-of-file or error. The newline, if any, is retained. If any characters are read and there is no error, a .Ql \e0 character is appended to end the string. .Pp The .Fn gets_s function is equivalent to .Fn fgets with a .Fa stream of .Dv stdin , except that the newline character (if any) is not stored in the string. .Pp The .Fn gets function was unsafe and is no longer available. .Sh RETURN VALUES Upon successful completion, .Fn fgets and .Fn gets_s return a pointer to the string. If end-of-file occurs before any characters are read, they return .Dv NULL and the buffer contents remain unchanged. If an error occurs, they return .Dv NULL and the buffer contents are indeterminate. The .Fn fgets and .Fn gets_s functions do not distinguish between end-of-file and error, and callers must use .Xr feof 3 and .Xr ferror 3 to determine which occurred. .Sh ERRORS .Bl -tag -width Er .It Bq Er EBADF The given .Fa stream is not a readable stream. .El .Pp The function .Fn fgets may also fail and set .Va errno for any of the errors specified for the routines .Xr fflush 3 , .Xr fstat 2 , .Xr read 2 , or .Xr malloc 3 . .Pp The function .Fn gets_s may also fail and set .Va errno for any of the errors specified for the routine .Xr getchar 3 . .Sh SEE ALSO .Xr feof 3 , .Xr ferror 3 , .Xr fgetln 3 , .Xr fgetws 3 , .Xr getline 3 .Sh STANDARDS The .Fn fgets function conforms to .St -isoC-99 . .Fn gets_s conforms to .St -isoC-2011 K.3.7.4.1. .Fn gets has been removed from .St -isoC-2011 . +.Sh HISTORY +The functions +.Fn fgets +and +.Fn gets +first appeared in +.At v7 . diff --git a/lib/libc/stdio/fread.3 b/lib/libc/stdio/fread.3 index 925f382939d9..19c4feab42b9 100644 --- a/lib/libc/stdio/fread.3 +++ b/lib/libc/stdio/fread.3 @@ -1,126 +1,133 @@ .\" 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 .\" Chris Torek and 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. 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. .\" .\" @(#)fread.3 8.2 (Berkeley) 3/8/94 .\" $FreeBSD$ .\" -.Dd January 23, 2020 +.Dd April 2, 2022 .Dt FREAD 3 .Os .Sh NAME .Nm fread , .Nm fread_unlocked , .Nm fwrite , .Nm fwrite_unlocked .Nd binary stream input/output .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In stdio.h .Ft size_t .Fn fread "void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream" .Ft size_t .Fn fread_unlocked "void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream" .Ft size_t .Fn fwrite "const void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream" .Ft size_t .Fn fwrite_unlocked "const void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream" .Sh DESCRIPTION The function .Fn fread reads .Fa nmemb objects, each .Fa size bytes long, from the stream pointed to by .Fa stream , storing them at the location given by .Fa ptr . .Pp The function .Fn fwrite writes .Fa nmemb objects, each .Fa size bytes long, to the stream pointed to by .Fa stream , obtaining them from the location given by .Fa ptr . .Pp The .Fn fread_unlocked and .Fn fwrite_unlocked functions are equivalent to .Fn fread and .Fn fwrite respectively, except that the caller is responsible for locking the stream with .Xr flockfile 3 before calling them. These functions may be used to avoid the overhead of locking the stream and to prevent races when multiple threads are operating on the same stream. .Sh RETURN VALUES The functions .Fn fread and .Fn fwrite advance the file position indicator for the stream by the number of bytes read or written. They return the number of objects read or written. If an error occurs, or the end-of-file is reached, the return value is a short object count (or zero). .Pp The function .Fn fread does not distinguish between end-of-file and error, and callers must use .Xr feof 3 and .Xr ferror 3 to determine which occurred. The function .Fn fwrite returns a value less than .Fa nmemb only if a write error has occurred. .Sh SEE ALSO .Xr read 2 , .Xr write 2 .Sh STANDARDS The functions .Fn fread and .Fn fwrite conform to .St -isoC . +.Sh HISTORY +The functions +.Fn fread +and +.Fn fwrite +first appeared in +.At v7 . diff --git a/lib/libc/stdio/fseek.3 b/lib/libc/stdio/fseek.3 index 19831f773e4e..a23ddeae8a6d 100644 --- a/lib/libc/stdio/fseek.3 +++ b/lib/libc/stdio/fseek.3 @@ -1,269 +1,277 @@ .\" 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 .\" Chris Torek and 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. 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. .\" .\" @(#)fseek.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 19, 2004 +.Dd April 2, 2022 .Dt FSEEK 3 .Os .Sh NAME .Nm fgetpos , .Nm fseek , .Nm fseeko , .Nm fsetpos , .Nm ftell , .Nm ftello , .Nm rewind .Nd reposition a stream .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In stdio.h .Ft int .Fn fseek "FILE *stream" "long offset" "int whence" .Ft long .Fn ftell "FILE *stream" .Ft void .Fn rewind "FILE *stream" .Ft int .Fn fgetpos "FILE * restrict stream" "fpos_t * restrict pos" .Ft int .Fn fsetpos "FILE *stream" "const fpos_t *pos" .In sys/types.h .Ft int .Fn fseeko "FILE *stream" "off_t offset" "int whence" .Ft off_t .Fn ftello "FILE *stream" .Sh DESCRIPTION The .Fn fseek function sets the file position indicator for the stream pointed to by .Fa stream . The new position, measured in bytes, is obtained by adding .Fa offset bytes to the position specified by .Fa whence . If .Fa whence is set to .Dv SEEK_SET , .Dv SEEK_CUR , or .Dv SEEK_END , the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. A successful call to the .Fn fseek function clears the end-of-file indicator for the stream and undoes any effects of the .Xr ungetc 3 and .Xr ungetwc 3 functions on the same stream. .Pp The .Fn ftell function obtains the current value of the file position indicator for the stream pointed to by .Fa stream . .Pp The .Fn rewind function sets the file position indicator for the stream pointed to by .Fa stream to the beginning of the file. It is equivalent to: .Pp .Dl (void)fseek(stream, 0L, SEEK_SET) .Pp except that the error indicator for the stream is also cleared (see .Xr clearerr 3 ) . .Pp Since .Fn rewind does not return a value, an application wishing to detect errors should clear .Va errno , then call .Fn rewind , and if .Va errno is non-zero, assume an error has occurred. .Pp The .Fn fseeko function is identical to .Fn fseek , except it takes an .Fa off_t argument instead of a .Fa long . Likewise, the .Fn ftello function is identical to .Fn ftell , except it returns an .Fa off_t . .Pp The .Fn fgetpos and .Fn fsetpos functions are alternate interfaces for retrieving and setting the current position in the file, similar to .Fn ftell and .Fn fseek , except that the current position is stored in an opaque object of type .Vt fpos_t pointed to by .Fa pos . These functions provide a portable way to seek to offsets larger than those that can be represented by a .Vt long int . They may also store additional state information in the .Vt fpos_t object to facilitate seeking within files containing multibyte characters with state-dependent encodings. Although .Vt fpos_t has traditionally been an integral type, applications cannot assume that it is; in particular, they must not perform arithmetic on objects of this type. .Pp If the stream is a wide character stream (see .Xr fwide 3 ) , the position specified by the combination of .Fa offset and .Fa whence must contain the first byte of a multibyte sequence. .Sh RETURN VALUES The .Fn rewind function returns no value. .Pp .Rv -std fgetpos fseek fseeko fsetpos .Pp Upon successful completion, .Fn ftell and .Fn ftello return the current offset. 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 EBADF The .Fa stream argument is not a seekable stream. .It Bq Er EINVAL The .Fa whence argument is invalid or the resulting file-position indicator would be set to a negative value. .It Bq Er EOVERFLOW The resulting file offset would be a value which cannot be represented correctly in an object of type .Fa off_t for .Fn fseeko and .Fn ftello or .Fa long for .Fn fseek and .Fn ftell . .It Bq Er ESPIPE The file descriptor underlying stream is associated with a pipe or FIFO or file-position indicator value is unspecified (see .Xr ungetc 3 ) . .El .Pp The functions .Fn fgetpos , .Fn fseek , .Fn fseeko , .Fn fsetpos , .Fn ftell , .Fn ftello , and .Fn rewind may also fail and set .Va errno for any of the errors specified for the routines .Xr fflush 3 , .Xr fstat 2 , .Xr lseek 2 , and .Xr malloc 3 . .Sh SEE ALSO .Xr lseek 2 , .Xr clearerr 3 , .Xr fwide 3 , .Xr ungetc 3 , .Xr ungetwc 3 .Sh STANDARDS The .Fn fgetpos , .Fn fsetpos , .Fn fseek , .Fn ftell , and .Fn rewind functions conform to .St -isoC . .Pp The .Fn fseeko and .Fn ftello functions conform to .St -p1003.1-2001 . +.Sh HISTORY +The functions +.Fn fseek , +.Fn ftell , +and +.Fn rewind +first appeared in +.At v7 . diff --git a/lib/libc/stdio/scanf.3 b/lib/libc/stdio/scanf.3 index bcf68205ae78..4a8efdbb3726 100644 --- a/lib/libc/stdio/scanf.3 +++ b/lib/libc/stdio/scanf.3 @@ -1,513 +1,528 @@ .\" 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 .\" Chris Torek and 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. 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. .\" .\" @(#)scanf.3 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 4, 2003 +.Dd April 2, 2022 .Dt SCANF 3 .Os .Sh NAME .Nm scanf , .Nm fscanf , .Nm sscanf , .Nm vscanf , .Nm vsscanf , .Nm vfscanf .Nd input format conversion .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In stdio.h .Ft int .Fn scanf "const char * restrict format" ... .Ft int .Fn fscanf "FILE * restrict stream" "const char * restrict format" ... .Ft int .Fn sscanf "const char * restrict str" "const char * restrict format" ... .In stdarg.h .Ft int .Fn vscanf "const char * restrict format" "va_list ap" .Ft int .Fn vsscanf "const char * restrict str" "const char * restrict format" "va_list ap" .Ft int .Fn vfscanf "FILE * restrict stream" "const char * restrict format" "va_list ap" .Sh DESCRIPTION The .Fn scanf family of functions scans input according to a .Fa format as described below. This format may contain .Em conversion specifiers ; the results from such conversions, if any, are stored through the .Em pointer arguments. The .Fn scanf function reads input from the standard input stream .Dv stdin , .Fn fscanf reads input from the stream pointer .Fa stream , and .Fn sscanf reads its input from the character string pointed to by .Fa str . The .Fn vfscanf function is analogous to .Xr vfprintf 3 and reads input from the stream pointer .Fa stream using a variable argument list of pointers (see .Xr stdarg 3 ) . The .Fn vscanf function scans a variable argument list from the standard input and the .Fn vsscanf function scans it from a string; these are analogous to the .Fn vprintf and .Fn vsprintf functions respectively. Each successive .Em pointer argument must correspond properly with each successive conversion specifier (but see the .Cm * conversion below). All conversions are introduced by the .Cm % (percent sign) character. The .Fa format string may also contain other characters. White space (such as blanks, tabs, or newlines) in the .Fa format string match any amount of white space, including none, in the input. Everything else matches only itself. Scanning stops when an input character does not match such a format character. Scanning also stops when an input conversion cannot be made (see below). .Sh CONVERSIONS Following the .Cm % character introducing a conversion there may be a number of .Em flag characters, as follows: .Bl -tag -width ".Cm l No (ell)" .It Cm * Suppresses assignment. The conversion that follows occurs as usual, but no pointer is used; the result of the conversion is simply discarded. .It Cm hh Indicates that the conversion will be one of .Cm dioux or .Cm n and the next pointer is a pointer to a .Vt char (rather than .Vt int ) . .It Cm h Indicates that the conversion will be one of .Cm dioux or .Cm n and the next pointer is a pointer to a .Vt "short int" (rather than .Vt int ) . .It Cm l No (ell) Indicates that the conversion will be one of .Cm dioux or .Cm n and the next pointer is a pointer to a .Vt "long int" (rather than .Vt int ) , that the conversion will be one of .Cm a , e , f , or .Cm g and the next pointer is a pointer to .Vt double (rather than .Vt float ) , or that the conversion will be one of .Cm c , .Cm s or .Cm \&[ and the next pointer is a pointer to an array of .Vt wchar_t (rather than .Vt char ) . .It Cm ll No (ell ell) Indicates that the conversion will be one of .Cm dioux or .Cm n and the next pointer is a pointer to a .Vt "long long int" (rather than .Vt int ) . .It Cm L Indicates that the conversion will be one of .Cm a , e , f , or .Cm g and the next pointer is a pointer to .Vt "long double" . .It Cm j Indicates that the conversion will be one of .Cm dioux or .Cm n and the next pointer is a pointer to a .Vt intmax_t (rather than .Vt int ) . .It Cm t Indicates that the conversion will be one of .Cm dioux or .Cm n and the next pointer is a pointer to a .Vt ptrdiff_t (rather than .Vt int ) . .It Cm z Indicates that the conversion will be one of .Cm dioux or .Cm n and the next pointer is a pointer to a .Vt size_t (rather than .Vt int ) . .It Cm q (deprecated.) Indicates that the conversion will be one of .Cm dioux or .Cm n and the next pointer is a pointer to a .Vt "long long int" (rather than .Vt int ) . .El .Pp In addition to these flags, there may be an optional maximum field width, expressed as a decimal integer, between the .Cm % and the conversion. If no width is given, a default of .Dq infinity is used (with one exception, below); otherwise at most this many bytes are scanned in processing the conversion. In the case of the .Cm lc , .Cm ls and .Cm l[ conversions, the field width specifies the maximum number of multibyte characters that will be scanned. Before conversion begins, most conversions skip white space; this white space is not counted against the field width. .Pp The following conversions are available: .Bl -tag -width XXXX .It Cm % Matches a literal .Ql % . That is, .Dq Li %% in the format string matches a single input .Ql % character. No conversion is done, and assignment does not occur. .It Cm d Matches an optionally signed decimal integer; the next pointer must be a pointer to .Vt int . .It Cm i Matches an optionally signed integer; the next pointer must be a pointer to .Vt int . The integer is read in base 16 if it begins with .Ql 0x or .Ql 0X , in base 8 if it begins with .Ql 0 , and in base 10 otherwise. Only characters that correspond to the base are used. .It Cm o Matches an octal integer; the next pointer must be a pointer to .Vt "unsigned int" . .It Cm u Matches an optionally signed decimal integer; the next pointer must be a pointer to .Vt "unsigned int" . .It Cm x , X Matches an optionally signed hexadecimal integer; the next pointer must be a pointer to .Vt "unsigned int" . .It Cm a , A , e , E , f , F , g , G Matches a floating-point number in the style of .Xr strtod 3 . The next pointer must be a pointer to .Vt float (unless .Cm l or .Cm L is specified.) .It Cm s Matches a sequence of non-white-space characters; the next pointer must be a pointer to .Vt char , and the array must be large enough to accept all the sequence and the terminating .Dv NUL character. The input string stops at white space or at the maximum field width, whichever occurs first. .Pp If an .Cm l qualifier is present, the next pointer must be a pointer to .Vt wchar_t , into which the input will be placed after conversion by .Xr mbrtowc 3 . .It Cm S The same as .Cm ls . .It Cm c Matches a sequence of .Em width count characters (default 1); the next pointer must be a pointer to .Vt char , and there must be enough room for all the characters (no terminating .Dv NUL is added). The usual skip of leading white space is suppressed. To skip white space first, use an explicit space in the format. .Pp If an .Cm l qualifier is present, the next pointer must be a pointer to .Vt wchar_t , into which the input will be placed after conversion by .Xr mbrtowc 3 . .It Cm C The same as .Cm lc . .It Cm \&[ Matches a nonempty sequence of characters from the specified set of accepted characters; the next pointer must be a pointer to .Vt char , and there must be enough room for all the characters in the string, plus a terminating .Dv NUL character. The usual skip of leading white space is suppressed. The string is to be made up of characters in (or not in) a particular set; the set is defined by the characters between the open bracket .Cm \&[ character and a close bracket .Cm \&] character. The set .Em excludes those characters if the first character after the open bracket is a circumflex .Cm ^ . To include a close bracket in the set, make it the first character after the open bracket or the circumflex; any other position will end the set. The hyphen character .Cm - is also special; when placed between two other characters, it adds all intervening characters to the set. To include a hyphen, make it the last character before the final close bracket. For instance, .Ql [^]0-9-] means the set .Dq "everything except close bracket, zero through nine, and hyphen" . The string ends with the appearance of a character not in the (or, with a circumflex, in) set or when the field width runs out. .Pp If an .Cm l qualifier is present, the next pointer must be a pointer to .Vt wchar_t , into which the input will be placed after conversion by .Xr mbrtowc 3 . .It Cm p Matches a pointer value (as printed by .Ql %p in .Xr printf 3 ) ; the next pointer must be a pointer to .Vt void . .It Cm n Nothing is expected; instead, the number of characters consumed thus far from the input is stored through the next pointer, which must be a pointer to .Vt int . This is .Em not a conversion, although it can be suppressed with the .Cm * flag. .El .Pp The decimal point character is defined in the program's locale (category .Dv LC_NUMERIC ) . .Pp For backwards compatibility, a .Dq conversion of .Ql %\e0 causes an immediate return of .Dv EOF . .Sh RETURN VALUES These functions return the number of input items assigned, which can be fewer than provided for, or even zero, in the event of a matching failure. Zero indicates that, while there was input available, no conversions were assigned; typically this is due to an invalid input character, such as an alphabetic character for a .Ql %d conversion. The value .Dv EOF is returned if an input failure occurs before any conversion such as an end-of-file occurs. If an error or end-of-file occurs after conversion has begun, the number of conversions which were successfully completed is returned. .Sh SEE ALSO .Xr getc 3 , .Xr mbrtowc 3 , .Xr printf 3 , .Xr strtod 3 , .Xr strtol 3 , .Xr strtoul 3 , .Xr wscanf 3 .Sh STANDARDS The functions .Fn fscanf , .Fn scanf , .Fn sscanf , .Fn vfscanf , .Fn vscanf and .Fn vsscanf conform to .St -isoC-99 . +.Sh HISTORY +The functions +.Fn scanf , +.Fn fscanf , +and +.Fn sscanf +first appeared in +.At v7 , +and +.Fn vscanf , +.Fn vsscanf , +and +.Fn vfscanf +in +.Bx 4.3 Reno . .Sh BUGS Earlier implementations of .Nm treated .Cm \&%D , \&%E , \&%F , \&%O and .Cm \&%X as their lowercase equivalents with an .Cm l modifier. In addition, .Nm treated an unknown conversion character as .Cm \&%d or .Cm \&%D , depending on its case. This functionality has been removed. .Pp Numerical strings are truncated to 512 characters; for example, .Cm %f and .Cm %d are implicitly .Cm %512f and .Cm %512d . .Pp The .Cm %n$ modifiers for positional arguments are not implemented. .Pp The .Nm family of functions do not correctly handle multibyte characters in the .Fa format argument. diff --git a/lib/libc/stdlib/abs.3 b/lib/libc/stdlib/abs.3 index eca85e1e7a59..36a6ff7a3639 100644 --- a/lib/libc/stdlib/abs.3 +++ b/lib/libc/stdlib/abs.3 @@ -1,75 +1,80 @@ .\" 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. 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. .\" .\" @(#)abs.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 14, 2001 +.Dd April 3, 2022 .Dt ABS 3 .Os .Sh NAME .Nm abs .Nd integer absolute value function .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In stdlib.h .Ft int .Fn abs "int j" .Sh DESCRIPTION The .Fn abs function computes the absolute value of the integer .Fa j . .Sh RETURN VALUES The .Fn abs function returns the absolute value. .Sh SEE ALSO .Xr cabs 3 , .Xr fabs 3 , .Xr floor 3 , .Xr hypot 3 , .Xr imaxabs 3 , .Xr labs 3 , .Xr llabs 3 , .Xr math 3 .Sh STANDARDS The .Fn abs function conforms to .St -isoC-99 . +.Sh HISTORY +The +.Fn abs +function first appeared in +.At v6 . .Sh BUGS The absolute value of the most negative integer remains negative. diff --git a/lib/libc/stdlib/ldiv.3 b/lib/libc/stdlib/ldiv.3 index ce4d01771b11..4e9873f2f874 100644 --- a/lib/libc/stdlib/ldiv.3 +++ b/lib/libc/stdlib/ldiv.3 @@ -1,71 +1,77 @@ .\" 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 .\" Chris Torek and 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. 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. .\" .\" @(#)ldiv.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 14, 2001 +.Dd April 3, 2022 .Dt LDIV 3 .Os .Sh NAME .Nm ldiv .Nd return quotient and remainder from division .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In stdlib.h .Ft ldiv_t .Fn ldiv "long num" "long denom" .Sh DESCRIPTION The .Fn ldiv function computes the value .Fa num Ns / Ns Fa denom and returns the quotient and remainder in a structure named .Vt ldiv_t that contains two .Vt long members named .Va quot and .Va rem . .Sh SEE ALSO .Xr div 3 , .Xr imaxdiv 3 , .Xr lldiv 3 , .Xr math 3 .Sh STANDARDS The .Fn ldiv function conforms to .St -isoC-99 . +.Sh HISTORY +An +.Fn ldiv +function with similar functionality, but a different calling convention, +first appeared in +.At v4 . diff --git a/lib/libc/string/strcat.3 b/lib/libc/string/strcat.3 index a6d0fcef61f0..500611eb2154 100644 --- a/lib/libc/string/strcat.3 +++ b/lib/libc/string/strcat.3 @@ -1,165 +1,174 @@ .\" 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 .\" Chris Torek and 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. 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. .\" .\" @(#)strcat.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 1, 2009 +.Dd April 3, 2022 .Dt STRCAT 3 .Os .Sh NAME .Nm strcat , .Nm strncat .Nd concatenate strings .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In string.h .Ft char * .Fn strcat "char * restrict s" "const char * restrict append" .Ft char * .Fn strncat "char * restrict s" "const char * restrict append" "size_t count" .Sh DESCRIPTION The .Fn strcat and .Fn strncat functions append a copy of the null-terminated string .Fa append to the end of the null-terminated string .Fa s , then add a terminating .Ql \e0 . The string .Fa s must have sufficient space to hold the result. If .Fa s and .Fa append overlap, the results are undefined. .Pp The .Fn strncat function appends not more than .Fa count characters from .Fa append , and then adds a terminating .Ql \e0 . If .Fa s and .Fa append overlap, the results are undefined. .Sh RETURN VALUES The .Fn strcat and .Fn strncat functions return the pointer .Fa s . .Sh SEE ALSO .Xr bcopy 3 , .Xr memccpy 3 , .Xr memcpy 3 , .Xr memmove 3 , .Xr strcpy 3 , .Xr strlcat 3 , .Xr strlcpy 3 , .Xr wcscat 3 .Sh STANDARDS The .Fn strcat and .Fn strncat functions conform to .St -isoC . +.Sh HISTORY +The +.Fn strcat +function first appeared in the Programmer's Workbench (PWB/UNIX) +and was ported to +.At v7 ; +.Fn strncat +first appeared in +.At v7 . .Sh SECURITY CONSIDERATIONS The .Fn strcat function is easily misused in a manner which enables malicious users to arbitrarily change a running program's functionality through a buffer overflow attack. .Pp Avoid using .Fn strcat . Instead, use .Fn strncat or .Fn strlcat and ensure that no more characters are copied to the destination buffer than it can hold. .Pp Note that .Fn strncat can also be problematic. It may be a security concern for a string to be truncated at all. Since the truncated string will not be as long as the original, it may refer to a completely different resource and usage of the truncated resource could result in very incorrect behavior. Example: .Bd -literal void foo(const char *arbitrary_string) { char onstack[8]; #if defined(BAD) /* * This first strcat is bad behavior. Do not use strcat! */ (void)strcat(onstack, arbitrary_string); /* BAD! */ #elif defined(BETTER) /* * The following two lines demonstrate better use of * strncat(). */ (void)strncat(onstack, arbitrary_string, sizeof(onstack) - strlen(onstack) - 1); #elif defined(BEST) /* * These lines are even more robust due to testing for * truncation. */ if (strlen(arbitrary_string) + 1 > sizeof(onstack) - strlen(onstack)) err(1, "onstack would be truncated"); (void)strncat(onstack, arbitrary_string, sizeof(onstack) - strlen(onstack) - 1); #endif } .Ed diff --git a/lib/libc/string/strcmp.3 b/lib/libc/string/strcmp.3 index a79852d2a240..df5d67253032 100644 --- a/lib/libc/string/strcmp.3 +++ b/lib/libc/string/strcmp.3 @@ -1,101 +1,110 @@ .\" 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 .\" Chris Torek and 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. 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. .\" .\" @(#)strcmp.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 11, 2001 +.Dd April 3, 2022 .Dt STRCMP 3 .Os .Sh NAME .Nm strcmp , .Nm strncmp .Nd compare strings .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In string.h .Ft int .Fn strcmp "const char *s1" "const char *s2" .Ft int .Fn strncmp "const char *s1" "const char *s2" "size_t len" .Sh DESCRIPTION The .Fn strcmp and .Fn strncmp functions lexicographically compare the null-terminated strings .Fa s1 and .Fa s2 . .Pp The .Fn strncmp function compares not more than .Fa len characters. Because .Fn strncmp is designed for comparing strings rather than binary data, characters that appear after a .Ql \e0 character are not compared. .Sh RETURN VALUES The .Fn strcmp and .Fn strncmp functions return an integer greater than, equal to, or less than 0, according as the string .Fa s1 is greater than, equal to, or less than the string .Fa s2 . The comparison is done using unsigned characters, so that .Ql \e200 is greater than .Ql \e0 . .Sh SEE ALSO .Xr bcmp 3 , .Xr memcmp 3 , .Xr strcasecmp 3 , .Xr strcoll 3 , .Xr strxfrm 3 , .Xr wcscmp 3 .Sh STANDARDS The .Fn strcmp and .Fn strncmp functions conform to .St -isoC . +.Sh HISTORY +The +.Fn strcmp +function first appeared in the Programmer's Workbench (PWB/UNIX) +and was ported to +.At v7 ; +.Fn strncmp +first appeared in +.At v7 . diff --git a/lib/libc/string/strlen.3 b/lib/libc/string/strlen.3 index bc9b0f3fc0e4..55f7b09a2016 100644 --- a/lib/libc/string/strlen.3 +++ b/lib/libc/string/strlen.3 @@ -1,93 +1,101 @@ .\" 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 .\" Chris Torek and 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. 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. .\" .\" @(#)strlen.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 28, 2009 +.Dd April 3, 2022 .Dt STRLEN 3 .Os .Sh NAME .Nm strlen , .Nm strnlen .Nd find length of string .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In string.h .Ft size_t .Fn strlen "const char *s" .Ft size_t .Fn strnlen "const char *s" "size_t maxlen" .Sh DESCRIPTION The .Fn strlen function computes the length of the string .Fa s . The .Fn strnlen function attempts to compute the length of .Fa s , but never scans beyond the first .Fa maxlen bytes of .Fa s . .Sh RETURN VALUES The .Fn strlen function returns the number of characters that precede the terminating .Dv NUL character. The .Fn strnlen function returns either the same result as .Fn strlen or .Fa maxlen , whichever is smaller. .Sh SEE ALSO .Xr string 3 , .Xr wcslen 3 , .Xr wcswidth 3 .Sh STANDARDS The .Fn strlen function conforms to .St -isoC . The .Fn strnlen function conforms to .St -p1003.1-2008 . +.Sh HISTORY +The +.Fn strlen +function first appeared in the Programmer's Workbench (PWB/UNIX) +and was ported to +.At v7 . +The +.Fn strnlen diff --git a/lib/libc/sys/nanosleep.2 b/lib/libc/sys/nanosleep.2 index eb75c4b1043b..dbc4f3248b27 100644 --- a/lib/libc/sys/nanosleep.2 +++ b/lib/libc/sys/nanosleep.2 @@ -1,205 +1,222 @@ .\" $NetBSD: nanosleep.2,v 1.23 2016/11/14 10:40:59 wiz Exp $ .\" .\" 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. 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$ .\" -.Dd October 7, 2021 +.Dd April 3, 2022 .Dt NANOSLEEP 2 .Os .Sh NAME .Nm nanosleep .Nd high resolution sleep .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In time.h .Ft int .Fo clock_nanosleep .Fa "clockid_t clock_id" .Fa "int flags" .Fa "const struct timespec *rqtp" .Fa "struct timespec *rmtp" .Fc .Ft int .Fo nanosleep .Fa "const struct timespec *rqtp" .Fa "struct timespec *rmtp" .Fc .Sh DESCRIPTION If the .Dv TIMER_ABSTIME flag is not set in the .Fa flags argument, then .Fn clock_nanosleep suspends execution of the calling thread until either the time interval specified by the .Fa rqtp argument has elapsed, or a signal is delivered to the calling process and its action is to invoke a signal-catching function or to terminate the process. The clock used to measure the time is specified by the .Fa clock_id argument. .Pp If the .Dv TIMER_ABSTIME flag is set in the .Fa flags argument, then .Fn clock_nanosleep suspends execution of the calling thread until either the value of the clock specified by the .Fa clock_id argument reaches the absolute time specified by the .Fa rqtp argument, or a signal is delivered to the calling process and its action is to invoke a signal-catching function or to terminate the process. If, at the time of the call, the time value specified by .Fa rqtp is less than or equal to the time value of the specified clock, then .Fn clock_nanosleep returns immediately and the calling thread is not suspended. .Pp The suspension time may be longer than requested due to the scheduling of other activity by the system. It is also subject to the allowed time interval deviation specified by the .Va kern.timecounter.alloweddeviation .Xr sysctl 8 variable. An unmasked signal will terminate the sleep early, regardless of the .Dv SA_RESTART value on the interrupting signal. The .Fa rqtp and .Fa rmtp arguments can point to the same object. .Pp The following .Fa clock_id values are supported: .Pp .Bl -item -compact -offset indent .It CLOCK_MONOTONIC .It CLOCK_MONOTONIC_FAST .It CLOCK_MONOTONIC_PRECISE .It CLOCK_REALTIME .It CLOCK_REALTIME_FAST .It CLOCK_REALTIME_PRECISE .It CLOCK_SECOND .It CLOCK_UPTIME .It CLOCK_UPTIME_FAST .It CLOCK_UPTIME_PRECISE .El .Pp The .Fn nanosleep function behaves like .Fn clock_nanosleep with a .Fa clock_id argument of .Dv CLOCK_REALTIME and without the .Dv TIMER_ABSTIME flag in the .Fa flags argument. .Sh RETURN VALUES These functions return zero when the requested time has elapsed. .Pp If these functions return for any other reason, then .Fn clock_nanosleep will directly return the error number, and .Fn nanosleep will return \-1 with the global variable .Va errno set to indicate the error. If a relative sleep is interrupted by a signal and .Fa rmtp is .Pf non- Dv NULL , the timespec structure it references is updated to contain the unslept amount (the request time minus the time actually slept). .Sh ERRORS These functions can fail with the following errors. .Bl -tag -width Er .It Bq Er EFAULT Either .Fa rqtp or .Fa rmtp points to memory that is not a valid part of the process address space. .It Bq Er EINTR The function was interrupted by the delivery of a signal. .It Bq Er EINVAL The .Fa rqtp argument specified a nanosecond value less than zero or greater than or equal to 1000 million. .It Bq Er EINVAL The .Fa flags argument contained an invalid flag. .It Bq Er EINVAL The .Fa clock_id argument was .Dv CLOCK_THREAD_CPUTIME_ID or an unrecognized value. .It Bq Er ENOTSUP The .Fa clock_id argument was valid but not supported by this implementation of .Fn clock_nanosleep . .El .Sh SEE ALSO .Xr clock_gettime 2 , .Xr sigaction 2 , .Xr sleep 3 .Sh STANDARDS These functions conform to .St -p1003.1-2008 . +.Sh HISTORY +The predecessor of this system call, +.Fn sleep , +appeared in +.At v3 , +but was removed when +.Xr alarm 3 +was introduced into +.At v7 . +The +.Fn nanosleep +system call has been available since +.Nx 1.3 +and was ported to +.Ox 2.1 +and +.Fx 3.0 . diff --git a/lib/msun/man/cosh.3 b/lib/msun/man/cosh.3 index 7db64e661f07..1920e3e57df8 100644 --- a/lib/msun/man/cosh.3 +++ b/lib/msun/man/cosh.3 @@ -1,73 +1,78 @@ .\" Copyright (c) 1989, 1991 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. 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: @(#)cosh.3 5.1 (Berkeley) 5/2/91 .\" $FreeBSD$ .\" -.Dd August 17, 2013 +.Dd April 3, 2022 .Dt COSH 3 .Os .Sh NAME .Nm cosh , .Nm coshf , .Nm coshl .Nd hyperbolic cosine functions .Sh LIBRARY .Lb libm .Sh SYNOPSIS .In math.h .Ft double .Fn cosh "double x" .Ft float .Fn coshf "float x" .Ft long double .Fn coshl "long double x" .Sh DESCRIPTION The .Fn cosh , .Fn coshf , and .Fn coshl functions compute the hyperbolic cosine of .Fa x . .Sh SEE ALSO .Xr acos 3 , .Xr asin 3 , .Xr atan 3 , .Xr atan2 3 , .Xr ccosh 3 , .Xr cos 3 , .Xr math 3 , .Xr sin 3 , .Xr sinh 3 , .Xr tan 3 , .Xr tanh 3 .Sh STANDARDS The .Fn cosh function conforms to .St -isoC . +.Sh HISTORY +The +.Fn cosh +function first appeared in +.At v7 . diff --git a/lib/msun/man/floor.3 b/lib/msun/man/floor.3 index 67640f6f68b8..66b29eb22b97 100644 --- a/lib/msun/man/floor.3 +++ b/lib/msun/man/floor.3 @@ -1,78 +1,83 @@ .\" Copyright (c) 1985, 1991 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. 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: @(#)floor.3 6.5 (Berkeley) 4/19/91 .\" $FreeBSD$ .\" -.Dd January 13, 2005 +.Dd April 3, 2022 .Dt FLOOR 3 .Os .Sh NAME .Nm floor , .Nm floorf , .Nm floorl .Nd largest integral value less than or equal to x .Sh LIBRARY .Lb libm .Sh SYNOPSIS .In math.h .Ft double .Fn floor "double x" .Ft float .Fn floorf "float x" .Ft "long double" .Fn floorl "long double x" .Sh DESCRIPTION The .Fn floor , .Fn floorf and .Fn floorl functions return the largest integral value less than or equal to .Fa x , expressed as a floating-point number. .Sh SEE ALSO .Xr abs 3 , .Xr ceil 3 , .Xr fabs 3 , .Xr ieee 3 , .Xr math 3 , .Xr rint 3 , .Xr round 3 , .Xr trunc 3 .Sh STANDARDS The .Fn floor function conforms to .St -isoC . The .Fn floorf and .Fn floorl functions conform to .St -isoC-99 . +.Sh HISTORY +A +.Fn floor +function first appeared in +.At v5 . diff --git a/lib/msun/man/fmod.3 b/lib/msun/man/fmod.3 index f01aa959e0c8..892ead731256 100644 --- a/lib/msun/man/fmod.3 +++ b/lib/msun/man/fmod.3 @@ -1,87 +1,92 @@ .\" Copyright (c) 1991 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. 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: @(#)fmod.3 5.1 (Berkeley) 5/2/91 .\" $FreeBSD$ .\" -.Dd June 19, 2008 +.Dd April 3, 2022 .Dt FMOD 3 .Os .Sh NAME .Nm fmod , .Nm fmodf , .Nm fmodl .Nd floating-point remainder functions .Sh LIBRARY .Lb libm .Sh SYNOPSIS .In math.h .Ft double .Fn fmod "double x" "double y" .Ft float .Fn fmodf "float x" "float y" .Ft long double .Fn fmodl "long double x" "long double y" .Sh DESCRIPTION The .Fn fmod , .Fn fmodf , and .Fn fmodl functions compute the floating-point remainder of .Fa x Ns / Fa y . .Sh RETURN VALUES If .Fa y is non-zero, the .Fn fmod , .Fn fmodf , and .Fn fmodl functions return the value .Sm off .Fa x - Em i * Fa y , .Sm on for some integer .Em i , such that the result has the same sign as .Fa x and magnitude less than the magnitude of .Fa y . If .Fa y is zero, a \*(Na is produced. .Sh SEE ALSO .Xr math 3 .Sh STANDARDS The .Fn fmod , .Fn fmodf , and .Fn fmodl functions conform to .St -isoC-99 . +.Sh HISTORY +An +.Fn fmod +function first appeared in +.At v5 . diff --git a/lib/msun/man/sinh.3 b/lib/msun/man/sinh.3 index 96fa280f958e..e81ae951c22e 100644 --- a/lib/msun/man/sinh.3 +++ b/lib/msun/man/sinh.3 @@ -1,73 +1,78 @@ .\" Copyright (c) 1991 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. 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: @(#)sinh.3 6.6 (Berkeley) 4/19/91 .\" $FreeBSD$ .\" -.Dd August 17, 2013 +.Dd April 3, 2022 .Dt SINH 3 .Os .Sh NAME .Nm sinh , .Nm sinhf , .Nm sinhl .Nd hyperbolic sine function .Sh LIBRARY .Lb libm .Sh SYNOPSIS .In math.h .Ft double .Fn sinh "double x" .Ft float .Fn sinhf "float x" .Ft long double .Fn sinhl "long double x" .Sh DESCRIPTION The .Fn sinh , .Fn sinhf , and .Fn sinhl functions compute the hyperbolic sine of .Fa x . .Sh SEE ALSO .Xr acos 3 , .Xr asin 3 , .Xr atan 3 , .Xr atan2 3 , .Xr cos 3 , .Xr cosh 3 , .Xr csinh 3 , .Xr math 3 , .Xr sin 3 , .Xr tan 3 , .Xr tanh 3 .Sh STANDARDS The .Fn sinh function conforms to .St -isoC . +.Sh HISTORY +The +.Fn sinh +function first appeared in +.At v7 . diff --git a/lib/msun/man/tanh.3 b/lib/msun/man/tanh.3 index ca59a806b132..6004f5a853ac 100644 --- a/lib/msun/man/tanh.3 +++ b/lib/msun/man/tanh.3 @@ -1,82 +1,87 @@ .\" Copyright (c) 1991 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. 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: @(#)tanh.3 5.1 (Berkeley) 5/2/91 .\" $FreeBSD$ .\" -.Dd August 17, 2013 +.Dd April 3, 2022 .Dt TANH 3 .Os .Sh NAME .Nm tanh , .Nm tanhf , .Nm tanhl .Nd hyperbolic tangent functions .Sh LIBRARY .Lb libm .Sh SYNOPSIS .In math.h .Ft double .Fn tanh "double x" .Ft float .Fn tanhf "float x" .Ft long double .Fn tanhl "long double x" .Sh DESCRIPTION The .Fn tanh , .Fn tanhf , and .Fn tanhl functions compute the hyperbolic tangent of .Fa x . For a discussion of error due to roundoff, see .Xr math 3 . .Sh RETURN VALUES The .Fn tanh , .Fn tanhf , and the .Fn tanhl functions return the hyperbolic tangent value. .Sh SEE ALSO .Xr acos 3 , .Xr asin 3 , .Xr atan 3 , .Xr atan2 3 , .Xr cos 3 , .Xr cosh 3 , .Xr ctanh 3 , .Xr math 3 , .Xr sin 3 , .Xr sinh 3 , .Xr tan 3 .Sh STANDARDS The .Fn tanh function conforms to .St -isoC . +.Sh HISTORY +The +.Fn tanh +function first appeared in +.At v7 .