diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 1999-05-29 22:38:38 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 1999-05-29 22:38:38 +0000 |
commit | 433594a7d76d560485c3bdb52ab87c64b008e168 (patch) | |
tree | 5345f18b21ad05187d084366eb8668da984821da | |
parent | e995764d51674c3bfd0717fdfbf24af85952e88e (diff) |
repairs; go back over some old files, because we should properly distinguish
between NUL and NULL, i.e., don't use the .Dv (defined variable) macro when
referring to an ASCII NUL
-rw-r--r-- | lib/libc/gen/confstr.3 | 5 | ||||
-rw-r--r-- | lib/libc/gen/exec.3 | 12 | ||||
-rw-r--r-- | lib/libc/gen/fts.3 | 12 | ||||
-rw-r--r-- | lib/libc/gen/getbsize.3 | 5 | ||||
-rw-r--r-- | lib/libc/gen/getcap.3 | 5 | ||||
-rw-r--r-- | lib/libc/gen/getdomainname.3 | 5 | ||||
-rw-r--r-- | lib/libc/gen/gethostname.3 | 5 | ||||
-rw-r--r-- | lib/libc/gen/getpass.3 | 6 | ||||
-rw-r--r-- | lib/libc/gen/glob.3 | 5 | ||||
-rw-r--r-- | lib/libc/gen/popen.3 | 8 | ||||
-rw-r--r-- | lib/libc/gen/time.3 | 10 | ||||
-rw-r--r-- | lib/libc/gen/times.3 | 16 | ||||
-rw-r--r-- | lib/libc/gen/timezone.3 | 25 | ||||
-rw-r--r-- | lib/libc/gen/ttyname.3 | 21 | ||||
-rw-r--r-- | lib/libc/gen/ualarm.3 | 10 | ||||
-rw-r--r-- | lib/libc/gen/uname.3 | 19 | ||||
-rw-r--r-- | lib/libc/gen/unvis.3 | 55 | ||||
-rw-r--r-- | lib/libc/gen/usleep.3 | 14 | ||||
-rw-r--r-- | lib/libc/gen/utime.3 | 28 | ||||
-rw-r--r-- | lib/libc/gen/valloc.3 | 16 | ||||
-rw-r--r-- | lib/libc/gen/vis.3 | 58 |
21 files changed, 173 insertions, 167 deletions
diff --git a/lib/libc/gen/confstr.3 b/lib/libc/gen/confstr.3 index 4c79893c58d..e3e1453dfe3 100644 --- a/lib/libc/gen/confstr.3 +++ b/lib/libc/gen/confstr.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: confstr.3,v 1.7 1999/05/29 16:08:54 aaron Exp $ +.\" $OpenBSD: confstr.3,v 1.8 1999/05/29 22:38:33 aaron Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -74,8 +74,7 @@ has a value; up to .Fa len \- 1 bytes of the value are copied into the buffer .Fa buf . -The copied value is always -.Dv NULL Ns -terminated. +The copied value is always NUL-terminated. .Pp The available values are as follows: .Pp diff --git a/lib/libc/gen/exec.3 b/lib/libc/gen/exec.3 index e1d40d9dfb0..d3faad22c75 100644 --- a/lib/libc/gen/exec.3 +++ b/lib/libc/gen/exec.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: exec.3,v 1.6 1999/05/29 16:08:54 aaron Exp $ +.\" $OpenBSD: exec.3,v 1.7 1999/05/29 22:38:33 aaron Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -84,7 +84,7 @@ functions can be thought of as \&..., .Fa argn . Together they describe a list of one or more pointers to -.Dv NULL Ns -terminated +NUL-terminated strings that represent the argument list available to the executed program. The first argument, by convention, should point to the file name associated with the file being executed. @@ -99,8 +99,7 @@ The .Fn execv , and .Fn execvp -functions provide an array of pointers to -.Dv NULL Ns -terminated +functions provide an array of pointers to NUL-terminated strings that represent the argument list available to the new program. The first argument, by convention, should point to the file name associated @@ -122,9 +121,8 @@ pointer that terminates the list of arguments in the parameter list or the pointer to the .Va argv array with an additional parameter. -This additional parameter is an array of pointers to -.Dv NULL Ns -terminated strings -and +This additional parameter is an array of pointers to NUL-terminated +strings and .Em must be terminated by a .Dv NULL diff --git a/lib/libc/gen/fts.3 b/lib/libc/gen/fts.3 index 56bd2eddd1f..2bc756c63ba 100644 --- a/lib/libc/gen/fts.3 +++ b/lib/libc/gen/fts.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: fts.3,v 1.8 1999/05/29 19:11:10 aaron Exp $ +.\" $OpenBSD: fts.3,v 1.9 1999/05/29 22:38:34 aaron Exp $ .\" .\" Copyright (c) 1989, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -324,8 +324,7 @@ Therefore, the .Fa fts_path and .Fa fts_accpath -fields are guaranteed to be -.Dv NULL Ns -terminated +fields are guaranteed to be NUL-terminated .Em only for the file most recently returned by .Fn fts_read . @@ -342,8 +341,7 @@ Any such modifications should be undone before further calls to are attempted. The .Fa fts_name -field is always -.Dv NULL Ns -terminated. +field is always NUL-terminated. .Ss FTS_OPEN The .Fn fts_open @@ -562,7 +560,9 @@ The .Fn fts_children function returns a pointer to an .Em FTSENT -structure describing the first entry in a NULL-terminated linked list of +structure describing the first entry in a +.Dv NULL Ns -terminatedu +linked list of the files in the directory represented by the .Em FTSENT structure most recently returned by diff --git a/lib/libc/gen/getbsize.3 b/lib/libc/gen/getbsize.3 index aefa6a120c6..330b908fb2f 100644 --- a/lib/libc/gen/getbsize.3 +++ b/lib/libc/gen/getbsize.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getbsize.3,v 1.4 1999/05/29 16:08:55 aaron Exp $ +.\" $OpenBSD: getbsize.3,v 1.5 1999/05/29 22:38:34 aaron Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -52,8 +52,7 @@ for details on its use and format. .Pp The .Fn getbsize -function returns a pointer to a -.Dv NULL Ns -terminated +function returns a pointer to a NUL-terminated string describing the block size, something like .Qq 1K-blocks . diff --git a/lib/libc/gen/getcap.3 b/lib/libc/gen/getcap.3 index 19f9d4724aa..a7a56bb6852 100644 --- a/lib/libc/gen/getcap.3 +++ b/lib/libc/gen/getcap.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getcap.3,v 1.10 1999/05/29 16:08:55 aaron Exp $ +.\" $OpenBSD: getcap.3,v 1.11 1999/05/29 22:38:34 aaron Exp $ .\" .\" Copyright (c) 1992, 1993 .\" The Regents of the University of California. All rights reserved. @@ -196,8 +196,7 @@ retrieves the value of the string capability .Fa cap from the capability record pointed to by .Fa buf . -A pointer to a decoded, -.Dv NULL Ns -terminated , +A pointer to a decoded, NUL-terminated, .Xr malloc Ns \&'d copy of the string is returned in the .Ft char * diff --git a/lib/libc/gen/getdomainname.3 b/lib/libc/gen/getdomainname.3 index c7ab59f72fa..5ad434ea506 100644 --- a/lib/libc/gen/getdomainname.3 +++ b/lib/libc/gen/getdomainname.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getdomainname.3,v 1.11 1999/05/29 19:11:11 aaron Exp $ +.\" $OpenBSD: getdomainname.3,v 1.12 1999/05/29 22:38:34 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -56,8 +56,7 @@ The parameter specifies the size of the .Fa name array. If insufficient space is provided, the returned name is truncated. -The returned name is always -.Dv NULL Ns -terminated. +The returned name is always NUL-terminated. .Pp .Fn setdomainname sets the domain name of the host machine to be diff --git a/lib/libc/gen/gethostname.3 b/lib/libc/gen/gethostname.3 index 60856b6b86e..445cb9500b8 100644 --- a/lib/libc/gen/gethostname.3 +++ b/lib/libc/gen/gethostname.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: gethostname.3,v 1.11 1999/05/29 19:11:11 aaron Exp $ +.\" $OpenBSD: gethostname.3,v 1.12 1999/05/29 22:38:34 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -55,8 +55,7 @@ The parameter specifies the size of the .Fa name array. If insufficient space is provided, the returned name is truncated. -The returned name is always -.Dv NULL Ns -terminated. +The returned name is always NUL-terminated. .Pp .Fn sethostname sets the name of the host machine to be diff --git a/lib/libc/gen/getpass.3 b/lib/libc/gen/getpass.3 index 6fca68c7681..941ec9e5c67 100644 --- a/lib/libc/gen/getpass.3 +++ b/lib/libc/gen/getpass.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getpass.3,v 1.4 1999/05/29 19:11:11 aaron Exp $ +.\" $OpenBSD: getpass.3,v 1.5 1999/05/29 22:38:35 aaron Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -67,9 +67,7 @@ avoid leaving the cleartext password visible in the process's address space. .Sh RETURN VALUES .Fn getpass -returns a pointer to the -.Dv NULL Ns -terminated -password. +returns a pointer to the NUL-terminated password. .Sh FILES .Bl -tag -width /dev/tty -compact .It Pa /dev/tty diff --git a/lib/libc/gen/glob.3 b/lib/libc/gen/glob.3 index 1c9a77894fc..5afc633398c 100644 --- a/lib/libc/gen/glob.3 +++ b/lib/libc/gen/glob.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: glob.3,v 1.8 1999/05/29 19:11:11 aaron Exp $ +.\" $OpenBSD: glob.3,v 1.9 1999/05/29 22:38:35 aaron Exp $ .\" .\" Copyright (c) 1989, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -359,8 +359,7 @@ or .Ql [ , cleared if not. .It Fa gl_pathv -Contains a pointer to a -.Dv NULL Ns -terminated +Contains a pointer to a NUL-terminated list of matched pathnames. However, if .Fa gl_pathc diff --git a/lib/libc/gen/popen.3 b/lib/libc/gen/popen.3 index 7795a02b14f..aaf07b5c457 100644 --- a/lib/libc/gen/popen.3 +++ b/lib/libc/gen/popen.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: popen.3,v 1.4 1999/05/29 20:07:14 aaron Exp $ +.\" $OpenBSD: popen.3,v 1.5 1999/05/29 22:38:35 aaron Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -60,8 +60,7 @@ the resulting stream is correspondingly read-only or write-only. .Pp The .Fa command -argument is a pointer to a -.Dv NULL Ns -terminated +argument is a pointer to a NUL-terminated string containing a shell command line. This command is passed to .Pa /bin/sh @@ -70,8 +69,7 @@ using the flag; interpretation, if any, is performed by the shell. The .Fa mode -argument is a pointer to a -.Dv NULL Ns -terminated +argument is a pointer to a NUL-terminated string which must be either .Qq r for reading diff --git a/lib/libc/gen/time.3 b/lib/libc/gen/time.3 index e0522a8f01f..d15ca8281d3 100644 --- a/lib/libc/gen/time.3 +++ b/lib/libc/gen/time.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: time.3,v 1.4 1999/05/27 20:49:35 aaron Exp $ +.\" $OpenBSD: time.3,v 1.5 1999/05/29 22:38:35 aaron Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -50,21 +50,23 @@ The .Fn time function returns the value of time in seconds since 0 hours, 0 minutes, -0 seconds, January 1, 1970, Coordinated Universal Time. +0 seconds, January 1, 1970, Coordinated Universal Time (UTC). .Pp A copy of the time value may be saved to the area indicated by the pointer .Fa tloc . If .Fa tloc -is a NULL pointer, no value is stored. +is a +.Dv NULL +pointer, no value is stored. .Pp Upon successful completion, .Fn time returns the value of time. Otherwise a value of .Po -.Po Fa time_t Pc \-1 +.Fa time_t No - 1 .Pc is returned and the global variable .Va errno diff --git a/lib/libc/gen/times.3 b/lib/libc/gen/times.3 index a1e4bcb8794..aa792c06062 100644 --- a/lib/libc/gen/times.3 +++ b/lib/libc/gen/times.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: times.3,v 1.4 1999/05/23 14:11:00 aaron Exp $ +.\" $OpenBSD: times.3,v 1.5 1999/05/29 22:38:35 aaron Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -52,17 +52,17 @@ and The .Fn times function returns the value of time in -.Dv CLK_TCK Ns 's +.Dv CLK_TCK Ns s of a second since 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal -Time. +Time (UTC). .Pp It also fills in the structure pointed to by .Fa tp with time-accounting information. .Pp The -.Fa tms +.Em tms structure is defined as follows: .Bd -literal -offset indent typedef struct { @@ -86,9 +86,9 @@ time charged for execution by the system on behalf of the process. .It Fa tms_cutime The sum of the -.Fa tms_utime s +.Fa tms_utime Ns 's and -.Fa tms_cutime s +.Fa tms_cutime Ns 's of the child processes. .It Fa tms_cstime The sum of the @@ -99,7 +99,7 @@ of the child processes. .El .Pp All times are in -.Dv CLK_TCK Ns 's +.Dv CLK_TCK Ns s of a second. .Pp The times of a terminated child process are included in the @@ -112,7 +112,7 @@ functions returns the process ID of the terminated child to the parent. If an error occurs, .Fn times returns the value -.Pq (clock_t)\-1 , +.Pq Em clock_t No - 1 , and sets .Va errno to indicate the error. diff --git a/lib/libc/gen/timezone.3 b/lib/libc/gen/timezone.3 index dd5bbffd2e3..97c719c8cb9 100644 --- a/lib/libc/gen/timezone.3 +++ b/lib/libc/gen/timezone.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: timezone.3,v 1.6 1999/05/20 14:50:35 aaron Exp $ +.\" $OpenBSD: timezone.3,v 1.7 1999/05/29 22:38:35 aaron Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -42,23 +42,26 @@ .Ft char * .Fn timezone "int zone" "int dst" .Sh DESCRIPTION -.ft B +.Bf -symbolic This interface is for compatibility only; it is impossible to reliably -map timezone's arguments to a time zone abbreviation. -See -.Xr ctime 3 . -.ft P +map +.Fn timezone Ns 's +arguments to a time zone abbreviation (see +.Xr ctime 3 ) . +.Ef .Pp The .Fn timezone function returns a pointer to a time zone abbreviation for the specified -.Ar zone +.Fa zone and -.Ar dst +.Fa dst values. -.Ar Zone -is the number of minutes west of GMT and -.Ar dst +.Fa zone +is the number of minutes west of +.Tn GMT +and +.Fa dst is non-zero if Daylight Saving Time is in effect. .Sh SEE ALSO .Xr ctime 3 diff --git a/lib/libc/gen/ttyname.3 b/lib/libc/gen/ttyname.3 index 75a67f8f0ac..b2e804b6aa4 100644 --- a/lib/libc/gen/ttyname.3 +++ b/lib/libc/gen/ttyname.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ttyname.3,v 1.6 1999/05/25 13:06:45 aaron Exp $ +.\" $OpenBSD: ttyname.3,v 1.7 1999/05/29 22:38:36 aaron Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -58,7 +58,7 @@ type devices. These descriptors are not related to the standard typedef, but refer to the special device files found in .Pa /dev and named -.Pa /dev/tty Ns Em xx +.Pa /dev/tty Ns Em XX and for which an entry exists in the initialization file .Pa /etc/ttys @@ -84,21 +84,22 @@ a file descriptor for which is true. The .Fn ttyname_r -function stores the nul-terminated pathname of the terminal associated with +function stores the NUL-terminated +pathname of the terminal associated with the file descriptor .Fa fd in the character array referenced by .Fa name . The array is .Fa namesize -characters long and should have space for the name and the terminating nul -character. The maximum length of the terminal name is +characters long and should have space for the name and the terminating +NUL character. The maximum length of the terminal name is .Dv TTY_NAME_MAX . .Pp The .Fn ttyslot function -fetches the current process' control terminal number from the +fetches the current process's control terminal number from the .Xr ttys 5 file entry. .Sh RETURN VALUES @@ -106,8 +107,8 @@ The .Fn ttyname and .Fn ttyname_r -functions -return the nul terminated name if the device is found and +functions return the NUL-terminated +name if the device is found and .Fn isatty is true; otherwise a @@ -160,12 +161,12 @@ terminating nul character. .Xr ttys 5 , .Xr dev_mkdb 8 .Sh HISTORY -A +The .Fn isatty , .Fn ttyname , and .Fn ttyslot -function +functions appeared in .At v7 . The diff --git a/lib/libc/gen/ualarm.3 b/lib/libc/gen/ualarm.3 index 5c253c33981..7affd255ae8 100644 --- a/lib/libc/gen/ualarm.3 +++ b/lib/libc/gen/ualarm.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ualarm.3,v 1.9 1999/05/23 14:11:00 aaron Exp $ +.\" $OpenBSD: ualarm.3,v 1.10 1999/05/29 22:38:36 aaron Exp $ .\" .\" Copyright (c) 1986, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -51,7 +51,7 @@ The .Fn ualarm function waits a count of -.Ar microseconds +.Fa microseconds before asserting the terminating signal .Dv SIGALRM . System activity or time used in processing the call may cause a slight @@ -66,13 +66,13 @@ to the process every .Fa interval microseconds after the timer expires (e.g. after .Fa microseconds -microseconds have passed). +number of microseconds have passed). .Sh RETURN VALUES When the signal has successfully been caught, .Fn ualarm returns the amount of time left on the clock. -The maximum number of -.Ar microseconds +The maximum value for +.Fa microseconds allowed is 2147483647. .Sh SEE ALSO diff --git a/lib/libc/gen/uname.3 b/lib/libc/gen/uname.3 index 1bb1818a754..f7a97b000a3 100644 --- a/lib/libc/gen/uname.3 +++ b/lib/libc/gen/uname.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: uname.3,v 1.4 1998/06/15 17:55:01 mickey Exp $ +.\" $OpenBSD: uname.3,v 1.5 1999/05/29 22:38:36 aaron Exp $ .\" .\" Copyright (c) 1994 .\" The Regents of the University of California. All rights reserved. @@ -44,16 +44,17 @@ .Sh DESCRIPTION The .Fn uname -function stores nul-terminated strings of information identifying +function stores NUL-terminated strings of information identifying the current system into the structure referenced by .Fa name . .Pp The -.Li utsname +.Em utsname structure is defined in the -.Li <sys/utsname.h> +.Aq Pa sys/utsname.h header file, and contains the following members: -.Bl -tag -width nodenameXXXX -offset indent +.Pp +.Bl -tag -width nodenameXXXX -offset indent -compact .It sysname Name of the operating system implementation. .It nodename @@ -67,8 +68,8 @@ Machine hardware platform. .El .Sh RETURN VALUES If -.Nm uname -is successful, 0 is returned, otherwise, -1 is returned and +.Fn uname +is successful, 0 is returned; otherwise, -1 is returned and .Va errno is set appropriately. .Sh ERRORS @@ -76,7 +77,7 @@ The .Fn uname function may fail and set .Va errno -for any of the errors specified for the library functions +for any of the errors specified for the library function .Xr sysctl 3 . .Sh SEE ALSO .Xr uname 1 , @@ -88,6 +89,6 @@ function conforms to .St -p1003.1-88 . .Sh HISTORY The -.Nm uname +.Fn uname function first appeared in .Bx 4.4 . diff --git a/lib/libc/gen/unvis.3 b/lib/libc/gen/unvis.3 index c3a8de70fa2..fd2eb9976c3 100644 --- a/lib/libc/gen/unvis.3 +++ b/lib/libc/gen/unvis.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: unvis.3,v 1.5 1999/05/16 19:55:02 alex Exp $ +.\" $OpenBSD: unvis.3,v 1.6 1999/05/29 22:38:36 aaron Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -54,36 +54,38 @@ are used to decode a visual representation of characters, as produced by the .Xr vis 3 function, back into -the original form. Unvis is called with successive characters in -.Ar c +the original form. +.Fn unvis +is called with successive characters in +.Fa c until a valid sequence is recognized, at which time the decoded character is available at the character pointed to by -.Ar cp . -Strunvis decodes the -characters pointed to by -.Ar src +.Fa cp . +.Pp +.Fn strunvis +decodes the characters pointed to by +.Fa src into the buffer pointed to by -.Ar dst . +.Fa dst . .Pp The .Fn strunvis function simply copies -.Ar src +.Fa src to -.Ar dst , +.Fa dst , decoding any escape sequences along the way, and returns the number of characters placed into -.Ar dst , -or \-1 if an +.Fa dst , +or -1 if an invalid escape sequence was detected. The size of -.Ar dst +.Fa dst should be equal to the size of -.Ar src -(that is, no expansion takes place during -decoding). +.Fa src +(that is, no expansion takes place during decoding). .Pp The .Fn unvis @@ -100,23 +102,25 @@ to zero. Call with each successive byte, along with a pointer to this integer, and a pointer to a destination character. The -.Xr unvis +.Fn unvis function has several return codes that must be handled properly. They are: .Bl -tag -width UNVIS_VALIDPUSH .It Li \&0 (zero) Another character is necessary; nothing has been recognized yet. -.It Dv UNVIS_VALID +.It Dv UNVIS_VALID A valid character has been recognized and is available at the location -pointed to by cp. -.It Dv UNVIS_VALIDPUSH +pointed to by +.Fa cp . +.It Dv UNVIS_VALIDPUSH A valid character has been recognized and is available at the location -pointed to by cp; however, the character currently passed in should -be passed in again. -.It Dv UNVIS_NOCHAR +pointed to by +.Fa cp ; +however, the character currently passed in should be passed in again. +.It Dv UNVIS_NOCHAR A valid sequence was detected, but no character was produced. This return code is necessary to indicate a logical break between characters. -.It Dv UNVIS_SYNBAD +.It Dv UNVIS_SYNBAD An invalid escape sequence was detected, or the decoder is in an unknown state. The decoder is placed into the starting state. .El @@ -127,6 +131,7 @@ one more time with flag set to .Dv UNVIS_END to extract any remaining character (the character passed in is ignored). .Pp +.Sh EXAMPLES The following code fragment illustrates a proper use of .Fn unvis . .Bd -literal -offset indent @@ -159,6 +164,6 @@ if (unvis(&out, (char)0, &state, UNVIS_END) == UNVIS_VALID) .Xr vis 3 .Sh HISTORY The -.Nm unvis +.Fn unvis function first appeared in .Bx 4.4 . diff --git a/lib/libc/gen/usleep.3 b/lib/libc/gen/usleep.3 index 07121350f12..918fe330e64 100644 --- a/lib/libc/gen/usleep.3 +++ b/lib/libc/gen/usleep.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: usleep.3,v 1.7 1999/05/23 14:11:01 aaron Exp $ +.\" $OpenBSD: usleep.3,v 1.8 1999/05/29 22:38:36 aaron Exp $ .\" .\" Copyright (c) 1986, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -48,7 +48,7 @@ function suspends execution of the calling process for .Fa microseconds -of time. +microseconds of time. System activity or time spent in processing the call may lengthen the sleep slightly. .Pp @@ -59,10 +59,10 @@ A similar but less compatible function can be obtained with a single .Xr select 2 ; such a function would not restart after signals, and also does not interfere with other uses of -.Xr setitimer +.Xr setitimer 2 (not that .Fn usleep -interferes with interval timers anymore.) +interferes with interval timers anymore). .Sh RETURN VALUE If the .Fn usleep @@ -77,18 +77,20 @@ will be the -1, and the global variable will be set to indicate the interruption. .Sh ERRORS If any of the following conditions occur, the -.Nm +.Fn usleep function shall return -1 and set .Va errno to the corresponding value. .Bl -tag -width Er .It Bq Er EINTR -.Nm +.Fn usleep was interrupted by the delivery of a signal. .It Bq Er EINVAL .Fa useconds specified a value of 1,000,000 or more microseconds. .El +.Sh NOTES +A microsecond is 0.000001 seconds. .Sh SEE ALSO .Xr getitimer 2 , .Xr nanosleep 2 , diff --git a/lib/libc/gen/utime.3 b/lib/libc/gen/utime.3 index a3c0b397511..82d0218de63 100644 --- a/lib/libc/gen/utime.3 +++ b/lib/libc/gen/utime.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: utime.3,v 1.6 1999/05/23 14:11:01 aaron Exp $ +.\" $OpenBSD: utime.3,v 1.7 1999/05/29 22:38:37 aaron Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -65,7 +65,9 @@ If is .Pf non- Dv NULL , .Fa time -is assumed to be a pointer to a utimbuf structure, as defined in +is assumed to be a pointer to a +.Em utimbuf +structure, as defined in .Aq Pa utime.h : .Bd -literal -offset indent struct utimbuf { @@ -74,13 +76,17 @@ struct utimbuf { } ; .Ed .Pp -The access time is set to the value of the actime member, and the modification -time is set to the value of the modtime member. The times are measured in +The access time is set to the value of the +.Fa actime +member, and the modification +time is set to the value of the +.Fa modtime +member. The times are measured in seconds since 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated -Universal Time. +Universal Time (UTC). The calling process must be the owner of the file or be the super-user. .Pp -In either case, the inode-change-time of the file is set to the current +In either case, the inode change-time of the file is set to the current time. .Sh RETURN VALUES Upon successful completion, a value of 0 is returned. @@ -101,14 +107,16 @@ and the effective user ID of the process does not match the owner of the file, and is not the super-user, and write access is denied. .It Bq Er EFAULT -.Ar file +.Fa file or -.Fa times +.Fa timep points outside the process's allocated address space. .It Bq Er EINVAL The pathname contains a character with the high-order bit set. .It Bq Er EIO -An I/O error occurred while reading or writing the affected inode. +An +.Tn I/O +error occurred while reading or writing the affected inode. .It Bq Er ELOOP Too many symbolic links were encountered in translating the pathname. .It Bq Er ENAMETOOLONG @@ -120,7 +128,7 @@ The named file does not exist. A component of the path prefix is not a directory. .It Bq Er EPERM The -.Fa times +.Fa timep argument is not .Dv NULL and the calling process's effective user ID diff --git a/lib/libc/gen/valloc.3 b/lib/libc/gen/valloc.3 index 0fc22542cf9..963cd29859f 100644 --- a/lib/libc/gen/valloc.3 +++ b/lib/libc/gen/valloc.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: valloc.3,v 1.5 1999/05/23 14:11:01 aaron Exp $ +.\" $OpenBSD: valloc.3,v 1.6 1999/05/29 22:38:37 aaron Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -43,15 +43,16 @@ .Fn valloc "size_t size" .Sh DESCRIPTION .Bf -symbolic -Valloc is obsoleted by the current version of +The +.Fn valloc +function is obsoleted by the current version of .Xr malloc 3 , which aligns page-sized and larger allocations. .Ef .Pp The .Fn valloc -function -allocates +function allocates .Fa size bytes aligned on a page boundary. It is implemented by calling @@ -62,8 +63,9 @@ allocated, and returning a properly aligned pointer. The .Fn valloc function returns -a pointer to the allocated space if successful; otherwise -a null pointer is returned +a pointer to the allocated space if successful; otherwise a +.Dv NULL +pointer is returned .Sh HISTORY The .Fn valloc @@ -71,6 +73,6 @@ function appeared in .Bx 3.0 . .Sh BUGS A -.Em vfree +.Fn vfree function has not been implemented. diff --git a/lib/libc/gen/vis.3 b/lib/libc/gen/vis.3 index 5f546f4716b..663355c95d3 100644 --- a/lib/libc/gen/vis.3 +++ b/lib/libc/gen/vis.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: vis.3,v 1.5 1999/05/16 19:55:03 alex Exp $ +.\" $OpenBSD: vis.3,v 1.6 1999/05/29 22:38:37 aaron Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -35,7 +35,9 @@ .Dt VIS 3 .Os .Sh NAME -.Nm vis +.Nm vis , +.Nm strvis , +.Nm strvisx .Nd visually encode characters .Sh SYNOPSIS .Fd #include <vis.h> @@ -56,14 +58,13 @@ a string which represents the character If .Fa c needs no encoding, it is copied in unaltered. The string is -null terminated, and a pointer to the end of the string is +NUL-terminated and a pointer to the end of the string is returned. The maximum length of any encoding is four -characters (not including the trailing -.Dv NUL ) ; +characters (not including the trailing NUL); thus, when encoding a set of characters into a buffer, the size of the buffer should be four times the number of characters encoded, plus one for the trailing -.Dv NUL . +NUL. The flag parameter is used for altering the default range of characters considered for encoding and for altering the visual representation. @@ -86,9 +87,7 @@ The .Fn strvis function encodes characters from .Fa src -up to the -first -.Dv NUL . +up to the first NUL. The .Fn strvisx function encodes exactly @@ -96,23 +95,18 @@ function encodes exactly characters from .Fa src (this -is useful for encoding a block of data that may contain -.Dv NUL Ns 's). -Both forms -.Dv NUL -terminate +is useful for encoding a block of data that may contain NUls). +Both forms NUL-terminate .Fa dst . The size of .Fa dst must be four times the number of characters encoded from .Fa src -(plus one for the -.Dv NUL ) . +(plus one for the NUL). Both forms return the number of characters in dst (not including -the trailing -.Dv NUL ) . +the trailing NUL. .Pp The encoding is a unique, invertible representation composed entirely of graphic characters; it can be decoded back into the original form using @@ -126,9 +120,9 @@ There are two parameters that can be controlled: the range of characters that are encoded, and the type of representation used. By default, all non-graphic characters. -except space, tab, and newline are encoded. -(See -.Xr isgraph 3 . ) +except space, tab, and newline are encoded +(see +.Xr isgraph 3 ) . The following flags alter this: .Bl -tag -width VIS_WHITEX @@ -146,17 +140,19 @@ Synonym for \&| .Dv VIS_NL . .It Dv VIS_SAFE -Only encode "unsafe" characters. Unsafe means control +Only encode +.Dq unsafe +characters. These are control characters which may cause common terminals to perform unexpected functions. Currently this form allows space, -tab, newline, backspace, bell, and return - in addition -to all graphic characters - unencoded. +tab, newline, backspace, bell, and return -- in addition +to all graphic characters -- unencoded. .El .Pp There are three forms of encoding. -All forms use the backslash character +All forms use the backslash .Ql \e -to introduce a special +character to introduce a special sequence; two backslashes are used to represent a real backslash. These are the visual formats: .Bl -tag -width VIS_CSTYLE @@ -164,10 +160,10 @@ These are the visual formats: Use an .Ql M to represent meta characters (characters with the 8th -bit set), and use caret +bit set), and use a caret .Ql ^ -to represent control characters see -.Pf ( Xr iscntrl 3 ) . +to represent control characters (see +.Xr iscntrl 3 ) . The following formats are used: .Bl -tag -width xxxxx .It Dv \e^C @@ -225,9 +221,7 @@ The following sequences are used to represent the indicated characters: .Ed .Pp When using this format, the nextc parameter is looked at to determine -if a -.Dv NUL -character can be encoded as +if a NUL character can be encoded as .Ql \e0 instead of .Ql \e000 . |