diff options
-rw-r--r-- | bin/cat/cat.1 | 5 | ||||
-rw-r--r-- | lib/libc/gen/fts.3 | 68 | ||||
-rw-r--r-- | lib/libc/gen/getcwd.3 | 6 | ||||
-rw-r--r-- | lib/libc/gen/getdiskbyname.3 | 6 | ||||
-rw-r--r-- | lib/libc/gen/getdomainname.3 | 10 | ||||
-rw-r--r-- | lib/libc/gen/getfsent.3 | 13 | ||||
-rw-r--r-- | lib/libc/gen/getgrent.3 | 31 | ||||
-rw-r--r-- | lib/libc/gen/getgrouplist.3 | 6 | ||||
-rw-r--r-- | lib/libc/gen/gethostname.3 | 23 | ||||
-rw-r--r-- | lib/libc/gen/getloadavg.3 | 4 | ||||
-rw-r--r-- | lib/libc/gen/getnetgrent.3 | 38 | ||||
-rw-r--r-- | lib/libc/gen/getpagesize.3 | 10 | ||||
-rw-r--r-- | lib/libc/gen/getpass.3 | 29 | ||||
-rw-r--r-- | lib/libc/gen/getpwent.3 | 58 | ||||
-rw-r--r-- | lib/libc/gen/getttyent.3 | 30 | ||||
-rw-r--r-- | lib/libc/gen/getusershell.3 | 8 | ||||
-rw-r--r-- | lib/libc/gen/glob.3 | 61 | ||||
-rw-r--r-- | lib/libc/gen/initgroups.3 | 6 |
18 files changed, 212 insertions, 200 deletions
diff --git a/bin/cat/cat.1 b/bin/cat/cat.1 index 2efaee5ff71..8cd7d85a1fa 100644 --- a/bin/cat/cat.1 +++ b/bin/cat/cat.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: cat.1,v 1.9 1999/05/23 14:10:46 aaron Exp $ +.\" $OpenBSD: cat.1,v 1.10 1999/05/29 19:11:10 aaron Exp $ .\" $NetBSD: cat.1,v 1.12 1995/09/27 05:38:55 cgd Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 @@ -79,7 +79,8 @@ for control-X. The only exception is the tab character, control-I (see the option). The DEL character (octal 0177) prints as .Ql ^? . -Non-ASCII characters (with the high bit set) are printed as +.Pf Non- Ns Tn ASCII +characters (with the high bit set) are printed as .Ql M- (for meta) followed by the character for the low 7 bits. .It Fl e diff --git a/lib/libc/gen/fts.3 b/lib/libc/gen/fts.3 index d036d773df5..56bd2eddd1f 100644 --- a/lib/libc/gen/fts.3 +++ b/lib/libc/gen/fts.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: fts.3,v 1.7 1999/05/29 16:08:55 aaron Exp $ +.\" $OpenBSD: fts.3,v 1.8 1999/05/29 19:11:10 aaron Exp $ .\" .\" Copyright (c) 1989, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -92,22 +92,22 @@ The first is .Dv FTS , the structure that represents the file hierarchy itself. The second is -.Dv FTSENT , +.Em FTSENT , the structure that represents a file in the file hierarchy. Normally, an -.Dv FTSENT +.Em FTSENT structure is returned for every file in the file hierarchy. In this manual page, .Dq file and -.Dq Dv FTSENT No structure +.Dq Em FTSENT No structure are generally interchangeable. .Pp The -.Dv FTSENT +.Em FTSENT structure contains at least the following fields, which are described in greater detail below: .Bd -literal @@ -133,7 +133,7 @@ These fields are defined as follows: .Bl -tag -width "fts_namelen" .It Fa fts_info One of the following flags describing the returned -.Dv FTSENT +.Em FTSENT structure and the file it represents. With the exception of directories without errors @@ -149,11 +149,11 @@ A directory that causes a cycle in the tree. (The .Fa fts_cycle field of the -.Dv FTSENT +.Em FTSENT structure will be filled in as well.) .It Dv FTS_DEFAULT Any -.Dv FTSENT +.Em FTSENT structure that represents a file type not explicitly described by one of the other .Fa fts_info @@ -175,7 +175,7 @@ which was not specified as a file name to .It Dv FTS_DP A directory being visited in post-order. The contents of the -.Dv FTSENT +.Em FTSENT structure will be unchanged from when it was returned in pre-order, i.e., with the .Fa fts_info @@ -232,15 +232,15 @@ The length of the string referenced by The depth of the traversal, numbered from -1 to N, where this file was found. The -.Dv FTSENT +.Em FTSENT structure representing the parent of the starting point (or root) of the traversal is numbered -1, and the -.Dv FTSENT +.Em FTSENT structure for the root itself is numbered 0. .It Fa fts_errno Upon return of an -.Dv FTSENT +.Em FTSENT structure from the .Fn fts_children or @@ -275,7 +275,7 @@ It is initialized to .Dv NULL . .It Fa fts_parent A pointer to the -.Dv FTSENT +.Em FTSENT structure referencing the file in the hierarchy immediately above the current file, i.e., the directory of which this file is a member. @@ -305,9 +305,9 @@ of a hard link between two directories, or a symbolic link pointing to a directory, the .Fa fts_cycle field of the structure will point to the -.Dv FTSENT +.Em FTSENT structure in the hierarchy that references the same file as the current -.Dv FTSENT +.Em FTSENT structure. Otherwise, the contents of the .Fa fts_cycle @@ -330,10 +330,10 @@ fields are guaranteed to be for the file most recently returned by .Fn fts_read . To use these fields to reference any files represented by other -.Dv FTSENT +.Em FTSENT structures will require that the path buffer be modified using the information contained in that -.Dv FTSENT +.Em FTSENT structure's .Fa fts_pathlen field. @@ -374,11 +374,11 @@ is also specified. This option causes the .Nm routines to return -.Dv FTSENT +.Em FTSENT structures for the targets of symbolic links instead of the symbolic links themselves. If this option is set, the only symbolic links for which -.Dv FTSENT +.Em FTSENT structures are returned to the application are those referencing non-existent files. Either @@ -408,7 +408,7 @@ pathnames were provided as arguments to .Fn fts_open . .It Dv FTS_NOSTAT By default, returned -.Dv FTSENT +.Em FTSENT structures reference file characteristic information (the .Fa statp field) for each file visited. @@ -426,11 +426,11 @@ field undefined. This option causes the .Nm routines to return -.Dv FTSENT +.Em FTSENT structures for symbolic links themselves instead of the target files they point to. If this option is set, -.Dv FTSENT +.Em FTSENT structures for all symbolic links in the hierarchy are returned to the application. Either @@ -452,7 +452,7 @@ encountered in the file hierarchy are ignored. This option causes the .Nm routines to return -.Dv FTSENT +.Em FTSENT structures for them. .It Dv FTS_XDEV This option prevents @@ -474,7 +474,7 @@ specifies a user-defined function which may be used to order the traversal of the hierarchy. It takes two pointers to pointers to -.Dv FTSENT +.Em FTSENT structures as arguments and should return a negative value, zero, or a positive value to indicate if the file referenced by its first argument comes before, in any order @@ -485,7 +485,7 @@ The and .Fa fts_pathlen fields of the -.Dv FTSENT +.Em FTSENT structures may .Em never be used in this comparison. @@ -510,7 +510,7 @@ everything else. The .Fn fts_read function returns a pointer to an -.Dv FTSENT +.Em FTSENT structure describing a file in the hierarchy. Directories (that are readable and do not cause cycles) are visited at @@ -535,14 +535,14 @@ and sets .Va errno appropriately. If an error related to a returned file occurs, a pointer to an -.Dv FTSENT +.Em FTSENT structure is returned, and .Va errno may or may not have been set (see .Fa fts_info ) . .Pp The -.Dv FTSENT +.Em FTSENT structures returned by .Fn fts_read may be overwritten after a call to @@ -553,7 +553,7 @@ on the same file hierarchy stream unless they represent a file of type directory, in which case they will not be overwritten until after a call to .Fn fts_read after the -.Dv FTSENT +.Em FTSENT structure has been returned by the function .Fn fts_read in post-order. @@ -561,16 +561,16 @@ in post-order. The .Fn fts_children function returns a pointer to an -.Dv FTSENT +.Em FTSENT structure describing the first entry in a NULL-terminated linked list of the files in the directory represented by the -.Dv FTSENT +.Em FTSENT structure most recently returned by .Fn fts_read . The list is linked through the .Fa fts_link field of the -.Dv FTSENT +.Em FTSENT structure, and is ordered by the user-specified comparison function, if any. Repeated calls to .Fn fts_children @@ -585,7 +585,7 @@ will return a pointer to the files in the logical directory specified to i.e., the arguments specified to .Fn fts_open . Otherwise, if the -.Dv FTSENT +.Em FTSENT structure most recently returned by .Fn fts_read is not a directory being visited in pre-order, @@ -605,7 +605,7 @@ and sets appropriately. .Pp The -.Dv FTSENT +.Em FTSENT structures returned by .Fn fts_children may be overwritten after a call to diff --git a/lib/libc/gen/getcwd.3 b/lib/libc/gen/getcwd.3 index 517ab1f6059..0f0003ddfca 100644 --- a/lib/libc/gen/getcwd.3 +++ b/lib/libc/gen/getcwd.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getcwd.3,v 1.4 1999/05/23 14:10:59 aaron Exp $ +.\" $OpenBSD: getcwd.3,v 1.5 1999/05/29 19:11:10 aaron Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -86,7 +86,7 @@ These routines have traditionally been used by programs to save the name of a working directory for the purpose of returning to it. A much faster and less error-prone method of accomplishing this is to open the current directory -.Pq Ql \&. +.Pq Pa \&. and use the .Xr fchdir 2 function to return. @@ -105,7 +105,7 @@ into the memory referenced by .Fa buf . .Sh ERRORS The -.Fn getcwd +.Fn getwd function will fail if: .Bl -tag -width Er diff --git a/lib/libc/gen/getdiskbyname.3 b/lib/libc/gen/getdiskbyname.3 index e8c3b230447..fcc27f34b20 100644 --- a/lib/libc/gen/getdiskbyname.3 +++ b/lib/libc/gen/getdiskbyname.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getdiskbyname.3,v 1.3 1999/05/23 14:10:59 aaron Exp $ +.\" $OpenBSD: getdiskbyname.3,v 1.4 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -45,8 +45,8 @@ The .Fn getdiskbyname function -takes a disk name (e.g. -.Ql rm03 ) +takes a disk name (e.g., +.Qq rm03 ) and returns a prototype disk label describing its geometry information and the standard disk partition tables. All information is obtained from diff --git a/lib/libc/gen/getdomainname.3 b/lib/libc/gen/getdomainname.3 index 8d7b76559db..c7ab59f72fa 100644 --- a/lib/libc/gen/getdomainname.3 +++ b/lib/libc/gen/getdomainname.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getdomainname.3,v 1.10 1999/05/16 19:54:51 alex Exp $ +.\" $OpenBSD: getdomainname.3,v 1.11 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -45,7 +45,9 @@ .Ft int .Fn setdomainname "const char *name" "size_t namelen" .Sh DESCRIPTION +The .Fn getdomainname +function returns the YP domain name for the current processor, as previously set by .Fn setdomainname . @@ -54,7 +56,8 @@ 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 null-terminated. +The returned name is always +.Dv NULL Ns -terminated. .Pp .Fn setdomainname sets the domain name of the host machine to be @@ -66,7 +69,7 @@ is normally used only when the system is bootstrapped. .Sh RETURN VALUES If the call succeeds a value of 0 is returned. If the call fails, a value of -1 is returned and an error code is -placed in the global location +placed in the global variable .Va errno . .Sh ERRORS The following errors may be returned by these calls: @@ -86,6 +89,7 @@ The caller tried to set the domain name and was not the super-user. .Xr gethostid 3 , .Xr gethostname 3 , .Xr sysctl 3 , +.Xr sysctl 8 , .Xr yp 8 .Sh BUGS Domain names are limited to diff --git a/lib/libc/gen/getfsent.3 b/lib/libc/gen/getfsent.3 index 6d3642b2fbd..39b0d228ee2 100644 --- a/lib/libc/gen/getfsent.3 +++ b/lib/libc/gen/getfsent.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getfsent.3,v 1.3 1999/05/23 14:10:59 aaron Exp $ +.\" $OpenBSD: getfsent.3,v 1.4 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -79,15 +79,11 @@ struct fstab { The fields have meanings described in .Xr fstab 5 . .Pp -The .Fn setfsent -function opens the file (closing any previously opened file) or rewinds it if it is already open. .Pp -The .Fn endfsent -function closes the file. .Pp The @@ -112,13 +108,15 @@ The and .Fn getfsfile functions -return a null pointer (0) on +return a +.Dv NULL +pointer on .Dv EOF or error. The .Fn setfsent function -returns 0 on failure, 1 on success. +returns 0 on failure or 1 on success. The .Fn endfsent function @@ -126,6 +124,7 @@ returns nothing. .Sh FILES .Bl -tag -width /etc/fstab -compact .It Pa /etc/fstab +file system table .El .Sh SEE ALSO .Xr fstab 5 diff --git a/lib/libc/gen/getgrent.3 b/lib/libc/gen/getgrent.3 index 1b8727b3711..a0de73fcfba 100644 --- a/lib/libc/gen/getgrent.3 +++ b/lib/libc/gen/getgrent.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getgrent.3,v 1.2 1996/08/19 08:23:27 tholo Exp $ +.\" $OpenBSD: getgrent.3,v 1.3 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -67,7 +67,7 @@ which is described in .Xr group 5 . Each line of the database is defined by the structure -.Ar group +.Em group found in the include file .Aq Pa grp.h : @@ -85,35 +85,29 @@ The functions and .Fn getgrgid search the group database for the given group name pointed to by -.Ar name -or the group id pointed to by -.Ar gid , +.Fa name +or the group ID pointed to by +.Fa gid , respectively, returning the first one encountered. Identical group -names or group gids may result in undefined behavior. +names or group GIDs may result in undefined behavior. .Pp -The .Fn getgrent -function sequentially reads the group database and is intended for programs that wish to step through the complete list of groups. .Pp All three routines will open the group file for reading, if necessary. .Pp -The .Fn setgroupent -function opens the file, or rewinds it if it is already open. If .Fa stayopen is non-zero, file descriptors are left open, significantly speeding -functions subsequent calls. This functionality is unnecessary for +subsequent function calls. This functionality is unnecessary for .Fn getgrent as it doesn't close its file descriptors by default. It should also be noted that it is dangerous for long-running programs to use this functionality as the group file may be updated. .Pp -The .Fn setgrent -function is equivalent to .Fn setgroupent with an argument of zero. @@ -127,13 +121,14 @@ The functions .Fn getgrent , .Fn getgrnam , and -.Fn getgrgid , +.Fn getgrgid return a pointer to the group entry if successful; if end-of-file -is reached or an error occurs a null pointer is returned. +is reached or an error occurs a +.Dv NULL +pointer is returned. The .Fn setgroupent -function returns the value 1 if successful, otherwise the value -0 is returned. +function returns the value 1 if successful, otherwise 0. The .Fn endgrent and @@ -165,7 +160,7 @@ appeared in .Bx 4.3 Reno . .Sh COMPATIBILITY The historic function -.Fn setgrfile , +.Xr setgrfile 3 , which allowed the specification of alternate password databases, has been deprecated and is no longer available. .Sh BUGS diff --git a/lib/libc/gen/getgrouplist.3 b/lib/libc/gen/getgrouplist.3 index f1cef5eb76f..faddaa8bd78 100644 --- a/lib/libc/gen/getgrouplist.3 +++ b/lib/libc/gen/getgrouplist.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getgrouplist.3,v 1.4 1998/06/15 17:54:54 mickey Exp $ +.\" $OpenBSD: getgrouplist.3,v 1.5 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -65,13 +65,13 @@ the actual number of groups found is returned in The .Fn getgrouplist function -returns \-1 if the size of the group list is too small to +returns -1 if the size of the group list is too small to hold all the user's groups. Here, the group array will be filled with as many groups as will fit. .Sh FILES .Bl -tag -width /etc/group -compact .It Pa /etc/group -group membership list +group database file .El .Sh SEE ALSO .Xr setgroups 2 , diff --git a/lib/libc/gen/gethostname.3 b/lib/libc/gen/gethostname.3 index e0667c5e380..60856b6b86e 100644 --- a/lib/libc/gen/gethostname.3 +++ b/lib/libc/gen/gethostname.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: gethostname.3,v 1.10 1999/05/23 14:10:59 aaron Exp $ +.\" $OpenBSD: gethostname.3,v 1.11 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -45,16 +45,18 @@ .Ft int .Fn sethostname "const char *name" "size_t namelen" .Sh DESCRIPTION +The .Fn gethostname -returns the standard host name for the current processor, as -previously set by +function returns the standard host name for the current +processor, as previously set by .Fn sethostname . The parameter .Fa namelen specifies the size of the .Fa name array. If insufficient space is provided, the returned name is truncated. -The returned name is always null-terminated. +The returned name is always +.Dv NULL Ns -terminated. .Pp .Fn sethostname sets the name of the host machine to be @@ -66,7 +68,7 @@ is normally used only when the system is bootstrapped. .Sh RETURN VALUES If the call succeeds a value of 0 is returned. If the call fails, a value of -1 is returned and an error code is -placed in the global location +placed in the global variable .Va errno . .Sh ERRORS The following errors may be returned by these calls: @@ -82,9 +84,12 @@ invalid address. The caller tried to set the hostname and was not the super-user. .El .Sh SEE ALSO +.Xr hostname 1 , +.Xr getdomainname 3 , .Xr gethostid 3 , .Xr sysctl 3 , -.Xr sysctl 8 +.Xr sysctl 8 , +.Xr yp 8 .Sh BUGS Host names are limited to .Dv MAXHOSTNAMELEN @@ -93,17 +98,17 @@ Host names are limited to characters, currently 256. This includes the terminating NUL character. .Pp If the buffer passed to -.Fn getdomainname +.Fn gethostname is smaller than .Dv MAXHOSTNAMELEN , other operating systems may not guarantee termination with NUL. .Sh HISTORY The -.Nm +.Fn gethostname function call appeared in .Bx 4.2 . .Sh STANDARDS The -.Nm +.Fn gethostname function call conforms to .St -xpg4.2 . diff --git a/lib/libc/gen/getloadavg.3 b/lib/libc/gen/getloadavg.3 index a58487b2445..b0ca8f1f4bc 100644 --- a/lib/libc/gen/getloadavg.3 +++ b/lib/libc/gen/getloadavg.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getloadavg.3,v 1.5 1999/05/16 19:54:52 alex Exp $ +.\" $OpenBSD: getloadavg.3,v 1.6 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -56,7 +56,7 @@ over the last 1, 5, and 15 minutes, respectively. Upon successful completion, the number of samples retrieved is returned. If an error occurs, -1 is returned and the global variable .Va errno -is set indicate the error. +is set to indicate the error. .Sh ERRORS Please see .Xr sysctl 3 diff --git a/lib/libc/gen/getnetgrent.3 b/lib/libc/gen/getnetgrent.3 index 02fa35a5ff0..c722c3f9908 100644 --- a/lib/libc/gen/getnetgrent.3 +++ b/lib/libc/gen/getnetgrent.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getnetgrent.3,v 1.7 1999/02/27 21:55:08 deraadt Exp $ +.\" $OpenBSD: getnetgrent.3,v 1.8 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1992, 1993 .\" The Regents of the University of California. All rights reserved. @@ -56,27 +56,24 @@ These functions operate on the netgroup database file which is described in .Xr netgroup 5 . -If that file does not exist, and the system supports -.Sy YP , -then the -.Sy netgroup -.Sy YP -databases are used instead. +If that file does not exist, and the system supports YP, +then the netgroup YP databased are used instead. The database defines a set of netgroups, each made up of one or more triples: .Bd -literal -offset indent (host, user, domain) .Ed .Pp that defines a combination of host, user and domain. -Any of the three fields may be specified as ``wildcards'' that match any -string. +Any of the three fields may be specified as +.Dq wildcards +that match any string. .Pp The function .Fn getnetgrent sets the three pointer arguments to the strings of the next member of the current netgroup. If any of the string pointers are -.Sy (char *)0 +.Fa (char *)0 that field is considered a wildcard. .Pp The functions @@ -96,28 +93,30 @@ The function .Fn innetgr searches for a match of all fields within the specified group. If any of the -.Sy host , -.Sy user , +.Ar host , +.Ar user , or -.Sy domain +.Ar domain arguments are -.Sy (char *)0 +.Fa (char *)0 those fields will match any string value in the netgroup member. .Sh RETURN VALUES The function .Fn getnetgrent -returns 0 for ``no more netgroup members'' and 1 otherwise. +returns 0 for +.Dq no more netgroup members +or 1 otherwise. The function .Fn innetgr -returns 1 for a successful match and 0 otherwise. +returns 1 for a successful match or 0 otherwise. The functions .Fn setnetgrent and .Fn endnetgrent have no return value. .Sh FILES -.Bl -tag -width /etc/netgroup -compact -.It Pa /etc/netgroup +.Bl -tag -width /etc/netgroup.db -compact +.It Pa /etc/netgroup.db netgroup database file .El .Sh SEE ALSO @@ -125,7 +124,8 @@ netgroup database file .Sh BUGS The function .Fn getnetgrent -returns pointers to dynamically allocated data areas that are free'd when +returns pointers to dynamically allocated data areas that are +.Xr free Ns 'd when the function .Fn endnetgrent is called. diff --git a/lib/libc/gen/getpagesize.3 b/lib/libc/gen/getpagesize.3 index 6273c16d7c4..0a40da96c4e 100644 --- a/lib/libc/gen/getpagesize.3 +++ b/lib/libc/gen/getpagesize.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getpagesize.3,v 1.6 1999/05/23 14:10:59 aaron Exp $ +.\" $OpenBSD: getpagesize.3,v 1.7 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -49,13 +49,13 @@ Use .Fn sysconf _SC_PAGESIZE . .Ef .Pp +The .Fn getpagesize -returns the number of bytes in a page. +function returns the number of bytes in a page. Page granularity is the granularity of many of the memory management calls. .Pp -The page size is a -.Xr system +The page size is a system page size and may not be the same as the underlying hardware page size. .Sh SEE ALSO @@ -64,6 +64,6 @@ hardware page size. .Xr sysconf 3 .Sh HISTORY The -.Nm +.Fn getpagesize function call appeared in .Bx 4.2 . diff --git a/lib/libc/gen/getpass.3 b/lib/libc/gen/getpass.3 index d3f8a1a1d8d..6fca68c7681 100644 --- a/lib/libc/gen/getpass.3 +++ b/lib/libc/gen/getpass.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getpass.3,v 1.3 1998/06/08 17:17:07 deraadt Exp $ +.\" $OpenBSD: getpass.3,v 1.4 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -48,21 +48,28 @@ The function displays a prompt to, and reads in a password from, .Pa /dev/tty . If this file is not accessible, -.Nm getpass +.Fn getpass displays the prompt on the standard error output and reads from the standard input. .Pp -The password may be up to _PASSWORD_LEN (currently 128) +The password may be up to _PASSWORD_LEN (currently 128, as defined in +the include file +.Aq Pa pwd.h ) characters in length. Any additional characters and the terminating newline character are discarded. .Pp -.Nm getpass +.Fn getpass turns off character echoing while reading the password. .Pp +The calling process should zero the password as soon as possible to +avoid leaving the cleartext password visible in the process's address +space. .Sh RETURN VALUES -.Nm getpass -returns a pointer to the null terminated password. +.Fn getpass +returns a pointer to the +.Dv NULL Ns -terminated +password. .Sh FILES .Bl -tag -width /dev/tty -compact .It Pa /dev/tty @@ -71,18 +78,14 @@ returns a pointer to the null terminated password. .Xr crypt 3 .Sh HISTORY A -.Nm getpass +.Fn getpass function appeared in .At v7 . .Sh BUGS The -.Nm getpass +.Fn getpass function leaves its result in an internal static object and returns a pointer to that object. Subsequent calls to -.Nm getpass +.Fn getpass will modify the same object. -.Pp -The calling process should zero the password as soon as possible to -avoid leaving the cleartext password visible in the process's address -space. diff --git a/lib/libc/gen/getpwent.3 b/lib/libc/gen/getpwent.3 index 746f3e11d4e..c0de291a2ae 100644 --- a/lib/libc/gen/getpwent.3 +++ b/lib/libc/gen/getpwent.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getpwent.3,v 1.5 1997/07/15 16:30:59 deraadt Exp $ +.\" $OpenBSD: getpwent.3,v 1.6 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1988, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -60,13 +60,11 @@ .Sh DESCRIPTION These functions operate on the password database file -which is described -in +which is described in .Xr passwd 5 . Each entry in the database is defined by the structure -.Ar passwd -found in the include -file +.Em passwd +found in the include file .Aq Pa pwd.h : .Bd -literal -offset indent struct passwd { @@ -87,22 +85,20 @@ The functions .Fn getpwnam and .Fn getpwuid -search the password database for the given login name or user uid, +search the password database for the given login name or user ID, respectively, always returning the first one encountered. .Pp -The .Fn getpwent -function sequentially reads the password database and is intended for programs that wish to process the complete list of users. .Pp -The .Fn setpassent -function accomplishes two purposes. First, it causes .Fn getpwent -to ``rewind'' to the beginning of the database. +to +.Dq rewind +to the beginning of the database. Additionally, if .Fa stayopen is non-zero, file descriptors are left open, significantly speeding @@ -115,9 +111,7 @@ It is dangerous for long-running programs to keep the file descriptors open as the database will become out of date if it is updated while the program is running. .Pp -The .Fn setpwent -function is equivalent to .Fn setpassent with an argument of zero. @@ -127,9 +121,11 @@ The function closes any open files. .Pp -These routines have been written to ``shadow'' the password file, e.g. +These routines have been written to +.Dq shadow +the password file, e.g., allow only certain programs to have access to the encrypted password. -If the process which calls them has an effective uid of 0, the encrypted +If the process which calls them has an effective UID of 0, the encrypted password will be returned, otherwise, the password field of the returned structure will point to the string .Ql * . @@ -138,12 +134,14 @@ The functions .Fn getpwent , .Fn getpwnam , and -.Fn getpwuid , +.Fn getpwuid return a valid pointer to a passwd structure on success -and a null pointer if end-of-file is reached or an error occurs. +or a +.Dv NULL +pointer if end-of-file is reached or an error occurs. The .Fn setpassent -function returns 0 on failure and 1 on success. +function returns 0 on failure or 1 on success. The .Fn endpwent and @@ -153,13 +151,13 @@ have no return value. .Sh FILES .Bl -tag -width /etc/master.passwd -compact .It Pa /etc/pwd.db -The insecure password database file +insecure password database file .It Pa /etc/spwd.db -The secure password database file +secure password database file .It Pa /etc/master.passwd -The current password file +current password file .It Pa /etc/passwd -A Version 7 format password file +a Version 7 format password file .El .Sh SEE ALSO .Xr getlogin 2 , @@ -169,16 +167,16 @@ A Version 7 format password file .Xr vipw 8 .Sh HISTORY The -.Nm getpwent , -.Nm getpwnam , -.Nm getpwuid , -.Nm setpwent, +.Fn getpwent , +.Fn getpwnam , +.Fn getpwuid , +.Fn setpwent, and -.Nm endpwent +.Fn endpwent functions appeared in .At v7 . The -.Nm setpassent +.Fn setpassent function appeared in .Bx 4.3 Reno . .Sh BUGS @@ -186,7 +184,7 @@ The functions .Fn getpwent , .Fn getpwnam , and -.Fn getpwuid , +.Fn getpwuid leave their results in an internal static object and return a pointer to that object. Subsequent calls to any of these functions diff --git a/lib/libc/gen/getttyent.3 b/lib/libc/gen/getttyent.3 index 52cd4c15291..7f8bcd7da74 100644 --- a/lib/libc/gen/getttyent.3 +++ b/lib/libc/gen/getttyent.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getttyent.3,v 1.5 1999/05/25 01:50:57 aaron Exp $ +.\" $OpenBSD: getttyent.3,v 1.6 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -79,13 +79,13 @@ struct ttyent { The fields are as follows: .Bl -tag -width ty_comment .It Fa ty_name -The name of the character-special file. +Name of the character-special file. .It Fa ty_getty -The name of the command invoked by +Name of the command invoked by .Xr init 8 to initialize tty line characteristics. .It Fa ty_type -The name of the default terminal type connected to this tty line. +Name of the default terminal type connected to this tty line. .It Fa ty_status A mask of bit fields which indicate various actions allowed on this tty line. @@ -98,11 +98,11 @@ will start the command referenced by .Fa ty_getty on this entry). .It Dv TTY_SECURE -Allow users with a uid of 0 to login on this terminal. +Allow users with a UID of 0 to login on this terminal. .It Dv TTY_LOCAL If the terminal port's driver supports it, cause the line to be treated as -.Dq local. +.Dq local . .It Dv TTY_MDMBUF If the terminal port's driver supports it, use DTR/DCD hardware flow control on the line by default. @@ -115,7 +115,7 @@ If the terminal port's driver supports it, ignore hardware carrier on the line. .El .It Fa ty_window -The command to execute for a window system associated with the line. +Command to execute for a window system associated with the line. .It Fa ty_comment Any trailing comment field, with any leading hash marks .Pq Sq \&# @@ -123,7 +123,9 @@ or whitespace removed. .El .Pp If any of the fields pointing to character strings are unspecified, -they are returned as null pointers. +they are returned as +.Dv NULL +pointers. The field .Fa ty_status will be zero if no flag values are specified. @@ -137,18 +139,12 @@ The .Fn getttyent function reads the next line from the ttys file, opening the file if necessary. -The .Fn setttyent -function rewinds the file if open, or opens the file if it is unopened. -The .Fn endttyent -function closes any open files. .Pp -The .Fn getttynam -function searches from the beginning of the file until a matching .Fa name is found @@ -160,7 +156,9 @@ The routines .Fn getttyent and .Fn getttynam -return a null pointer on +return a +.Dv NULL +pointer on .Dv EOF or error. The @@ -168,7 +166,7 @@ The function and .Fn endttyent -return 0 on failure and 1 on success. +return 0 on failure or 1 on success. .Sh FILES .Bl -tag -width /etc/ttys -compact .It Pa /etc/ttys diff --git a/lib/libc/gen/getusershell.3 b/lib/libc/gen/getusershell.3 index bce81ea3dcd..2159e7bea3f 100644 --- a/lib/libc/gen/getusershell.3 +++ b/lib/libc/gen/getusershell.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getusershell.3,v 1.4 1999/05/23 14:11:00 aaron Exp $ +.\" $OpenBSD: getusershell.3,v 1.5 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -58,7 +58,7 @@ If .Pa /etc/shells is unreadable or does not exist, .Fn getusershell -behaves as if +behaves as if only .Pa /bin/sh and .Pa /bin/csh @@ -80,7 +80,9 @@ closes it. .Sh DIAGNOSTICS The routine .Fn getusershell -returns a null pointer (0) on +returns a +.Dv NULL +pointer on .Dv EOF . .Sh SEE ALSO .Xr shells 5 diff --git a/lib/libc/gen/glob.3 b/lib/libc/gen/glob.3 index 89d71f08c91..1c9a77894fc 100644 --- a/lib/libc/gen/glob.3 +++ b/lib/libc/gen/glob.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: glob.3,v 1.7 1998/02/03 18:25:55 millert Exp $ +.\" $OpenBSD: glob.3,v 1.8 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1989, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -54,9 +54,9 @@ is a pathname generator that implements the rules for file name pattern matching used by the shell. .Pp The include file -.Pa glob.h +.Aq Pa glob.h defines the structure type -.Fa glob_t , +.Em glob_t , which contains at least the following fields: .Bd -literal typedef struct { @@ -71,9 +71,7 @@ typedef struct { The argument .Fa pattern is a pointer to a pathname pattern to be expanded. -The .Fn glob -argument matches all accessible pathnames against the pattern and creates a list of the pathnames that match. In order to have access to a pathname, @@ -87,12 +85,9 @@ that contains any of the special characters or .Ql [ . .Pp -The -.Fn glob -argument -stores the number of matched pathnames into the +The number of matched pathnames is stored in the .Fa gl_pathc -field, and a pointer to a list of pointers to pathnames into the +field, and a pointer to a list of pointers to pathnames in the .Fa gl_pathv field. The first pointer after the last pathname is @@ -115,10 +110,10 @@ is used to modify the behavior of The value of .Fa flags is the bitwise inclusive -.Tn OR +.Em OR of any of the following values defined in -.Pa glob.h : +.Aq Pa glob.h : .Bl -tag -width GLOB_ALTDIRFUNC .It Dv GLOB_APPEND Append pathnames generated to the ones from a previous call (or calls) @@ -208,8 +203,12 @@ however, they are non-standard extensions to .St -p1003.2 . .Bl -tag -width GLOB_ALTDIRFUNC .It Dv GLOB_ALTDIRFUNC -The following additional fields in the pglob structure have been -initialized with alternate functions for glob to use to open, read, +The following additional fields in the +.Fa pglob +structure have been +initialized with alternate functions for +.Fn glob +to use to open, read, and close directories and to get stat information on names found in those directories. .Bd -literal @@ -231,7 +230,7 @@ strings like The pattern .Ql {} is left unexpanded for historical reasons. -.Xr (Csh 1 +.Xr (csh 1 does the same thing to ease typing of @@ -249,7 +248,11 @@ Is the same as .Dv GLOB_NOCHECK but it only appends the .Fa pattern -if it does not contain any of the special characters ``*'', ``?'' or ``[''. +if it does not contain any of the special characters +.Ql * , +.Ql ? , +or +.Ql [ . .Dv GLOB_NOMAGIC is provided to simplify implementing the historic .Xr csh 1 @@ -272,19 +275,19 @@ is calls .Fa (*errfunc)(path, errno) . This may be unintuitive: a pattern like -.Ql */Makefile +.Dq */Makefile will try to .Xr stat 2 -.Ql foo/Makefile +.Dq foo/Makefile even if -.Ql foo +.Dq foo is not a directory, resulting in a call to .Fa errfunc . The error routine can suppress this action by testing for -.Dv ENOENT +.Er ENOENT and -.Dv ENOTDIR ; +.Er ENOTDIR ; however, the .Dv GLOB_ERR flag will still cause an immediate @@ -333,26 +336,30 @@ In addition the fields of contain the values described below: .Bl -tag -width GLOB_NOCHECK .It Fa gl_pathc -contains the total number of matched pathnames so far. +Contains the total number of matched pathnames so far. This includes other matches from previous invocations of .Fn glob if .Dv GLOB_APPEND was specified. .It Fa gl_matchc -contains the number of matched pathnames in the current invocation of +Contains the number of matched pathnames in the current invocation of .Fn glob . .It Fa gl_flags -contains a copy of the +Contains a copy of the .Fa flags parameter with the bit .Dv GLOB_MAGCHAR set if .Fa pattern -contained any of the special characters ``*'', ``?'' or ``['', cleared -if not. +contained any of the special characters +.Ql * , +.Ql ? , +or +.Ql [ , +cleared if not. .It Fa gl_pathv -contains a pointer to a +Contains a pointer to a .Dv NULL Ns -terminated list of matched pathnames. However, if diff --git a/lib/libc/gen/initgroups.3 b/lib/libc/gen/initgroups.3 index ac43105d248..533afe27795 100644 --- a/lib/libc/gen/initgroups.3 +++ b/lib/libc/gen/initgroups.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: initgroups.3,v 1.5 1999/05/23 14:11:00 aaron Exp $ +.\" $OpenBSD: initgroups.3,v 1.6 1999/05/29 19:11:11 aaron Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -69,7 +69,7 @@ the later groups are ignored. The .Fn initgroups function -returns \-1 if it was not invoked by the super-user. +returns -1 if it was not invoked by the super-user. .Sh SEE ALSO .Xr setgroups 2 , .Xr getgrouplist 3 @@ -80,7 +80,7 @@ function appeared in .Bx 4.2 . .Sh BUGS The -.Fn getgrouplist +.Xr getgrouplist 3 function called by .Fn initgroups uses the routines based on |