diff options
| author | cgd <cgd@NetBSD.org> | 1995-02-27 12:31:34 +0000 |
|---|---|---|
| committer | cgd <cgd@NetBSD.org> | 1995-02-27 12:31:34 +0000 |
| commit | 4eab61bd40c07b2fc612ad50cface2b77fc110d0 (patch) | |
| tree | 7118747f1d9919499fdea5d7c6908c5cfe04e5a8 /lib/libc/sys | |
| parent | c67e54a2e2b9f3d455a30d68ea4e09e56d7b9136 (diff) | |
merge with lite, keeping most local changes. clean up Ids
Diffstat (limited to 'lib/libc/sys')
95 files changed, 1572 insertions, 806 deletions
diff --git a/lib/libc/sys/_exit.2 b/lib/libc/sys/_exit.2 index e5fa6e598b7..402de8fb9b1 100644 --- a/lib/libc/sys/_exit.2 +++ b/lib/libc/sys/_exit.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: _exit.2,v 1.6 1995/02/27 12:31:34 cgd Exp $ +.\" +.\" Copyright (c) 1980, 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)_exit.2 6.6 (Berkeley) 7/25/91 -.\" $Id: _exit.2,v 1.5 1994/10/17 23:49:08 cgd Exp $ +.\" @(#)_exit.2 8.1 (Berkeley) 6/4/93 .\" -.Dd July 25, 1991 +.Dd June 4, 1993 .Dt EXIT 2 .Os BSD 4 .Sh NAME @@ -40,7 +41,7 @@ .Nd terminate the calling process .Sh SYNOPSIS .Fd #include <unistd.h> -.Ft void +.Ft void .Fn _exit "int status" .Sh DESCRIPTION The @@ -56,13 +57,13 @@ a process in this state may not be killed, as it is already dying. If the parent process of the calling process has an outstanding .Xr wait call -or is interested in the +or catches the .Dv SIGCHLD signal, it is notified of the calling process's termination and the .Em status -area is set as defined by +is set as defined by .Xr wait 2 . .It The parent process-ID of all of the calling process's existing child @@ -70,8 +71,26 @@ processes are set to 1; the initialization process (see the DEFINITIONS section of .Xr intro 2 ) inherits each of these processes. -Any stopped children are restarted with a hangup signal -.Pq Dv SIGHUP . +.It +If the termination of the process causes any process group +to become orphaned (usually because the parents of all members +of the group have now exited; see +.Dq orphaned process group +in +.Xr intro 2 ) , +and if any member of the orphaned group is stopped, +the +.Dv SIGHUP +signal and the +.Dv SIGCONT +signal are sent to all members of the newly-orphaned process group. +.It +If the process is a controlling process (see +.Xr intro 2 ) , +the +.Dv SIGHUP +signal is sent to the foreground process group of the controlling terminal, +and all current access to the controlling terminal is revoked. .El .Pp Most C programs call the library routine @@ -88,8 +107,8 @@ can never return. .Xr sigaction 2 , .Xr wait 2 , .Xr exit 3 -.Sh HISTORY -An -.Fn exit -function call appeared in -.At v6 . +.Sh STANDARDS +The +.Nm _exit +function is defined by +.St -p1003.1-88 . diff --git a/lib/libc/sys/accept.2 b/lib/libc/sys/accept.2 index 8a533b5bcad..e45a6de4963 100644 --- a/lib/libc/sys/accept.2 +++ b/lib/libc/sys/accept.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1990, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: accept.2,v 1.6 1995/02/27 12:31:41 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)accept.2 6.6 (Berkeley) 4/29/91 -.\" $Id: accept.2,v 1.5 1994/01/10 23:54:08 jtc Exp $ +.\" @(#)accept.2 8.2 (Berkeley) 12/11/93 .\" -.Dd April 29, 1991 +.Dd December 11, 1993 .Dt ACCEPT 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2 index df3e5e34dad..495253eab03 100644 --- a/lib/libc/sys/access.2 +++ b/lib/libc/sys/access.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: access.2,v 1.7 1995/02/27 12:31:44 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)access.2 6.7 (Berkeley) 3/10/91 -.\" $Id: access.2,v 1.6 1994/04/22 00:13:22 jtc Exp $ +.\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" -.Dd March 10, 1991 +.Dd April 1, 1994 .Dt ACCESS 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/acct.2 b/lib/libc/sys/acct.2 index 0d5522c8cb8..5c041ec7e86 100644 --- a/lib/libc/sys/acct.2 +++ b/lib/libc/sys/acct.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: acct.2,v 1.6 1995/02/27 12:31:47 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)acct.2 6.5 (Berkeley) 3/10/91 -.\" $Id: acct.2,v 1.5 1994/04/22 00:13:24 jtc Exp $ +.\" @(#)acct.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt ACCT 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/adjtime.2 b/lib/libc/sys/adjtime.2 index 581d0b1e341..dde344727bd 100644 --- a/lib/libc/sys/adjtime.2 +++ b/lib/libc/sys/adjtime.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: adjtime.2,v 1.4 1995/02/27 12:31:52 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)adjtime.2 1.7 (Berkeley) 3/10/91 -.\" $Id: adjtime.2,v 1.3 1993/11/25 00:38:23 jtc Exp $ +.\" @(#)adjtime.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt ADJTIME 2 .Os BSD 4.3 .Sh NAME diff --git a/lib/libc/sys/bind.2 b/lib/libc/sys/bind.2 index a976bd328b1..be5aac93bd5 100644 --- a/lib/libc/sys/bind.2 +++ b/lib/libc/sys/bind.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: bind.2,v 1.7 1995/02/27 12:31:54 cgd Exp $ +.\" +.\" Copyright (c) 1983, 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)bind.2 6.9 (Berkeley) 3/10/91 -.\" $Id: bind.2,v 1.6 1994/04/22 00:13:25 jtc Exp $ +.\" @(#)bind.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt BIND 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/brk.2 b/lib/libc/sys/brk.2 index f61a2e6a988..0c3e20434e3 100644 --- a/lib/libc/sys/brk.2 +++ b/lib/libc/sys/brk.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: brk.2,v 1.7 1995/02/27 12:31:57 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)brk.2 6.5 (Berkeley) 3/10/91 -.\" $Id: brk.2,v 1.6 1994/01/10 23:54:10 jtc Exp $ +.\" @(#)brk.2 8.2 (Berkeley) 12/11/93 .\" -.Dd March 10, 1991 +.Dd December 11, 1993 .Dt BRK 2 .Os BSD 4 .Sh NAME @@ -104,30 +105,32 @@ for the definition of .Em etext ) . .Sh RETURN VALUES .Nm Brk -returns 0 if successful; -1 if the process requests more memory than -than allowed by the system limit. +returns a pointer to the new end of memory if successful; +otherwise -1 with +.Va errno +set to indicate why the allocation failed. The .Nm sbrk -function returns 0 if successful, otherwise the error -.Er EOPNOTSUPP -is returned. -.\" .Sh ERRORS -.\" .Xr Sbrk -.\" returns -1 if the break could not be set. -.\" will fail and no additional memory will be allocated if -.\" one of the following are true: -.\" .Bl -tag -width Er -.\" .It Bq Er ENOMEM -.\" The limit, as set by -.\" .Xr setrlimit 2 , -.\" was exceeded. -.\" .It Bq Er ENOMEM -.\" The maximum possible size of a data segment (compiled into the -.\" system) was exceeded. -.\" .It Bq Er ENOMEM -.\" Insufficient space existed in the swap area -.\" to support the expansion. -.\" .El +function returns a pointer to the base of the new storage if successful; +otherwise -1 with +.Va errno +set to indicate why the allocation failed. +.Sh ERRORS +.Xr Sbrk +will fail and no additional memory will be allocated if +one of the following are true: +.Bl -tag -width Er +.It Bq Er ENOMEM +The limit, as set by +.Xr setrlimit 2 , +was exceeded. +.It Bq Er ENOMEM +The maximum possible size of a data segment (compiled into the +system) was exceeded. +.It Bq Er ENOMEM +Insufficient space existed in the swap area +to support the expansion. +.El .Sh SEE ALSO .Xr execve 2 , .Xr getrlimit 2 , diff --git a/lib/libc/sys/chdir.2 b/lib/libc/sys/chdir.2 index dbf1c52d355..407f709e2f3 100644 --- a/lib/libc/sys/chdir.2 +++ b/lib/libc/sys/chdir.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: chdir.2,v 1.7 1995/02/27 12:32:00 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)chdir.2 6.7 (Berkeley) 3/10/91 -.\" $Id: chdir.2,v 1.6 1994/04/22 00:13:26 jtc Exp $ +.\" @(#)chdir.2 8.2 (Berkeley) 12/11/93 .\" -.Dd March 10, 1991 +.Dd December 11, 1993 .Dt CHDIR 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/chflags.2 b/lib/libc/sys/chflags.2 index 4c4ef163f58..061103bdf3c 100644 --- a/lib/libc/sys/chflags.2 +++ b/lib/libc/sys/chflags.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1989 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: chflags.2,v 1.6 1995/02/27 12:32:03 cgd Exp $ +.\" +.\" Copyright (c) 1989, 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)chflags.2 6.6 (Berkeley) 7/25/91 -.\" $Id: chflags.2,v 1.5 1994/04/22 00:13:27 jtc Exp $ +.\" @(#)chflags.2 8.1 (Berkeley) 6/9/93 .\" -.Dd July 25, 1991 +.Dd June 9, 1993 .Dt CHFLAGS 2 .Os .Sh NAME @@ -40,11 +41,12 @@ .Nm fchflags .Nd set file flags .Sh SYNOPSIS +.Fd #include <sys/stat.h> .Fd #include <unistd.h> .Ft int -.Fn chflags "const char *path" "long flags" +.Fn chflags "const char *path" "u_long flags" .Ft int -.Fn fchflags "int fd" "long flags" +.Fn fchflags "int fd" "u_long flags" .Sh DESCRIPTION The file whose name is given by @@ -54,9 +56,41 @@ or referenced by the descriptor has its flags changed to .Fa flags . .Pp -Only the owner of a file (or the super-user) may change the flags. -The owner may only change the lower 16 bits of the flags; -the super-user may change all 32 bits of the flags. +The flags specified are formed by +.Em or Ns 'ing +the following values +.Pp +.Bl -tag -width "SF_IMMUTABLE" -compact -offset indent +.It UF_NODUMP +Do not dump the file. +.It UF_IMMUTABLE +The file may not be changed. +.It UF_APPEND +The file may only be appended to. +.\".It ARCHIVED +.\"File is archived. +.It SF_IMMUTABLE +The file may not be changed. +.It SF_APPEND +The file may only be appended to. +.El +.Pp +The +.Dq UF_IMMUTABLE +and +.Dq UF_APPEND +flags may be set or unset by either the owner of a file or the super-user. +.Pp +The +.Dq SF_IMMUTABLE +and +.Dq SF_APPEND +flags may only be set or unset by the super-user. +They may be set at any time, but normally may only be unset when +the system is in single-user mode. +(See +.Xr init 8 +for details.) .Sh RETURN VALUES Upon successful completion, a value of 0 is returned. Otherwise, -1 is returned and the global variable @@ -64,7 +98,7 @@ Otherwise, -1 is returned and the global variable is set to indicate the error. .Sh ERRORS .Fn Chflags -fails if: +will fail it: .Bl -tag -width Er .It Bq Er ENOTDIR A component of the path prefix is not a directory. @@ -113,14 +147,11 @@ An error occurred while reading from or writing to the file system. .El .Sh SEE ALSO -.Xr chmod 2 , -.Xr open 2 , -.Xr chown 2 , -.Xr stat 2 +.Xr chflags 1, +.Xr init 8 .Sh HISTORY The .Fn chflags and -.Fn fchflags -function calls are -.Ud . +.Nm fchflags +functions first appeared in 4.4BSD. diff --git a/lib/libc/sys/chmod.2 b/lib/libc/sys/chmod.2 index 3da8fcf80b7..302be5974d4 100644 --- a/lib/libc/sys/chmod.2 +++ b/lib/libc/sys/chmod.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: chmod.2,v 1.7 1995/02/27 12:32:06 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)chmod.2 6.6 (Berkeley) 3/10/91 -.\" $Id: chmod.2,v 1.6 1994/04/22 00:13:29 jtc Exp $ +.\" @(#)chmod.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt CHMOD 2 .Os BSD 4 .Sh NAME @@ -68,7 +69,7 @@ the file specified by or is the super-user. A mode is created from -.Em or Ap d +.Em or'd permission bit masks defined in .Aq Pa sys/stat.h : diff --git a/lib/libc/sys/chown.2 b/lib/libc/sys/chown.2 index 3e178e7e5f3..bdb1c6b0eca 100644 --- a/lib/libc/sys/chown.2 +++ b/lib/libc/sys/chown.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: chown.2,v 1.9 1995/02/27 12:32:09 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)chown.2 6.7 (Berkeley) 3/10/91 -.\" $Id: chown.2,v 1.8 1994/04/22 00:13:30 jtc Exp $ +.\" @(#)chown.2 8.4 (Berkeley) 4/19/94 .\" -.Dd March 10, 1991 +.Dd April 19, 1994 .Dt CHOWN 2 .Os BSD 4 .Sh NAME @@ -45,7 +46,7 @@ .Ft int .Fn chown "const char *path" "uid_t owner" "gid_t group" .Ft int -.Fn fchown "int fd" "uid_t owner" "gid_t group" +.Fn fchown "int fd" "uid_t owner" "uid_t group" .Sh DESCRIPTION The owner ID and group ID of the file named by @@ -77,12 +78,6 @@ with the file locking primitives (see .Pp One of the owner or group id's may be left unchanged by specifying it as -1. -.Pp -If the final component of -.Fa path -is a symbolic link, -the ownership and group of the symbolic link is changed, -not the ownership and group of the file or directory to which it points. .Sh RETURN VALUES Zero is returned if the operation was successful; -1 is returned if an error occurs, with a more specific @@ -148,3 +143,10 @@ The .Fn fchown function call appeared in .Bx 4.2 . +.Pp +The +.Fn chown +and +.Fn fchown +functions were changed to follow symbolic links in +.Bx 4.4 . diff --git a/lib/libc/sys/chroot.2 b/lib/libc/sys/chroot.2 index fa45ac74483..74c64ee4b49 100644 --- a/lib/libc/sys/chroot.2 +++ b/lib/libc/sys/chroot.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: chroot.2,v 1.7 1995/02/27 12:32:12 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)chroot.2 6.5 (Berkeley) 3/10/91 -.\" $Id: chroot.2,v 1.6 1994/04/22 00:13:31 jtc Exp $ +.\" @(#)chroot.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt CHROOT 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/close.2 b/lib/libc/sys/close.2 index 8cb7d604aab..5cd4d18ec36 100644 --- a/lib/libc/sys/close.2 +++ b/lib/libc/sys/close.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: close.2,v 1.5 1995/02/27 12:32:14 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)close.2 6.4 (Berkeley) 3/10/91 -.\" $Id: close.2,v 1.4 1994/01/10 23:54:16 jtc Exp $ +.\" @(#)close.2 8.2 (Berkeley) 4/19/94 .\" -.Dd March 10, 1991 +.Dd April 19, 1994 .Dt CLOSE 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/connect.2 b/lib/libc/sys/connect.2 index 37f098f028a..5ea30f4d647 100644 --- a/lib/libc/sys/connect.2 +++ b/lib/libc/sys/connect.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: connect.2,v 1.7 1995/02/27 12:32:17 cgd Exp $ +.\" +.\" Copyright (c) 1983, 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)connect.2 6.9 (Berkeley) 3/10/91 -.\" $Id: connect.2,v 1.6 1994/04/22 00:13:32 jtc Exp $ +.\" @(#)connect.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt CONNECT 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/dup.2 b/lib/libc/sys/dup.2 index 982a19682fa..b9c0b1980fa 100644 --- a/lib/libc/sys/dup.2 +++ b/lib/libc/sys/dup.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: dup.2,v 1.4 1995/02/27 12:32:21 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)dup.2 6.4 (Berkeley) 3/10/91 -.\" $Id: dup.2,v 1.3 1993/11/25 00:38:36 jtc Exp $ +.\" @(#)dup.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt DUP 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/execve.2 b/lib/libc/sys/execve.2 index b9eee61e27f..c5c9838e611 100644 --- a/lib/libc/sys/execve.2 +++ b/lib/libc/sys/execve.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: execve.2,v 1.9 1995/02/27 12:32:25 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)execve.2 6.9 (Berkeley) 3/10/91 -.\" $Id: execve.2,v 1.8 1994/10/17 23:49:10 cgd Exp $ +.\" @(#)execve.2 8.3 (Berkeley) 1/24/94 .\" -.Dd March 10, 1991 +.Dd January 24, 1994 .Dt EXECVE 2 .Os BSD 4 .Sh NAME @@ -41,7 +42,7 @@ .Sh SYNOPSIS .Fd #include <unistd.h> .Ft int -.Fn execve "const char *path" "const * char *argv" "const * char *envp" +.Fn execve "const char *path" "char *const argv[]" "char *const envp[]" .Sh DESCRIPTION .Fn Execve transforms the calling process into a new process. @@ -70,7 +71,7 @@ When an interpreter file is .Fn execve Ap d , the system .Fn execve Ap s -the specified +runs the specified .Em interpreter . If the optional .Em arg @@ -132,9 +133,15 @@ of the new process image file. If the set-group-ID mode bit of the new process image file is set, the effective group ID of the new process image is set to the group ID of the new process image file. +(The effective group ID is the first element of the group list.) The real user ID, real group ID and -supplementary group IDs of the new process image remain the same as the calling +other group IDs of the new process image remain the same as the calling process image. +After any set-user-ID and set-group-ID processing, +the effective user ID is recorded as the saved set-user-ID, +and the effective group ID is recorded as the saved set-group-ID. +These values may be used in changing the effective IDs later (see +.Xr setuid 2 ) . .Pp The new process also inherits the following attributes from the calling process: diff --git a/lib/libc/sys/fcntl.2 b/lib/libc/sys/fcntl.2 index ac40fac0a4c..c587b948bfd 100644 --- a/lib/libc/sys/fcntl.2 +++ b/lib/libc/sys/fcntl.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: fcntl.2,v 1.6 1995/02/27 12:32:29 cgd Exp $ +.\" +.\" Copyright (c) 1983, 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)fcntl.2 6.7 (Berkeley) 3/10/91 -.\" $Id: fcntl.2,v 1.5 1994/10/17 23:49:12 cgd Exp $ +.\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" -.Dd March 10, 1991 +.Dd January 12, 1994 .Dt FCNTL 2 .Os BSD 4.2 .Sh NAME @@ -126,15 +127,15 @@ The flags for the and .Dv F_SETFL flags are as follows: -.Bl -tag -width F_GETOWNX -.It Dv O_NDELAY +.Bl -tag -width O_NONBLOCKX +.It Dv O_NONBLOCK Non-blocking I/O; if no data is available to a .Xr read call, or if a .Xr write operation would block, the read or write call returns -1 with the error -.Er EWOULDBLOCK . +.Er EAGAIN . .It Dv O_APPEND Force each write to append at the end of file; corresponds to the @@ -148,6 +149,189 @@ signal to be sent to the process group when I/O is possible, e.g., upon availability of data to be read. .El +.Pp +Several commands are available for doing advisory file locking; +they all operate on the following structure: +.ne 7v +.Bd -literal +struct flock { + off_t l_start; /* starting offset */ + off_t l_len; /* len = 0 means until end of file */ + pid_t l_pid; /* lock owner */ + short l_type; /* lock type: read/write, etc. */ + short l_whence; /* type of l_start */ +}; +.Ed +The commands available for advisory record locking are as follows: +.Bl -tag -width F_SETLKWX +.It Dv F_GETLK +Get the first lock that blocks the lock description pointed to by the +third argument, +.Fa arg , +taken as a pointer to a +.Fa "struct flock" +(see above). +The information retrieved overwrites the information passed to +.Nm fcntl +in the +.Fa flock +structure. +If no lock is found that would prevent this lock from being created, +the structure is left unchanged by this function call except for the +lock type which is set to +.Dv F_UNLCK . +.It Dv F_SETLK +Set or clear a file segment lock according to the lock description +pointed to by the third argument, +.Fa arg , +taken as a pointer to a +.Fa "struct flock" +(see above). +.Dv F_SETLK +is used to establish shared (or read) locks +.Dv (F_RDLCK) +or exclusive (or write) locks, +.Dv (F_WRLCK) , +as well as remove either type of lock +.Dv (F_UNLCK) . +If a shared or exclusive lock cannot be set, +.Nm fcntl +returns immediately with +.Er EACCES . +.It Dv F_SETLKW +This command is the same as +.Dv F_SETLK +except that if a shared or exclusive lock is blocked by other locks, +the process waits until the request can be satisfied. +If a signal that is to be caught is received while +.Nm fcntl +is waiting for a region, the +.Nm fcntl +will be interrupted if the signal handler has not specified the +.Dv SA_RESTART +(see +.Xr sigaction 2 ) . +.El +.Pp +When a shared lock has been set on a segment of a file, +other processes can set shared locks on that segment +or a portion of it. +A shared lock prevents any other process from setting an exclusive +lock on any portion of the protected area. +A request for a shared lock fails if the file descriptor was not +opened with read access. +.Pp +An exclusive lock prevents any other process from setting a shared lock or +an exclusive lock on any portion of the protected area. +A request for an exclusive lock fails if the file was not +opened with write access. +.Pp +The value of +.Fa l_whence +is +.Dv SEEK_SET , +.Dv SEEK_CUR , +or +.Dv SEEK_END +to indicate that the relative offset, +.Fa l_start +bytes, will be measured from the start of the file, +current position, or end of the file, respectively. +The value of +.Fa l_len +is the number of consecutive bytes to be locked. +If +.Fa l_len +is negative, the result is undefined. +The +.Fa l_pid +field is only used with +.Dv F_GETLK +to return the process ID of the process holding a blocking lock. +After a successful +.Dv F_GETLK +request, the value of +.Fa l_whence +is +.Dv SEEK_SET . +.Pp +Locks may start and extend beyond the current end of a file, +but may not start or extend before the beginning of the file. +A lock is set to extend to the largest possible value of the +file offset for that file if +.Fa l_len +is set to zero. If +.Fa l_whence +and +.Fa l_start +point to the beginning of the file, and +.Fa l_len +is zero, the entire file is locked. +If an application wishes only to do entire file locking, the +.Xr flock 2 +system call is much more efficient. +.Pp +There is at most one type of lock set for each byte in the file. +Before a successful return from an +.Dv F_SETLK +or an +.Dv F_SETLKW +request when the calling process has previously existing locks +on bytes in the region specified by the request, +the previous lock type for each byte in the specified +region is replaced by the new lock type. +As specified above under the descriptions +of shared locks and exclusive locks, an +.Dv F_SETLK +or an +.Dv F_SETLKW +request fails or blocks respectively when another process has existing +locks on bytes in the specified region and the type of any of those +locks conflicts with the type specified in the request. +.Pp +This interface follows the completely stupid semantics of System V and +.St -p1003.1-88 +that require that all locks associated with a file for a given process are +removed when \fIany\fP file descriptor for that file is closed by that process. +This semantic means that applications must be aware of any files that +a subroutine library may access. +For example if an application for updating the password file locks the +password file database while making the update, and then calls +.Xr getpwname 3 +to retrieve a record, +the lock will be lost because +.Xr getpwname 3 +opens, reads, and closes the password database. +The database close will release all locks that the process has +associated with the database, even if the library routine never +requested a lock on the database. +Another minor semantic problem with this interface is that +locks are not inherited by a child process created using the +.Xr fork 2 +function. +The +.Xr flock 2 +interface has much more rational last close semantics and +allows locks to be inherited by child processes. +.Xr Flock 2 +is recommended for applications that want to ensure the integrity +of their locks when using library routines or wish to pass locks +to their children. +Note that +.Xr flock 2 +and +.Xr fcntl 2 +locks may be safely used concurrently. +.Pp +All locks associated with a file for a given process are +removed when the process terminates. +.Pp +A potential for deadlock occurs if a process controlling a locked region +is put to sleep by attempting to lock the locked region of another process. +This implementation detects that sleeping until a locked region is unlocked +would cause a deadlock and fails with an +.Er EDEADLK +error. .Sh RETURN VALUES Upon successful completion, the value returned depends on .Fa cmd @@ -172,15 +356,71 @@ is set to indicate the error. .Fn Fcntl will fail if: .Bl -tag -width Er +.It Bq Er EACCES +The argument +.Fa arg +is +.Dv F_SETLK , +the type of lock +.Fa (l_type) +is a shared lock +.Dv (F_RDLCK) +or exclusive lock +.Dv (F_WRLCK) , +and the segment of a file to be locked is already +exclusive-locked by another process; +or the type is an exclusive lock and some portion of the +segment of a file to be locked is already shared-locked or +exclusive-locked by another process. .It Bq Er EBADF .Fa Fildes is not a valid open file descriptor. +.Pp +The argument +.Fa cmd +is +.Dv F_SETLK +or +.Dv F_SETLKW , +the type of lock +.Fa (l_type) +is a shared lock +.Dv (F_RDLCK) , +and +.Fa fildes +is not a valid file descriptor open for reading. +.Pp +The argument +.Fa cmd +is +.Dv F_SETLK +or +.Dv F_SETLKW , +the type of lock +.Fa (l_type) +is an exclusive lock +.Dv (F_WRLCK) , +and +.Fa fildes +is not a valid file descriptor open for writing. .It Bq Er EMFILE .Fa Cmd is .Dv F_DUPFD and the maximum allowed number of file descriptors are currently open. +.It Bq Er EDEADLK +The argument +.Fa cmd +is +.Dv F_SETLKW , +and a deadlock condition was detected. +.It Bq Er EINTR +The argument +.Fa cmd +is +.Dv F_SETLKW , +and the function was interrupted by a signal. .It Bq Er EINVAL .Fa Cmd is @@ -190,6 +430,38 @@ and is negative or greater than the maximum allowable number (see .Xr getdtablesize 2 ) . +.Pp +The argument +.Fa cmd +is +.Dv F_GETLK , +.Dv F_SETLK , +or +.Dv F_SETLKW +and the data to which +.Fa arg +points is not valid, or +.Fa fildes +refers to a file that does not support locking. +.It Bq Er EMFILE +The argument +.Fa cmd +is +.Dv F_DUPED +and the maximum number of file descriptors permitted for the +process are already in use, +or no file descriptors greater than or equal to +.Fa arg +are available. +.It Bq Er ENOLCK +The argument +.Fa cmd +is +.Dv F_SETLK +or +.Dv F_SETLKW , +and satisfying the lock or unlock request would result in the +number of locked regions in the system exceeding a system-imposed limit. .It Bq Er ESRCH .Fa Cmd is @@ -200,15 +472,10 @@ the process ID given as argument is not in use. .Sh SEE ALSO .Xr close 2 , .Xr execve 2 , +.Xr flock 2 , .Xr getdtablesize 2 , .Xr open 2 , .Xr sigaction 3 -.Sh BUGS -The asynchronous I/O facilities of -.Dv FNDELAY -and -.Dv FASYNC -are currently available only for tty and socket operations. .Sh HISTORY The .Fn fcntl diff --git a/lib/libc/sys/flock.2 b/lib/libc/sys/flock.2 index ea3f081a1c6..135e4bb48d9 100644 --- a/lib/libc/sys/flock.2 +++ b/lib/libc/sys/flock.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: flock.2,v 1.5 1995/02/27 12:32:32 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)flock.2 6.7 (Berkeley) 3/10/91 -.\" $Id: flock.2,v 1.4 1993/11/29 21:25:06 jtc Exp $ +.\" @(#)flock.2 8.2 (Berkeley) 12/11/93 .\" -.Dd March 10, 1991 +.Dd December 11, 1993 .Dt FLOCK 2 .Os BSD 4.2 .Sh NAME @@ -54,11 +55,11 @@ lock on the file associated with the file descriptor .Fa fd . A lock is applied by specifying an .Fa operation -parameter that is the inclusive or of +parameter that is one of .Dv LOCK_SH or .Dv LOCK_EX -and, possibly, +with the optional addition of .Dv LOCK_NB . To unlock an existing lock diff --git a/lib/libc/sys/fork.2 b/lib/libc/sys/fork.2 index 887bbe30a3b..e9a81062615 100644 --- a/lib/libc/sys/fork.2 +++ b/lib/libc/sys/fork.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: fork.2,v 1.6 1995/02/27 12:32:36 cgd Exp $ +.\" +.\" 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 @@ -29,12 +31,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)fork.2 6.5 (Berkeley) 3/10/91 -.\" $Id: fork.2,v 1.5 1993/11/29 21:25:07 jtc Exp $ +.\" @(#)fork.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt FORK 2 -.Os BSD 4.0 +.Os BSD 4 .Sh NAME .Nm fork .Nd create a new process @@ -105,6 +106,6 @@ There is insufficient swap space for the new process. .Xr wait 2 .Sh HISTORY A -.Fn fork -function call appeared in +.Fn fork 2 +function call appeared in .At v6 . diff --git a/lib/libc/sys/fsync.2 b/lib/libc/sys/fsync.2 index 5aa5ce6eaad..3f4b0d69455 100644 --- a/lib/libc/sys/fsync.2 +++ b/lib/libc/sys/fsync.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: fsync.2,v 1.4 1995/02/27 12:32:38 cgd Exp $ +.\" +.\" Copyright (c) 1983, 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)fsync.2 6.7 (Berkeley) 3/10/91 -.\" $Id: fsync.2,v 1.3 1993/11/25 00:38:43 jtc Exp $ +.\" @(#)fsync.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt FSYNC 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/getdirentries.2 b/lib/libc/sys/getdirentries.2 index 53148fa7055..4fc670ca3d2 100644 --- a/lib/libc/sys/getdirentries.2 +++ b/lib/libc/sys/getdirentries.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1989, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getdirentries.2,v 1.6 1995/02/27 12:32:41 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getdirentries.2 6.5 (Berkeley) 7/23/91 -.\" $Id: getdirentries.2,v 1.5 1993/11/29 21:25:08 jtc Exp $ +.\" @(#)getdirentries.2 8.1 (Berkeley) 6/9/93 .\" -.Dd July 23, 1991 +.Dd June 9, 1993 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -150,5 +151,4 @@ error occurred while reading from or writing to the file system. .Sh HISTORY The .Fn getdirentries -function call is -.Ud . +function first appeared in 4.4BSD. diff --git a/lib/libc/sys/getfh.2 b/lib/libc/sys/getfh.2 index 249b7202139..fb288d02162 100644 --- a/lib/libc/sys/getfh.2 +++ b/lib/libc/sys/getfh.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1989, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getfh.2,v 1.6 1995/02/27 12:32:44 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getfh.2 6.4 (Berkeley) 7/23/91 -.\" $Id: getfh.2,v 1.5 1994/04/22 00:13:35 jtc Exp $ +.\" @(#)getfh.2 8.1 (Berkeley) 6/9/93 .\" -.Dd July 23, 1991 +.Dd June 9, 1993 .Dt GETFH 2 .Os .Sh NAME @@ -42,7 +43,7 @@ .Fd #include <sys/types.h> .Fd #include <sys/mount.h> .Ft int -.Fn getfh "char *path" "struct fhandle_t *fhp" +.Fn getfh "char *path" "fhandle_t *fhp" .Sh DESCRIPTION .Fn Getfh returns a file handle for the specified file or directory @@ -93,5 +94,5 @@ error occurred while reading from or writing to the file system. .Sh HISTORY The .Fn getfh -function call is -.Ud . +function +first appeared in 4.4BSD. diff --git a/lib/libc/sys/getfsstat.2 b/lib/libc/sys/getfsstat.2 index a1dad17f540..f64d7efb551 100644 --- a/lib/libc/sys/getfsstat.2 +++ b/lib/libc/sys/getfsstat.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1989, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getfsstat.2,v 1.5 1995/02/27 12:32:47 cgd Exp $ +.\" +.\" 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 @@ -29,17 +31,17 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getfsstat.2 6.6 (Berkeley) 7/23/91 -.\" $Id: getfsstat.2,v 1.4 1993/11/29 19:45:02 jtc Exp $ +.\" @(#)getfsstat.2 8.1 (Berkeley) 6/9/93 .\" -.Dd July 23, 1991 +.Dd June 9, 1993 .Dt GETFSSTAT 2 .Os .Sh NAME .Nm getfsstat .Nd get list of all mounted filesystems .Sh SYNOPSIS -.Fd #include <sys/types.h> +.Fd #include <sys/param.h> +.Fd #include <sys/ucred.h> .Fd #include <sys/mount.h> .Ft int .Fn getfsstat "struct statfs *buf" "long bufsize" "int flags" @@ -58,8 +60,8 @@ typedef quad fsid_t; struct statfs { short f_type; /* type of filesystem (see below) */ short f_flags; /* copy of mount flags */ - long f_fsize; /* fundamental filesystem block size */ - long f_bsize; /* optimal transfer block size */ + long f_bsize; /* fundamental filesystem block size */ + long f_iosize; /* optimal transfer block size */ long f_blocks; /* total data blocks in filesystem */ long f_bfree; /* free blocks in fs */ long f_bavail; /* free blocks avail to non-superuser */ @@ -132,5 +134,4 @@ error occurred while reading from or writing to the filesystem. .Sh HISTORY The .Fn getfsstat -function call is -.Ud . +function first appeared in 4.4BSD. diff --git a/lib/libc/sys/getgid.2 b/lib/libc/sys/getgid.2 index 9afb2dfa789..ee395cd65d5 100644 --- a/lib/libc/sys/getgid.2 +++ b/lib/libc/sys/getgid.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getgid.2,v 1.5 1995/02/27 12:32:53 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getgid.2 6.3 (Berkeley) 3/10/91 -.\" $Id: getgid.2,v 1.4 1993/11/25 00:38:50 jtc Exp $ +.\" @(#)getgid.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt GETGID 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/getgroups.2 b/lib/libc/sys/getgroups.2 index 30f3ee682de..ecc9c82eec7 100644 --- a/lib/libc/sys/getgroups.2 +++ b/lib/libc/sys/getgroups.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getgroups.2,v 1.8 1995/02/27 12:32:57 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getgroups.2 6.7 (Berkeley) 3/10/91 -.\" $Id: getgroups.2,v 1.7 1994/04/19 00:09:04 jtc Exp $ +.\" @(#)getgroups.2 8.2 (Berkeley) 4/16/94 .\" -.Dd March 10, 1991 +.Dd April 16, 1994 .Dt GETGROUPS 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/getitimer.2 b/lib/libc/sys/getitimer.2 index ea4d1bf4443..7b612771f3d 100644 --- a/lib/libc/sys/getitimer.2 +++ b/lib/libc/sys/getitimer.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getitimer.2,v 1.5 1995/02/27 12:33:00 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getitimer.2 6.6 (Berkeley) 3/10/91 -.\" $Id: getitimer.2,v 1.4 1994/10/17 23:49:13 cgd Exp $ +.\" @(#)getitimer.2 8.2 (Berkeley) 12/11/93 .\" -.Dd March 10, 1991 +.Dd December 11, 1993 .Dt GETITIMER 2 .Os BSD 4.2 .Sh NAME @@ -153,7 +154,7 @@ parameter specified a bad address. .It Bq Er EINVAL A .Fa value -parameter specified a time was too large +parameter specified a time that was too large to be handled. .El .Sh SEE ALSO diff --git a/lib/libc/sys/getlogin.2 b/lib/libc/sys/getlogin.2 index 5ab96b48617..33f127fada6 100644 --- a/lib/libc/sys/getlogin.2 +++ b/lib/libc/sys/getlogin.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1989, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getlogin.2,v 1.4 1995/02/27 12:33:03 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getlogin.2 6.3 (Berkeley) 7/23/91 -.\" $Id: getlogin.2,v 1.3 1993/11/25 00:38:55 jtc Exp $ +.\" @(#)getlogin.2 8.1 (Berkeley) 6/9/93 .\" -.Dd July 23, 1991 +.Dd June 9, 1993 .Dt GETLOGIN 2 .Os BSD 4.2 .Sh NAME @@ -124,5 +125,4 @@ Portable programs should probably still make this check. .Sh HISTORY The .Fn getlogin -function call is -.Ud . +function first appeared in 4.4BSD. diff --git a/lib/libc/sys/getpeername.2 b/lib/libc/sys/getpeername.2 index 856c61d03d2..e1461d2ee63 100644 --- a/lib/libc/sys/getpeername.2 +++ b/lib/libc/sys/getpeername.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getpeername.2,v 1.5 1995/02/27 12:33:06 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getpeername.2 6.5 (Berkeley) 3/10/91 -.\" $Id: getpeername.2,v 1.4 1993/11/29 21:25:09 jtc Exp $ +.\" @(#)getpeername.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt GETPEERNAME 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/getpgrp.2 b/lib/libc/sys/getpgrp.2 index ac961d650bb..9d5f54da911 100644 --- a/lib/libc/sys/getpgrp.2 +++ b/lib/libc/sys/getpgrp.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getpgrp.2,v 1.8 1995/02/27 12:33:09 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,17 +31,15 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getpgrp.2 6.4 (Berkeley) 3/10/91 -.\" $Id: getpgrp.2,v 1.7 1994/01/31 18:36:17 jtc Exp $ +.\" @(#)getpgrp.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt GETPGRP 2 .Os BSD 4.2 .Sh NAME .Nm getpgrp .Nd get process group .Sh SYNOPSIS -.Fd #include <sys/types.h> .Fd #include <unistd.h> .Ft pid_t .Fn getpgrp "void" @@ -59,16 +59,13 @@ to create process groups in implementing job control. The -.Dv TIOCGPGRP +.Fn tcgetpgrp and -.Dv TIOCSPGRP +.Fn tcsetpgrp calls -described in -.Xr termios 4 are used to get/set the process group of the control terminal. .Sh SEE ALSO -.Xr setpgrp 2 , -.Xr getuid 2 , +.Xr setpgid 2 , .Xr termios 4 .Sh HISTORY The @@ -88,3 +85,19 @@ differs from past Berkeley versions by not taking a argument. This incompatibility is required by .St -p1003.1-88 . +.Pp +From the +.St -p1003.1-88 +Rationale: +.sp +4.3BSD provides a +.Fn getpgrp +function that returns the process group ID for a specified process. +Although this function is used to support job control, all known +job-control shells always specify the calling process with this +function. +Thus, the simpler System V +.Fn getpgrp +suffices, and the added complexity of the 4.3BSD +.Fn getpgrp +has been omitted from POSIX.1. diff --git a/lib/libc/sys/getpid.2 b/lib/libc/sys/getpid.2 index 673d7827573..0c7f5e365ed 100644 --- a/lib/libc/sys/getpid.2 +++ b/lib/libc/sys/getpid.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getpid.2,v 1.5 1995/02/27 12:33:12 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getpid.2 6.4 (Berkeley) 3/10/91 -.\" $Id: getpid.2,v 1.4 1993/11/25 00:39:00 jtc Exp $ +.\" @(#)getpid.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt GETPID 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/getpriority.2 b/lib/libc/sys/getpriority.2 index 52689402255..1c5713afd78 100644 --- a/lib/libc/sys/getpriority.2 +++ b/lib/libc/sys/getpriority.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getpriority.2,v 1.4 1995/02/27 12:33:15 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getpriority.2 6.9 (Berkeley) 3/10/91 -.\" $Id: getpriority.2,v 1.3 1993/11/25 00:39:01 jtc Exp $ +.\" @(#)getpriority.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt GETPRIORITY 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/getrlimit.2 b/lib/libc/sys/getrlimit.2 index ef58cb74b88..c0b8a517395 100644 --- a/lib/libc/sys/getrlimit.2 +++ b/lib/libc/sys/getrlimit.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getrlimit.2,v 1.7 1995/02/27 12:33:19 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getrlimit.2 6.7 (Berkeley) 3/10/91 -.\" $Id: getrlimit.2,v 1.6 1994/12/08 06:49:43 jtc Exp $ +.\" @(#)getrlimit.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt GETRLIMIT 2 .Os BSD 4 .Sh NAME @@ -40,6 +41,7 @@ .Nm setrlimit .Nd control maximum system resource consumption .Sh SYNOPSIS +.Fd #include <sys/types.h> .Fd #include <sys/time.h> .Fd #include <sys/resource.h> .Ft int @@ -58,30 +60,39 @@ The .Fa resource parameter is one of the following: .Bl -tag -width RLIMIT_FSIZEAA -.It Dv RLIMIT_CPU -the maximum amount of cpu time (in seconds) to be used by +.It Li RLIMIT_CORE +The largest size (in bytes) +.Xr core +file that may be created. +.It Li RLIMIT_CPU +The maximum amount of cpu time (in seconds) to be used by each process. -.It Dv RLIMIT_FSIZE -the largest size, in bytes, of any single file that may be created. -.It Dv RLIMIT_DATA -the maximum size, in bytes, of the data segment for a process; +.It Li RLIMIT_DATA +The maximum size (in bytes) of the data segment for a process; this defines how far a program may extend its break with the .Xr sbrk 2 system call. -.It Dv RLIMIT_STACK -the maximum size, in bytes, of the stack segment for a process; +.It Li RLIMIT_FSIZE +The largest size (in bytes) file that may be created. +.It Li RLIMIT_MEMLOCK +The maximum size (in bytes) which a process may lock into memory +using the +.Xr mlock 2 +function. +.It Li RLIMIT_NOFILE +The maximum number of open files for this process. +.It Li RLIMIT_NPROC +The maximum number of simultaneous processes for this user id. +.It Li RLIMIT_RSS +The maximum size (in bytes) to which a process's resident set size may +grow. +This imposes a limit on the amount of physical memory to be given to +a process; if memory is tight, the system will prefer to take memory +from processes that are exceeding their declared resident set size. +.It Li RLIMIT_STACK +The maximum size (in bytes) of the stack segment for a process; this defines how far a program's stack segment may be extended. Stack extension is performed automatically by the system. -.It Dv RLIMIT_CORE -the largest size, in bytes, of a -.Xr core -file that may be created. -.It Dv RLIMIT_RSS -the maximum size, in bytes, to which a process's resident set size may -grow. This imposes a limit on the amount of physical memory -to be given to a process; if memory is tight, the system will -prefer to take memory from processes that are exceeding their -declared resident set size. .El .Pp A resource limit is specified as a soft limit and a hard limit. When a @@ -109,8 +120,7 @@ or (irreversibly) lower An .Dq infinite value for a limit is defined as -.Dv RLIM_INFINITY -(0x7\&f\&f\&f\&f\&f\&f\&f\&f\&f\&f\&f\&f\&f\&f\&f). +.Dv RLIM_INFINITY . .Pp Because this information is stored in the per-process information, this system call must be executed directly by the shell if it @@ -165,7 +175,8 @@ raised the maximum limit value, and the caller is not the super-user. .Xr csh 1 , .Xr quota 2 , .Xr sigaction 2 , -.Xr sigstack 2 +.Xr sigaltstack 2 , +.Xr sysctl 3 .Sh BUGS There should be .Ic limit diff --git a/lib/libc/sys/getrusage.2 b/lib/libc/sys/getrusage.2 index 632c998f095..a361d1d3662 100644 --- a/lib/libc/sys/getrusage.2 +++ b/lib/libc/sys/getrusage.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1985, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getrusage.2,v 1.4 1995/02/27 12:33:23 cgd Exp $ +.\" +.\" Copyright (c) 1985, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getrusage.2 6.9 (Berkeley) 3/10/91 -.\" $Id: getrusage.2,v 1.3 1993/11/25 00:39:04 jtc Exp $ +.\" @(#)getrusage.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt GETRUSAGE 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/getsockname.2 b/lib/libc/sys/getsockname.2 index 50794431086..bf78b173119 100644 --- a/lib/libc/sys/getsockname.2 +++ b/lib/libc/sys/getsockname.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getsockname.2,v 1.5 1995/02/27 12:33:26 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getsockname.2 6.4 (Berkeley) 3/10/91 -.\" $Id: getsockname.2,v 1.4 1993/11/29 21:25:11 jtc Exp $ +.\" @(#)getsockname.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt GETSOCKNAME 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/getsockopt.2 b/lib/libc/sys/getsockopt.2 index 49b583fceff..5fb33ce8bb8 100644 --- a/lib/libc/sys/getsockopt.2 +++ b/lib/libc/sys/getsockopt.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getsockopt.2,v 1.7 1995/02/27 12:33:29 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getsockopt.2 6.9 (Berkeley) 5/1/91 -.\" $Id: getsockopt.2,v 1.6 1994/03/16 02:04:14 cgd Exp $ +.\" @(#)getsockopt.2 8.3 (Berkeley) 4/19/94 .\" -.Dd May 1, 1991 +.Dd April 19, 1994 .Dt GETSOCKOPT 2 .Os BSD 4.3r .Sh NAME @@ -139,6 +140,7 @@ and set with .Bl -column SO_OOBINLINE -offset indent .It Dv SO_DEBUG Ta "enables recording of debugging information" .It Dv SO_REUSEADDR Ta "enables local address reuse" +.It Dv SO_REUSEPORT Ta "enables duplicate address and port bindings" .It Dv SO_KEEPALIVE Ta "enables keep connections alive" .It Dv SO_DONTROUTE Ta "enables routing bypass for outgoing messages" .It Dv SO_LINGER Ta "linger on close if data present" @@ -161,6 +163,13 @@ indicates that the rules used in validating addresses supplied in a .Xr bind 2 call should allow reuse of local addresses. +.Dv SO_REUSEPORT +allows completely duplicate bindings by multiple processes +if they all set +.Dv SO_REUSEPORT +before binding the port. +This option permits multiple instances of a program to each +receive UDP/IP multicast or broadcast datagrams destined for the bound port. .Dv SO_KEEPALIVE enables the periodic transmission of messages on a connected socket. Should the @@ -242,7 +251,7 @@ is set to a convenient size for network efficiency, often 1024. .Dv SO_RCVLOWAT is an option to set the minimum count for input operations. In general, receive calls will block until any (non-zero) amount of data -is received, then return with smaller of the amount available or the amount +is received, then return with the smaller of the amount available or the amount requested. The default value for .Dv SO_RCVLOWAT @@ -291,7 +300,7 @@ Finally, and .Dv SO_ERROR are options used only with -.Fn setsockopt . +.Fn getsockopt . .Dv SO_TYPE returns the type of the socket, such as .Dv SOCK_STREAM ; diff --git a/lib/libc/sys/gettimeofday.2 b/lib/libc/sys/gettimeofday.2 index ba56f3b08f2..1e3740d3259 100644 --- a/lib/libc/sys/gettimeofday.2 +++ b/lib/libc/sys/gettimeofday.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: gettimeofday.2,v 1.5 1995/02/27 12:33:33 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)gettimeofday.2 6.11 (Berkeley) 3/10/91 -.\" $Id: gettimeofday.2,v 1.4 1993/11/29 21:25:14 jtc Exp $ +.\" @(#)gettimeofday.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt GETTIMEOFDAY 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/getuid.2 b/lib/libc/sys/getuid.2 index 54c2b11e074..271a48dab8a 100644 --- a/lib/libc/sys/getuid.2 +++ b/lib/libc/sys/getuid.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: getuid.2,v 1.6 1995/02/27 12:33:37 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)getuid.2 6.4 (Berkeley) 3/10/91 -.\" $Id: getuid.2,v 1.5 1993/11/25 02:49:21 jtc Exp $ +.\" @(#)getuid.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt GETUID 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2 index 6a973f09070..45c53469d09 100644 --- a/lib/libc/sys/intro.2 +++ b/lib/libc/sys/intro.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980,1983,1986,1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: intro.2,v 1.6 1995/02/27 12:33:41 cgd Exp $ +.\" +.\" Copyright (c) 1980, 1983, 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)intro.2 6.13 (Berkeley) 7/23/91 -.\" $Id: intro.2,v 1.5 1994/01/31 18:36:22 jtc Exp $ +.\" @(#)intro.2 8.3 (Berkeley) 12/11/93 .\" -.Dd July 23, 1991 +.Dd December 11, 1993 .Dt INTRO 2 .Os BSD 4 .Sh NAME @@ -77,7 +78,7 @@ names as given in .Bl -hang -width Ds .It Er 0 Em "Error 0" . Not used. -.It Er 1 EPERM Em "Operation not permitted . +.It Er 1 EPERM Em "Operation not permitted" . An attempt was made to perform an operation limited to processes with appropriate privileges or to the owner of a file or other resources. @@ -97,7 +98,7 @@ function. If the signal handler performs a normal return, the interrupted function call will seem to have returned the error condition. .It Er 5 EIO Em "Input/output error" . Some physical input or output error occurred. -This error not be reported until a subsequent operation on the same file +This error will not be reported until a subsequent operation on the same file descriptor and may be lost (over written) by any subsequent errors. .It Er 6 ENXIO Em "\&No such device or address" . Input or output on a special file referred to a device that did not @@ -105,7 +106,7 @@ exist, or made a request beyond the limits of the device. This error may also occur when, for example, a tape drive is not online or no disk pack is -is loaded on a drive. +loaded on a drive. .It Er 7 E2BIG Em "Arg list too long" . The number of bytes used for the argument and environment list of the new process exceeded the current limit @@ -191,7 +192,7 @@ special device for which the operation was inappropriate. .It Er 26 ETXTBSY Em "Text file busy" . The new process was a pure procedure (shared text) file which was open for writing by another process, or -the pure procedure file was being executed an +while the pure procedure file was being executed an .Xr open call requested write access. .It Er 27 EFBIG Em "File too large" . @@ -204,9 +205,9 @@ A .Xr write to an ordinary file, the creation of a directory or symbolic link, or the creation of a directory -entry failed because no more disk blocks are available +entry failed because no more disk blocks were available on the file system, or the allocation of an inode for a newly -created file failed because no more inodes are available +created file failed because no more inodes were available on the file system. .It Er 29 ESPIPE Em "Illegal seek" . An @@ -229,7 +230,7 @@ to read the data. A numerical input argument was outside the defined domain of the mathematical function. .It Er 34 ERANGE Em "Numerical result out of range" . -A numerical result of the function was to large to fit in the +A numerical result of the function was too large to fit in the available space (perhaps exceeded precision). .It Er 35 EAGAIN Em "Resource temporarily unavailable" . This is a temporary condition and later calls to the @@ -319,14 +320,14 @@ request on a connected socket specified a destination when already connected. .It Er 57 ENOTCONN Em "Socket is not connected" . An request to send or receive data was disallowed because -the socket is not connected and (when sending on a datagram socket) +the socket was not connected and (when sending on a datagram socket) no address was supplied. .It Er 58 ESHUTDOWN Em "Cannot send after socket shutdown" . A request to send data was disallowed because the socket had already been shut down with a previous .Xr shutdown 2 call. -.It Er 60 ETIMEDOUT Em "Connection timed out" . +.It Er 60 ETIMEDOUT Em "Operation timed out" . A .Xr connect or @@ -412,23 +413,61 @@ integer called a process ID. The range of this ID is from 0 to 30000. .It Parent process ID A new process is created by a currently active process; (see .Xr fork 2 ) . -The parent process ID of a process is the process ID of its creator. -.It Process Group ID +The parent process ID of a process is initially the process ID of its creator. +If the creating process exits, +the parent process ID of each child is set to the ID of a system process, +.Xr init . +.It Process Group Each active process is a member of a process group that is identified by a non-negative integer called the process group ID. This is the process ID of the group leader. This grouping permits the signaling of related processes (see -.Xr killpg 2 ) +.Xr termios 4 ) and the job control mechanisms of .Xr csh 1 . -.It Tty Group ID -Each active process can be a member of a terminal group that is identified -by a non-negative integer called the tty group ID. This grouping is used +.It Session +A session is a set of one or more process groups. +A session is created by a successful call to +.Xr setsid 2 , +which causes the caller to become the only member of the only process +group in the new session. +.It Session leader +A process that has created a new session by a successful call to +.Xr setsid 2 , +is known as a session leader. +Only a session leader may acquire a terminal as its controlling terminal (see +.Xr termios 4 ) . +.It Controlling process +A session leader with a controlling terminal is a controlling process. +.It Controlling terminal +A terminal that is associated with a session is known as the controlling +terminal for that session and its members. +.It "Terminal Process Group ID" +A terminal may be acquired by a session leader as its controlling terminal. +Once a terminal is associated with a session, any of the process groups +within the session may be placed into the foreground by setting +the terminal process group ID to the ID of the process group. +This facility is used to arbitrate between multiple jobs contending for the same terminal; (see .Xr csh 1 and .Xr tty 4 ) . +.It "Orphaned Process Group" +A process group is considered to be +.Em orphaned +if it is not under the control of a job control shell. +More precisely, a process group is orphaned +when none of its members has a parent process that is in the same session +as the group, +but is in a different process group. +Note that when a process exits, the parent process for its children +is changed to be +.Xr init , +which is in a separate session. +Not all members of an orphaned process group are necessarily orphaned +processes (those whose creating process has exited). +The process group of a session leader is orphaned by definition. .It "Real User ID and Real Group ID" Each user on the system is identified by a positive integer termed the real user ID. @@ -442,26 +481,46 @@ the real group ID. All processes have a real user ID and real group ID. These are initialized from the equivalent attributes of the process that created it. -.It "Effective User Id, Effective Group Id, and Access Groups" -Access to system resources is governed by three values: -the effective user ID, the effective group ID, and the -group access list. +.It "Effective User Id, Effective Group Id, and Group Access List" +Access to system resources is governed by two values: +the effective user ID, and the group access list. +The first member of the group access list is also known as the +effective group ID. +(In POSIX.1, the group access list is known as the set of supplementary +group IDs, and it is unspecified whether the effective group ID is +a member of the list.) .Pp The effective user ID and effective group ID are initially the process's real user ID and real group ID respectively. Either may be modified through execution of a set-user-ID or set-group-ID file (possibly by one its ancestors) (see .Xr execve 2 ) . +By convention, the effective group ID (the first member of the group access +list) is duplicated, so that the execution of a set-group-ID program +does not result in the loss of the original (real) group ID. .Pp -The group access list is an additional set of group ID's +The group access list is a set of group IDs used only in determining resource accessibility. Access checks are performed as described below in ``File Access Permissions''. +.It "Saved Set User ID and Saved Set Group ID" +When a process executes a new file, the effective user ID is set +to the owner of the file if the file is set-user-ID, and the effective +group ID (first element of the group access list) is set to the group +of the file if the file is set-group-ID. +The effective user ID of the process is then recorded as the saved set-user-ID, +and the effective group ID of the process is recorded as the saved set-group-ID. +These values may be used to regain those values as the effective user +or group ID after reverting to the real ID (see +.Xr setuid 2 ) . +(In POSIX.1, the saved set-user-ID and saved set-group-ID are optional, +and are used in setuid and setgid, but this does not work as desired +for the super-user.) .It Super-user A process is recognized as a .Em super-user process and is granted special privileges if its effective user ID is 0. .It Special Processes -The processes with a process ID's of 0, 1, and 2 are special. +The processes with process IDs of 0, 1, and 2 are special. Process 0 is the scheduler. Process 1 is the initialization process .Xr init , and is the ancestor of every other process in the system. diff --git a/lib/libc/sys/ioctl.2 b/lib/libc/sys/ioctl.2 index 2f7ae770fa4..9eb6001e319 100644 --- a/lib/libc/sys/ioctl.2 +++ b/lib/libc/sys/ioctl.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: ioctl.2,v 1.5 1995/02/27 12:33:47 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)ioctl.2 6.4 (Berkeley) 3/10/91 -.\" $Id: ioctl.2,v 1.4 1993/11/29 21:25:15 jtc Exp $ +.\" @(#)ioctl.2 8.2 (Berkeley) 12/11/93 .\" -.Dd March 10, 1991 +.Dd December 11, 1993 .Dt IOCTL 2 .Os BSD 4 .Sh NAME @@ -75,7 +76,7 @@ If an error has occurred, a value of -1 is returned and is set to indicate the error. .Sh ERRORS .Fn Ioctl -will fail: +will fail if: .Bl -tag -width Er .It Bq Er EBADF .Fa d @@ -96,9 +97,9 @@ or is not valid. .El .Sh SEE ALSO +.Xr mt 1 , .Xr execve 2 , .Xr fcntl 2 , -.Xr mt 4 , .Xr tty 4 , .Xr intro 4 .Sh HISTORY diff --git a/lib/libc/sys/kill.2 b/lib/libc/sys/kill.2 index 8769e86a32a..6b7157f35f7 100644 --- a/lib/libc/sys/kill.2 +++ b/lib/libc/sys/kill.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: kill.2,v 1.7 1995/02/27 12:33:53 cgd Exp $ +.\" +.\" 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 @@ -29,17 +31,15 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)kill.2 6.6 (Berkeley) 3/10/91 -.\" $Id: kill.2,v 1.6 1994/01/10 23:54:22 jtc Exp $ +.\" @(#)kill.2 8.3 (Berkeley) 4/19/94 .\" -.Dd March 10, 1991 +.Dd April 19, 1994 .Dt KILL 2 .Os BSD 4 .Sh NAME .Nm kill .Nd send signal to a process .Sh SYNOPSIS -.Fd #include <sys/types.h> .Fd #include <signal.h> .Ft int .Fn kill "pid_t pid" "int sig" @@ -82,11 +82,11 @@ process has permission; this is a variant of .Xr killpg 2 . .It \&If Fa pid No \&is -1 : -If the user has super user privileges, +If the user has super-user privileges, the signal is sent to all processes excluding -system processes. If the user is not the super user, -the signal is sent to all processes with the same uid as the user -except the process sending the signal. +system processes and the process sending the signal. +If the user is not the super user, the signal is sent to all processes +with the same uid as the user excluding the process sending the signal. No error is returned if any process could be signaled. .El .Pp diff --git a/lib/libc/sys/ktrace.2 b/lib/libc/sys/ktrace.2 index 9fe61f89570..9c96bf2c47f 100644 --- a/lib/libc/sys/ktrace.2 +++ b/lib/libc/sys/ktrace.2 @@ -1,3 +1,5 @@ +.\" $NetBSD: ktrace.2,v 1.2 1995/02/27 12:33:58 cgd Exp $ +.\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. .\" diff --git a/lib/libc/sys/link.2 b/lib/libc/sys/link.2 index 1fe8c6c1015..fbb03baff53 100644 --- a/lib/libc/sys/link.2 +++ b/lib/libc/sys/link.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: link.2,v 1.7 1995/02/27 12:34:01 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)link.2 6.4 (Berkeley) 3/10/91 -.\" $Id: link.2,v 1.6 1994/04/22 00:13:36 jtc Exp $ +.\" @(#)link.2 8.3 (Berkeley) 1/12/94 .\" -.Dd March 10, 1991 +.Dd January 12, 1994 .Dt LINK 2 .Os BSD 4 .Sh NAME @@ -86,7 +87,6 @@ is set to indicate the error. .Sh ERRORS .Fn Link will fail and no link will be created if: -are true: .Bl -tag -width Er .It Bq Er ENOTDIR A component of either path prefix is not a directory. @@ -128,6 +128,7 @@ are on different file systems. The directory in which the entry for the new link is being placed cannot be extended because there is no space left on the file system containing the directory. +.ne 3v .It Bq Er EDQUOT The directory in which the entry for the new link is being placed cannot be extended because the diff --git a/lib/libc/sys/listen.2 b/lib/libc/sys/listen.2 index 1b645f2c49c..ab7c0c5f636 100644 --- a/lib/libc/sys/listen.2 +++ b/lib/libc/sys/listen.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: listen.2,v 1.6 1995/02/27 12:34:05 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)listen.2 6.5 (Berkeley) 3/10/91 -.\" $Id: listen.2,v 1.5 1993/11/29 21:25:19 jtc Exp $ +.\" @(#)listen.2 8.2 (Berkeley) 12/11/93 .\" -.Dd March 10, 1991 +.Dd December 11, 1993 .Dt LISTEN 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/lseek.2 b/lib/libc/sys/lseek.2 index aa3f875811a..09374f76419 100644 --- a/lib/libc/sys/lseek.2 +++ b/lib/libc/sys/lseek.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: lseek.2,v 1.6 1995/02/27 12:34:09 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)lseek.2 6.5 (Berkeley) 3/10/91 -.\" $Id: lseek.2,v 1.5 1994/01/10 23:54:23 jtc Exp $ +.\" @(#)lseek.2 8.3 (Berkeley) 4/19/94 .\" -.Dd March 10, 1991 +.Dd April 19, 1994 .Dt LSEEK 2 .Os BSD 4 .Sh NAME @@ -127,7 +128,7 @@ is not a proper value. .Sh BUGS This document's use of .Fa whence -is incorrect English, but maintained for historical reasons. +is incorrect English, but is maintained for historical reasons. .Sh STANDARDS The .Fn lseek diff --git a/lib/libc/sys/madvise.2 b/lib/libc/sys/madvise.2 index edcac222796..ae844c350f0 100644 --- a/lib/libc/sys/madvise.2 +++ b/lib/libc/sys/madvise.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: madvise.2,v 1.5 1995/02/27 12:34:13 cgd Exp $ +.\" +.\" 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 @@ -29,14 +31,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)madvise.2 6.1 (Berkeley) 5/27/91 -.\" $Id: madvise.2,v 1.4 1993/12/15 18:08:12 jtc Exp $ +.\" @(#)madvise.2 8.1 (Berkeley) 6/9/93 .\" -.Dd May 27, 1991 +.Dd June 9, 1993 .Dt MADVISE 2 .Os .Sh NAME -.Nm madvise +.Nm madvise .Nd give advise about use of memory .Sh SYNOPSIS .Fd #include <sys/types.h> @@ -44,11 +45,13 @@ .Ft int .Fn madvise "caddr_t addr" "int len" "int behav" .Sh DESCRIPTION -The +The .Fn madvise -system call allows a process that has knowledge of its memory behavior +system call +allows a process that has knowledge of its memory behavior to describe it to the system. -The known behaviors are given in <sys/mman.h>: +The known behaviors are given in +.Pa <sys/mman.h> : .Bd -literal #define MADV_NORMAL 0 /* no further special treatment */ #define MADV_RANDOM 1 /* expect random page references */ @@ -62,3 +65,7 @@ The known behaviors are given in <sys/mman.h>: .Xr mprotect 2 , .Xr msync 2 , .Xr munmap 2 +.Sh HISTORY +The +.Nm madvise +function first appeared in 4.4BSD. diff --git a/lib/libc/sys/mincore.2 b/lib/libc/sys/mincore.2 index 46df9bdabc8..378cdf67278 100644 --- a/lib/libc/sys/mincore.2 +++ b/lib/libc/sys/mincore.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: mincore.2,v 1.5 1995/02/27 12:34:16 cgd Exp $ +.\" +.\" 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 @@ -29,14 +31,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)mincore.2 6.1 (Berkeley) 5/27/91 -.\" $Id: mincore.2,v 1.4 1993/12/15 18:08:14 jtc Exp $ +.\" @(#)mincore.2 8.1 (Berkeley) 6/9/93 .\" -.Dd May 27, 1991 +.Dd June 9, 1993 .Dt MINCORE 2 .Os .Sh NAME -.Nm mincore +.Nm mincore .Nd determine residency of memory pages .Sh SYNOPSIS .Fd #include <sys/types.h> @@ -44,10 +45,11 @@ .Ft int .Fn mincore "caddr_t addr" "int len" "char *vec" .Sh DESCRIPTION -The +The .Fn mincore -system call allows a process to obtain information about whether pages -are core resident. +system call +allows a process to obtain information about whether pages are +core resident. Here the current core residency of the pages is returned in the character array .Fa vec , @@ -57,3 +59,7 @@ with a value of 1 meaning that the page is in-core. .Xr mprotect 2 , .Xr msync 2 , .Xr munmap 2 +.Sh HISTORY +The +.Fn mincore +function first appeared in 4.4BSD. diff --git a/lib/libc/sys/mkdir.2 b/lib/libc/sys/mkdir.2 index eca0813a006..8f50d6e955e 100644 --- a/lib/libc/sys/mkdir.2 +++ b/lib/libc/sys/mkdir.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: mkdir.2,v 1.8 1995/02/27 12:34:22 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)mkdir.2 6.7 (Berkeley) 3/10/91 -.\" $Id: mkdir.2,v 1.7 1994/04/22 00:13:37 jtc Exp $ +.\" @(#)mkdir.2 8.2 (Berkeley) 12/11/93 .\" -.Dd March 10, 1991 +.Dd December 11, 1993 .Dt MKDIR 2 .Os BSD 4.2 .Sh NAME @@ -82,22 +83,12 @@ The named file resides on a read-only file system. .It Bq Er EEXIST The named file exists. .It Bq Er ENOSPC -The directory in which the entry for the new directory is being placed -cannot be extended because there is no space left on the file -system containing the directory. -.It Bq Er ENOSPC -The new directory cannot be created because there -there is no space left on the file -system that will contain the directory. +The new directory cannot be created because there is no space left +on the file system that will contain the directory. .It Bq Er ENOSPC There are no free inodes on the file system on which the directory is being created. .It Bq Er EDQUOT -The directory in which the entry for the new directory -is being placed cannot be extended because the -user's quota of disk blocks on the file system -containing the directory has been exhausted. -.It Bq Er EDQUOT The new directory cannot be created because the user's quota of disk blocks on the file system that will contain the directory has been exhausted. diff --git a/lib/libc/sys/mkfifo.2 b/lib/libc/sys/mkfifo.2 index 8ea991f1b1f..af5d7615f2c 100644 --- a/lib/libc/sys/mkfifo.2 +++ b/lib/libc/sys/mkfifo.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1990, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: mkfifo.2,v 1.8 1995/02/27 12:34:27 cgd Exp $ +.\" +.\" Copyright (c) 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)mkfifo.2 6.4 (Berkeley) 7/23/91 -.\" $Id: mkfifo.2,v 1.7 1994/04/22 00:13:39 jtc Exp $ +.\" @(#)mkfifo.2 8.1 (Berkeley) 6/4/93 .\" -.Dd July 23, 1991 +.Dd June 4, 1993 .Dt MKFIFO 2 .Os .Sh NAME diff --git a/lib/libc/sys/mknod.2 b/lib/libc/sys/mknod.2 index bc3f2399dc4..e92dd449f43 100644 --- a/lib/libc/sys/mknod.2 +++ b/lib/libc/sys/mknod.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: mknod.2,v 1.6 1995/02/27 12:34:33 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)mknod.2 6.5 (Berkeley) 3/10/91 -.\" $Id: mknod.2,v 1.5 1994/04/22 00:13:40 jtc Exp $ +.\" @(#)mknod.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt MKNOD 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/mlock.2 b/lib/libc/sys/mlock.2 index 90bb7c7d8e0..ed5c9ac5d99 100644 --- a/lib/libc/sys/mlock.2 +++ b/lib/libc/sys/mlock.2 @@ -1,3 +1,5 @@ +.\" $NetBSD: mlock.2,v 1.2 1995/02/27 12:34:40 cgd Exp $ +.\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. .\" diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2 index eb98e5afcba..3a4d603baae 100644 --- a/lib/libc/sys/mmap.2 +++ b/lib/libc/sys/mmap.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: mmap.2,v 1.4 1995/02/27 12:34:44 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)mmap.2 6.2 (Berkeley) 6/5/91 -.\" $Id: mmap.2,v 1.3 1994/07/31 08:49:56 mycroft Exp $ +.\" @(#)mmap.2 8.1 (Berkeley) 6/4/93 .\" -.Dd "June 5, 1991" +.Dd "June 4, 1993" .Dt MMAP 2 .Os BSD 4 .Sh NAME @@ -42,7 +43,7 @@ .Fd #include <sys/types.h> .Fd #include <sys/mman.h> .Ft caddr_t -.Fn mmap "caddr_t addr" "int len" "int prot" "int flags" "int fd" "off_t offset" +.Fn mmap "caddr_t addr" "size_t len" "int prot" "int flags" "int fd" "off_t offset" .Sh DESCRIPTION The .Nm mmap @@ -77,7 +78,7 @@ deletes any previous mapping in the allocated address range. The protections (region accessibility) are specified in the .Fa prot argument by -.Em or Ap ing +.Em or Ns 'ing the following values: .Pp .Bl -tag -width MAP_FIXEDX @@ -97,13 +98,15 @@ to the process or are to be shared with other references. Sharing, mapping type and options are specified in the .Fa flags argument by -.Em or Ap ing +.Em or Ns 'ing the following values: .Pp .Bl -tag -width MAP_FIXEDX .It Dv MAP_ANON Map anonymous memory not associated with any specific file. -The file descriptor used for creating MAP_ANON regions is used only for +The file descriptor used for creating +.Dv MAP_ANON +regions is used only for naming, and may be specified as \-1 if no name is associated with the region. .It Dv MAP_FILE @@ -140,7 +143,9 @@ for further information. .Pp The current design does not allow a process to specify the location of swap space. -In the future we may define an additional mapping type, MAP_SWAP, in which +In the future we may define an additional mapping type, +.Dv MAP_SWAP , +in which the file descriptor argument specifies a file or device to which swapping should be done. .Sh RETURN VALUES @@ -155,12 +160,19 @@ is set to indicate the error. will fail if: .Bl -tag -width Er .It Bq Er EACCES -The flag PROT_READ was specified as part of the +The flag +.Dv PROT_READ +was specified as part of the .Fa prot parameter and .Fa fd was not open for reading. -The flags PROT_WRITE, MAP_SHARED and MAP_WRITE were specified as part +The flags +.Dv PROT_WRITE , +.Dv MAP_SHARED +and +.Dv MAP_WRITE +were specified as part of the .Fa flags and @@ -172,16 +184,19 @@ was not open for writing. .Fa Fd is not a valid open file descriptor. .It Bq Er EINVAL -MAP_FIXED was specified and the +.Dv MAP_FIXED +was specified and the .I addr parameter was not page aligned. .Fa Fd did not reference a regular or character special file. .It Bq Er ENOMEM -MAP_FIXED was specified and the +.Dv MAP_FIXED +was specified and the .Fa addr parameter wasn't available. -MAP_ANON was specified an insufficient memory was available. +.Dv MAP_ANON +was specified and insufficient memory was available. .Sh "SEE ALSO" .Xr getpagesize 2 , .Xr msync 2 , diff --git a/lib/libc/sys/mount.2 b/lib/libc/sys/mount.2 index 907276cb3f1..fedcb719417 100644 --- a/lib/libc/sys/mount.2 +++ b/lib/libc/sys/mount.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1989 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: mount.2,v 1.8 1995/02/27 12:34:49 cgd Exp $ +.\" +.\" Copyright (c) 1980, 1989, 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 @@ -29,17 +31,17 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)mount.2 6.12 (Berkeley) 3/15/91 -.\" $Id: mount.2,v 1.7 1994/04/22 00:13:42 jtc Exp $ +.\" @(#)mount.2 8.2 (Berkeley) 12/11/93 .\" -.Dd March 15, 1991 +.Dd December 11, 1993 .Dt MOUNT 2 .Os BSD 4 .Sh NAME .Nm mount , .Nm unmount -.Nd mount or dismount a filesystem +.Nd mount or dismount a file system .Sh SYNOPSIS +.Fd #include <sys/param.h> .Fd #include <sys/mount.h> .Ft int .Fn mount "int type" "const char *dir" "int flags" "caddr_t data" @@ -49,12 +51,12 @@ The .Fn mount function grafts -a filesystem object onto the system file tree +a file system object onto the system file tree at the point .Ar dir . The argument .Ar data -describes the filesystem object to be mounted. +describes the file system object to be mounted. The argument .Ar type tells the kernel how to interpret @@ -62,19 +64,19 @@ tells the kernel how to interpret (See .Ar type below). -The contents of the filesystem +The contents of the file system become available through the new mount point .Ar dir . Any files in .Ar dir at the time of a successful mount are swept under the carpet so to speak, and -are unavailable until the filesystem is unmounted. +are unavailable until the file system is unmounted. .Pp The following .Ar flags may be specified to -suppress default semantics which affect filesystem access. +suppress default semantics which affect file system access. .Bl -tag -width MNT_SYNCHRONOUS .It Dv MNT_RDONLY The file system should be treated as read-only; @@ -144,23 +146,19 @@ struct mfs_args { .Pp The .Fn umount -function call disassociates the filesystem from the specified +function call disassociates the file system from the specified mount point .Fa dir . .Pp The .Fa flags -argument may have one of the following values: -.Bl -tag -width MNT_SYNCHRONOUS -.It Dv MNT_NOFORCE -The unmount should fail if any files are active on the file system. -.It Dv MNT_FORCE -The file system should be forcibly unmounted even if files are +argument may specify +.Dv MNT_FORCE +to specify that the file system should be forcibly unmounted even if files are still active. Active special devices continue to work, but any further accesses to any other active files result in errors even if the file system is later remounted. -.El .Sh RETURN VALUES The .Fn mount @@ -267,7 +265,7 @@ number or an out of range block size. Not enough memory was available to read the cylinder group information for the file system. .It Bq Er EIO -An paging error occurred while reading the super block or +A paging error occurred while reading the super block or cylinder group information. .It Bq Er EFAULT .Em Name @@ -305,7 +303,7 @@ A .Em ufs or .Em mfs -mount can also fail if the maximum number of filesystems are currently +mount can also fail if the maximum number of file systems are currently mounted. .Sh SEE ALSO .Xr mount 8 , diff --git a/lib/libc/sys/mprotect.2 b/lib/libc/sys/mprotect.2 index 711e7ae97a5..03d95872bc4 100644 --- a/lib/libc/sys/mprotect.2 +++ b/lib/libc/sys/mprotect.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: mprotect.2,v 1.5 1995/02/27 12:34:56 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)mprotect.2 6.1 (Berkeley) 5/27/91 -.\" $Id: mprotect.2,v 1.4 1993/12/15 18:08:16 jtc Exp $ +.\" @(#)mprotect.2 8.1 (Berkeley) 6/9/93 .\" -.Dd May 27, 1991 +.Dd June 9, 1993 .Dt MPROTECT 2 .Os .Sh NAME @@ -44,9 +45,10 @@ .Ft int .Fn mprotect "caddr_t addr" "int len" "int prot" .Sh DESCRIPTION -The -.Nm mprotect -system call changes the specified pages to have protection +The +.Fn mprotect +system call +changes the specified pages to have protection .Fa prot . Not all implementations will guarantee protection on a page basis; the granularity of protection changes may be as large as an entire region. @@ -54,4 +56,8 @@ the granularity of protection changes may be as large as an entire region. .Xr madvise 2 , .Xr mincore 2 , .Xr msync 2 , -.Xr munmap 2 , +.Xr munmap 2 +.Sh HISTORY +The +.Fn mprotect +function first appeared in 4.4BSD. diff --git a/lib/libc/sys/munmap.2 b/lib/libc/sys/munmap.2 index f4659a13c72..ab097b704cf 100644 --- a/lib/libc/sys/munmap.2 +++ b/lib/libc/sys/munmap.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: munmap.2,v 1.5 1995/02/27 12:35:03 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)munmap.2 6.1 (Berkeley) 5/27/91 -.\" $Id: munmap.2,v 1.4 1993/12/15 18:08:18 jtc Exp $ +.\" @(#)munmap.2 8.2 (Berkeley) 4/15/94 .\" -.Dd May 27, 1991 +.Dd April 15, 1994 .Dt MUNMAP 2 .Os .Sh NAME @@ -42,15 +43,41 @@ .Fd #include <sys/types.h> .Fd #include <sys/mman.h> .Ft int -.Fn munmap "caddr_t addr" "int len" +.Fn munmap "caddr_t addr" "size_t len" .Sh DESCRIPTION -The +The .Fn munmap -system call deletes the mappings for the specified address range, +system call +deletes the mappings for the specified address range, and causes further references to addresses within the range to generate invalid memory references. -.Sh SEE ALSO -.Xr madvise 2 , -.Xr mincore 2 , +.Sh RETURN VALUES +Upon successful completion, +.Nm munmap +returns zero. +Otherwise, a value of -1 is returned and +.Va errno +is set to indicate the error. +.Sh ERRORS +.Fn Munmap +will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa addr +parameter was not page aligned, the +.Fa len +parameter was negative, or +some part of the region being unmapped is not part of the currently +valid address space. +.Sh "SEE ALSO" +.Xr getpagesize 3 , +.Xr msync 2 , +.Xr munmap 2 , .Xr mprotect 2 , -.Xr msync 2 +.Xr madvise 2 , +.Xr mincore 2 +.Sh HISTORY +The +.Fn munmap +function first appeared in 4.4BSD. diff --git a/lib/libc/sys/nfssvc.2 b/lib/libc/sys/nfssvc.2 index d86c0678114..297472162c1 100644 --- a/lib/libc/sys/nfssvc.2 +++ b/lib/libc/sys/nfssvc.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1989, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: nfssvc.2,v 1.6 1995/02/27 12:35:08 cgd Exp $ +.\" +.\" 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 @@ -29,53 +31,210 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)nfssvc.2 6.6 (Berkeley) 7/23/91 -.\" $Id: nfssvc.2,v 1.5 1993/11/29 21:25:24 jtc Exp $ +.\" @(#)nfssvc.2 8.1 (Berkeley) 6/9/93 .\" -.Dd July 23, 1991 +.Dd June 9, 1993 .Dt NFSSVC 2 .Os .Sh NAME .Nm nfssvc -.Nd create a remote NFS server +.Nd NFS services .Sh SYNOPSIS .Fd #include <unistd.h> +.Fd #include <nfs/nfs.h> .Ft int -.Fn nfssvc "int sock" "struct sockaddr *mask" "int mask_length" "struct sockaddr *match" "int match_length" +.Fn nfssvc "int flags" "void *argstructp" .Sh DESCRIPTION -.Bf -symbolic -The calling sequence of this function is expected to change. In fact it is known to have changed in 4.4 BSD. -.Ef -.Fn Nfssvc -starts an +The +.Fn nfssvc +function is used by the NFS daemons to pass information into and out +of the kernel and also to enter the kernel as a server daemon. +The +.Fa flags +argument consists of several bits that show what action is to be taken +once in the kernel and the +.Fa argstructp +points to one of three structures depending on which bits are set in +flags. +.Pp +On the client side, +.Xr nfsiod 8 +calls +.Fn nfssvc +with the +.Fa flags +argument set to +.Dv NFSSVC_BIOD +and +.Fa argstructp +set to +.Dv NULL +to enter the kernel as a block I/O server daemon. +For +.Nm NQNFS , +.Xr mount_nfs 8 +calls +.Fn nfssvc +with the +.Dv NFSSVC_MNTD +flag, optionally or'd with the flags +.Dv NFSSVC_GOTAUTH +and +.Dv NFSSVC_AUTHINFAIL +along with a pointer to a +.Bd -literal +struct nfsd_cargs { + char *ncd_dirp; /* Mount dir path */ + uid_t ncd_authuid; /* Effective uid */ + int ncd_authtype; /* Type of authenticator */ + int ncd_authlen; /* Length of authenticator string */ + char *ncd_authstr; /* Authenticator string */ +}; +.Ed +.sp +structure. +The initial call has only the +.Dv NFSSVC_MNTD +flag set to specify service for the mount point. +If the mount point is using Kerberos, then the +.Xr mount_nfs 8 +daemon will return from +.Fn nfssvc +with errno == ENEEDAUTH whenever the client side requires an ``rcmd'' +authentication ticket for the user. +.Xr Mount_nfs 8 +will attempt to get the Kerberos ticket, and if successful will call +.Fn nfssvc +with the flags +.Dv NFSSVC_MNTD +and +.Dv NFSSVC_GOTAUTH +after filling the ticket into the +ncd_authstr field +and +setting the ncd_authlen and ncd_authtype +fields of the nfsd_cargs structure. +If +.Xr mount_nfs 8 +failed to get the ticket, +.Fn nfssvc +will be called with the flags +.Dv NFSSVC_MNTD , +.Dv NFSSVC_GOTAUTH +and +.Dv NFSSVC_AUTHINFAIL +to denote a failed authentication attempt. +.Pp +On the server side, +.Fn nfssvc +is called with the flag +.Dv NFSSVC_NFSD +and a pointer to a +.Bd -literal +struct nfsd_srvargs { + struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */ + uid_t nsd_uid; /* Effective uid mapped to cred */ + u_long nsd_haddr; /* Ip address of client */ + struct ucred nsd_cr; /* Cred. uid maps to */ + int nsd_authlen; /* Length of auth string (ret) */ + char *nsd_authstr; /* Auth string (ret) */ +}; +.Ed +.sp +to enter the kernel as an +.Xr nfsd 8 +daemon. +Whenever an +.Xr nfsd 8 +daemon receives a Kerberos authentication ticket, it will return from +.Fn nfssvc +with errno == ENEEDAUTH. +The +.Xr nfsd 8 +will attempt to authenticate the ticket and generate a set of credentials +on the server for the ``user id'' specified in the field nsd_uid. +This is done by first authenticating the Kerberos ticket and then mapping +the Kerberos principal to a local name and getting a set of credentials for +that user via. +.Xr getpwnam 3 +and +.Xr getgrouplist 3 . +If successful, the +.Xr nfsd 8 +will call +.Fn nfssvc +with the +.Dv NFSSVC_NFSD +and +.Dv NFSSVC_AUTHIN +flags set to pass the credential mapping in nsd_cr into the +kernel to be cached on the server socket for that client. +If the authentication failed, +.Xr nfsd 8 +calls +.Fn nfssvc +with the flags +.Dv NFSSVC_NFSD +and +.Dv NFSSVC_AUTHINFAIL +to denote an authentication failure. +.Pp +The master +.Xr nfsd 8 +server daemon calls +.Fn nfssvc +with the flag +.Dv NFSSVC_ADDSOCK +and a pointer to a +.Bd -literal +struct nfsd_args { + int sock; /* Socket to serve */ + caddr_t name; /* Client address for connection based sockets */ + int namelen; /* Length of name */ +}; +.Ed +.sp +to pass a server side .Tn NFS -daemon listening on socket -.Fa sock . -The socket must be in the -.Dv AF_INET -family. +socket into the kernel for servicing by the +.Xr nfsd 8 +daemons. .Sh RETURN VALUES Normally .Nm nfssvc does not return unless the server -is terminated by a signal at which time a value of 0 is returned. +is terminated by a signal when a value of 0 is returned. Otherwise, -1 is returned and the global variable .Va errno -is set to indicate the error. +is set to specify the error. .Sh ERRORS -.Fn Nfssvc -fails if: .Bl -tag -width Er -.It Bq Er EBADF -.Fa Fd -is not a valid open file descriptor. +.It Bq Er ENEEDAUTH +This special error value +is really used for authentication support, particularly Kerberos, +as explained above. .It Bq Er EPERM The caller is not the super-user. .El .Sh SEE ALSO -.Xr nfsd 8 +.Xr nfsd 8 , +.Xr mount_nfs 8 , +.Xr nfsiod 8 .Sh HISTORY The -.Fn nfssvc -function call is -.Ud . +.Nm nfssvc +function first appeared in 4.4BSD. +.Sh BUGS +The +.Nm nfssvc +system call is designed specifically for the +.Tn NFS +support daemons and as such is specific to their requirements. +It should really return values to indicate the need for authentication +support, since +.Dv ENEEDAUTH +is not really an error. +Several fields of the argument structures are assumed to be valid and +sometimes to be unchanged from a previous call, such that +.Nm nfssvc +must be used with extreme care. diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index 928418e7722..cf215d87d85 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: open.2,v 1.8 1995/02/27 12:35:14 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)open.2 6.7 (Berkeley) 5/27/91 -.\" $Id: open.2,v 1.7 1994/04/19 00:11:13 jtc Exp $ +.\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" -.Dd May 27, 1991 +.Dd November 16, 1993 .Dt OPEN 2 .Os BSD 4 .Sh NAME @@ -63,7 +64,7 @@ and modified by the process' umask value (see .Xr umask 2 ) . .Pp The flags specified are formed by -.Em or Ap ing +.Em or Ns 'ing the following values .Pp .Bd -literal -offset indent -compact @@ -128,11 +129,14 @@ the request for the lock will never fail .Pp If successful, .Fn open -returns a non-negative integer, termed a -file descriptor. It returns -1 on failure. +returns a non-negative integer, termed a file descriptor. +It returns -1 on failure. The file pointer used to mark the current position within the file is set to the beginning of the file. .Pp +When a new file is created it is given the group of the directory +which contains it. +.Pp The new descriptor is set to remain open across .Xr execve system calls; see diff --git a/lib/libc/sys/pathconf.2 b/lib/libc/sys/pathconf.2 index 1b4fbc4362d..a947bd1e341 100644 --- a/lib/libc/sys/pathconf.2 +++ b/lib/libc/sys/pathconf.2 @@ -1,3 +1,5 @@ +.\" $NetBSD: pathconf.2,v 1.2 1995/02/27 12:35:22 cgd Exp $ +.\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. .\" diff --git a/lib/libc/sys/pipe.2 b/lib/libc/sys/pipe.2 index 7a567dc59cb..759b9b9ef1b 100644 --- a/lib/libc/sys/pipe.2 +++ b/lib/libc/sys/pipe.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: pipe.2,v 1.6 1995/02/27 12:35:27 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)pipe.2 6.3 (Berkeley) 3/10/91 -.\" $Id: pipe.2,v 1.5 1994/07/17 05:14:55 mycroft Exp $ +.\" @(#)pipe.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt PIPE 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/profil.2 b/lib/libc/sys/profil.2 index 670e343f092..8950d7dbf3a 100644 --- a/lib/libc/sys/profil.2 +++ b/lib/libc/sys/profil.2 @@ -1,3 +1,5 @@ +.\" $NetBSD: profil.2,v 1.2 1995/02/27 12:35:32 cgd Exp $ +.\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. .\" diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index 2508443a0ae..69477e9796f 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -1,4 +1,5 @@ -.\" $NetBSD: ptrace.2,v 1.1 1994/11/14 06:26:46 deraadt Exp $ +.\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ +.\" .\" This file is in the public domain. .Dd November 7, 1994 .Dt PTRACE 2 diff --git a/lib/libc/sys/quotactl.2 b/lib/libc/sys/quotactl.2 index 02ed3705780..9dca785433d 100644 --- a/lib/libc/sys/quotactl.2 +++ b/lib/libc/sys/quotactl.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1990, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: quotactl.2,v 1.8 1995/02/27 12:35:43 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Robert Elz at The University of Melbourne. @@ -32,10 +34,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)quotactl.2 6.13 (Berkeley) 7/23/91 -.\" $Id: quotactl.2,v 1.7 1994/04/22 00:13:43 jtc Exp $ +.\" @(#)quotactl.2 8.1 (Berkeley) 6/4/93 .\" -.Dd July 23, 1991 +.Dd June 4, 1993 .Dt QUOTACTL 2 .Os .Sh NAME diff --git a/lib/libc/sys/read.2 b/lib/libc/sys/read.2 index 325facb926b..ae4af1357d8 100644 --- a/lib/libc/sys/read.2 +++ b/lib/libc/sys/read.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: read.2,v 1.6 1995/02/27 12:35:47 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)read.2 6.7 (Berkeley) 3/10/91 -.\" $Id: read.2,v 1.5 1994/09/16 03:08:46 mycroft Exp $ +.\" @(#)read.2 8.4 (Berkeley) 2/26/94 .\" -.Dd March 10, 1991 +.Dd February 26, 1994 .Dt READ 2 .Os BSD 4 .Sh NAME @@ -40,13 +41,13 @@ .Nm readv .Nd read input .Sh SYNOPSIS -.Fd #include <unistd.h> .Fd #include <sys/types.h> .Fd #include <sys/uio.h> +.Fd #include <unistd.h> .Ft ssize_t .Fn read "int d" "void *buf" "size_t nbytes" -.Ft int -.Fn readv "int d" "struct iovec *iov" "int iovcnt" +.Ft ssize_t +.Fn readv "int d" "const struct iovec *iov" "int iovcnt" .Sh DESCRIPTION .Fn Read attempts to read @@ -67,11 +68,12 @@ For .Fn readv , the .Fa iovec -structure is defined as +structure is defined as: +.Pp .Bd -literal -offset indent -compact struct iovec { - caddr_t iov_base; - int iov_len; + void *iov_base; + size_t iov_len; }; .Ed .Pp @@ -135,7 +137,7 @@ any data arrived by the delivery of a signal. The pointer associated with .Fa d was negative. -.It Bq Er EWOULDBLOCK +.It Bq Er EAGAIN The file was marked for non-blocking I/O, and no data were ready to be read. .El diff --git a/lib/libc/sys/readlink.2 b/lib/libc/sys/readlink.2 index 4ec20057c03..0a604f25693 100644 --- a/lib/libc/sys/readlink.2 +++ b/lib/libc/sys/readlink.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: readlink.2,v 1.7 1995/02/27 12:35:54 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)readlink.2 6.8 (Berkeley) 3/10/91 -.\" $Id: readlink.2,v 1.6 1994/04/22 00:13:44 jtc Exp $ +.\" @(#)readlink.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt READLINK 2 .Os BSD 4.2 .Sh NAME @@ -90,6 +91,7 @@ extends outside the process's allocated address space. .Xr stat 2 , .Xr lstat 2 , .Xr symlink 2 +.Xr symlink 7 , .Sh HISTORY The .Fn readlink diff --git a/lib/libc/sys/reboot.2 b/lib/libc/sys/reboot.2 index ae6f8b92a96..30da8fa6606 100644 --- a/lib/libc/sys/reboot.2 +++ b/lib/libc/sys/reboot.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: reboot.2,v 1.5 1995/02/27 12:36:02 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)reboot.2 6.5 (Berkeley) 3/10/91 -.\" $Id: reboot.2,v 1.4 1994/09/17 00:17:43 mycroft Exp $ +.\" @(#)reboot.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt REBOOT 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2 index 99147346e4f..267a45b838d 100644 --- a/lib/libc/sys/recv.2 +++ b/lib/libc/sys/recv.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1990, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: recv.2,v 1.6 1995/02/27 12:36:08 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1990, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)recv.2 6.11 (Berkeley) 5/1/91 -.\" $Id: recv.2,v 1.5 1994/01/10 23:54:25 jtc Exp $ +.\" @(#)recv.2 8.3 (Berkeley) 2/21/94 .\" -.Dd May 1, 1991 +.Dd February 21, 1994 .Dt RECV 2 .Os BSD 4.3r .Sh NAME @@ -43,11 +44,11 @@ .Sh SYNOPSIS .Fd #include <sys/types.h> .Fd #include <sys/socket.h> -.Ft int -.Fn recv "int s" "void *buf" "int len" "int flags" -.Ft int -.Fn recvfrom "int s" "void *buf" "int len" "int flags" "struct sockaddr *from" "int *fromlen" -.Ft int +.Ft ssize_t +.Fn recv "int s" "void *buf" "size_t len" "int flags" +.Ft ssize_t +.Fn recvfrom "int s" "void *buf" "size_t len" "int flags" "struct sockaddr *from" "int *fromlen" +.Ft ssize_t .Fn recvmsg "int s" "struct msghdr *msg" "int flags" .Sh DESCRIPTION .Fn Recvfrom @@ -96,7 +97,7 @@ in which case the value -1 is returned and the external variable .Va errno set to -.Er EWOULDBLOCK. +.Er EAGAIN . The receive calls normally return any data available, up to the requested amount, rather than waiting for receipt of the full amount requested; @@ -239,7 +240,7 @@ and The argument .Fa s does not refer to a socket. -.It Bq Er EWOULDBLOCK +.It Bq Er EAGAIN The socket is marked non-blocking, and the receive operation would block, or a receive timeout had been set, diff --git a/lib/libc/sys/rename.2 b/lib/libc/sys/rename.2 index f0ba8b74e00..4167485d30a 100644 --- a/lib/libc/sys/rename.2 +++ b/lib/libc/sys/rename.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: rename.2,v 1.7 1995/02/27 12:36:15 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)rename.2 6.7 (Berkeley) 3/10/91 -.\" $Id: rename.2,v 1.6 1994/04/22 00:13:46 jtc Exp $ +.\" @(#)rename.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt RENAME 2 .Os BSD 4.2 .Sh NAME @@ -194,6 +195,7 @@ is a directory and is not empty. .El .Sh SEE ALSO .Xr open 2 +.Xr symlink 7 .Sh STANDARDS The .Fn rename diff --git a/lib/libc/sys/revoke.2 b/lib/libc/sys/revoke.2 index e7828744e0d..004eb84617a 100644 --- a/lib/libc/sys/revoke.2 +++ b/lib/libc/sys/revoke.2 @@ -1,3 +1,5 @@ +.\" $NetBSD: revoke.2,v 1.2 1995/02/27 12:36:23 cgd Exp $ +.\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. .\" diff --git a/lib/libc/sys/rmdir.2 b/lib/libc/sys/rmdir.2 index d8f4069b2c6..8a8d595b29a 100644 --- a/lib/libc/sys/rmdir.2 +++ b/lib/libc/sys/rmdir.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: rmdir.2,v 1.7 1995/02/27 12:36:30 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)rmdir.2 6.6 (Berkeley) 3/10/91 -.\" $Id: rmdir.2,v 1.6 1994/04/22 00:13:47 jtc Exp $ +.\" @(#)rmdir.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt RMDIR 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/select.2 b/lib/libc/sys/select.2 index 502b80c8180..cf1826d6a6d 100644 --- a/lib/libc/sys/select.2 +++ b/lib/libc/sys/select.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: select.2,v 1.4 1995/02/27 12:36:37 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,19 +31,18 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)select.2 6.8 (Berkeley) 3/10/91 -.\" $Id: select.2,v 1.3 1993/11/25 00:39:33 jtc Exp $ +.\" @(#)select.2 8.2 (Berkeley) 3/25/94 .\" -.Dd March 10, 1991 +.Dd March 25, 1994 .Dt SELECT 2 .Os BSD 4.2 .Sh NAME .Nm select .Nd synchronous I/O multiplexing .Sh SYNOPSIS -.Fd #include <unistd.h> .Fd #include <sys/types.h> .Fd #include <sys/time.h> +.Fd #include <unistd.h> .Ft int .Fn select "int nfds" "fd_set *readfds" "fd_set *writefds" "fd_set *exceptfds" "struct timeval *timeout" .Fn FD_SET fd &fdset @@ -145,11 +146,12 @@ negative or too large. .Sh SEE ALSO .Xr accept 2 , .Xr connect 2 , +.Xr getdtablesize 2 , +.Xr gettimeofday 2 , .Xr read 2 , -.Xr write 2 , .Xr recv 2 , .Xr send 2 , -.Xr getdtablesize 2 +.Xr write 2 .Sh BUGS Although the provision of .Xr getdtablesize 2 diff --git a/lib/libc/sys/send.2 b/lib/libc/sys/send.2 index ef151313b75..3a290121daf 100644 --- a/lib/libc/sys/send.2 +++ b/lib/libc/sys/send.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: send.2,v 1.5 1995/02/27 12:36:43 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)send.2 6.9 (Berkeley) 5/1/91 -.\" $Id: send.2,v 1.4 1993/11/29 21:25:33 jtc Exp $ +.\" @(#)send.2 8.2 (Berkeley) 2/21/94 .\" -.Dd May 1, 1991 +.Dd February 21, 1994 .Dt SEND 2 .Os BSD 4.2 .Sh NAME @@ -43,11 +44,11 @@ .Sh SYNOPSIS .Fd #include <sys/types.h> .Fd #include <sys/socket.h> -.Ft int -.Fn send "int s" "const void *msg" "int len" "int flags" -.Ft int -.Fn sendto "int s" "const void *msg" "int len" "int flags" "const struct sockaddr *to" "int tolen" -.Ft int +.Ft ssize_t +.Fn send "int s" "const void *msg" "size_t len" "int flags" +.Ft ssize_t +.Fn sendto "int s" "const void *msg" "size_t len" "int flags" "const struct sockaddr *to" "int tolen" +.Ft ssize_t .Fn sendmsg "int s" "const struct msghdr *msg" "int flags" .Sh DESCRIPTION .Fn Send , @@ -137,7 +138,7 @@ An invalid user space address was specified for a parameter. .It Bq Er EMSGSIZE The socket requires that message be sent atomically, and the size of the message to be sent made this impossible. -.It Bq Er EWOULDBLOCK +.It Bq Er EAGAIN The socket is marked non-blocking and the requested operation would block. .It Bq Er ENOBUFS diff --git a/lib/libc/sys/setgroups.2 b/lib/libc/sys/setgroups.2 index ecafcedee08..1547f702787 100644 --- a/lib/libc/sys/setgroups.2 +++ b/lib/libc/sys/setgroups.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: setgroups.2,v 1.7 1995/02/27 12:36:49 cgd Exp $ +.\" +.\" Copyright (c) 1983, 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)setgroups.2 6.7 (Berkeley) 3/10/91 -.\" $Id: setgroups.2,v 1.6 1994/04/19 00:09:05 jtc Exp $ +.\" @(#)setgroups.2 8.2 (Berkeley) 4/16/94 .\" -.Dd March 10, 1991 +.Dd April 16, 1994 .Dt SETGROUPS 2 .Os BSD 4.2 .Sh NAME @@ -40,7 +41,6 @@ .Nd set group access list .Sh SYNOPSIS .Fd #include <sys/param.h> -.Fd #include <sys/types.h> .Fd #include <unistd.h> .Ft int .Fn setgroups "int ngroups" "const gid_t *gidset" diff --git a/lib/libc/sys/setpgid.2 b/lib/libc/sys/setpgid.2 index fa017a3c2c3..6b2cdbd9462 100644 --- a/lib/libc/sys/setpgid.2 +++ b/lib/libc/sys/setpgid.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: setpgid.2,v 1.8 1995/02/27 12:36:55 cgd Exp $ +.\" +.\" 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 @@ -29,11 +31,10 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)setpgid.2 6.3 (Berkeley) 3/10/91 -.\" $Id: setpgid.2,v 1.7 1994/05/02 23:54:59 jtc Exp $ +.\" @(#)setpgid.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 -.Dt SETPGRP 2 +.Dd June 4, 1993 +.Dt SETPGID 2 .Os BSD 4 .Sh NAME .Nm setpgid , diff --git a/lib/libc/sys/setsid.2 b/lib/libc/sys/setsid.2 index 48ac6a07178..e4be5f7cebe 100644 --- a/lib/libc/sys/setsid.2 +++ b/lib/libc/sys/setsid.2 @@ -1,3 +1,5 @@ +.\" $NetBSD: setsid.2,v 1.2 1995/02/27 12:37:00 cgd Exp $ +.\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" diff --git a/lib/libc/sys/setuid.2 b/lib/libc/sys/setuid.2 index 5c6a634475f..deca532b388 100644 --- a/lib/libc/sys/setuid.2 +++ b/lib/libc/sys/setuid.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: setuid.2,v 1.3 1995/02/27 12:37:06 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)setuid.3 6.4 (Berkeley) 4/19/91 -.\" $Id: setuid.2,v 1.2 1994/04/10 00:16:58 cgd Exp $ +.\" @(#)setuid.2 8.1 (Berkeley) 6/4/93 .\" -.Dd April 19, 1991 +.Dd June 4, 1993 .Dt SETUID 2 .Os BSD 4.2 .Sh NAME @@ -55,46 +56,54 @@ .Sh DESCRIPTION The .Fn setuid -function sets the real and effective user IDs and the saved -set-user-ID of the current process to the specified value. The +function +sets the real and effective +user IDs and the saved set-user-ID of the current process +to the specified value. +The .Fn setuid -function is permitted if the specified ID is equal to the real user ID of -the process, or if the effective user ID is that of the super user. +function is permitted if the specified ID is equal to the real user ID +of the process, or if the effective user ID is that of the super user. .Pp The .Fn setgid -function sets the real and effective group IDs and the saved -set-group-ID of the current process to the specified value. The +function +sets the real and effective +group IDs and the saved set-group-ID of the current process +to the specified value. +The .Fn setgid function is permitted if the specified ID is equal to the real group ID of the process, or if the effective user ID is that of the super user. .Pp The .Fn seteuid -function sets the effective user ID -of the current process. The effective user ID may be set to the value of -the real user ID or the saved set-user-ID (see -.Xr intro 2 +function +.Pq Fn setegid +sets the effective user ID (group ID) of the +current process. +The effective user ID may be set to the value +of the real user ID or the saved set-user-ID (see +.Xr intro 2 and -.Xr execve 2 ); -in this way, the effective user ID of a set-user-ID executable may be -toggled by switching to the real user ID, then re-enabled by reverting to -the set-user-ID value. -Similarly, with -.Fn setegid -the effective group ID may be set to -the value of the real group ID or the saved set-user-ID. +.Xr execve 2 ) ; +in this way, the effective user ID of a set-user-ID executable +may be toggled by switching to the real user ID, then re-enabled +by reverting to the set-user-ID value. +Similarly, the effective group ID may be set to the value +of the real group ID or the saved set-user-ID. +.Pp .Sh RETURN VALUES Upon success, these functions return 0; otherwise \-1 is returned. .Pp -If the user is not the super user, or the uid (gid) specified is not -the real ID, effective ID, or saved ID of the process, +If the user is not the super user, or the uid +specified is not the real, effective ID, or saved ID, these functions return \-1. .Sh SEE ALSO .Xr getuid 2 , .Xr getgid 2 -.Sh HISTORY +.Sh STANDARDS The .Fn setuid and diff --git a/lib/libc/sys/shutdown.2 b/lib/libc/sys/shutdown.2 index 27ef47effbe..927e3bdf329 100644 --- a/lib/libc/sys/shutdown.2 +++ b/lib/libc/sys/shutdown.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: shutdown.2,v 1.5 1995/02/27 12:37:11 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)shutdown.2 6.4 (Berkeley) 3/10/91 -.\" $Id: shutdown.2,v 1.4 1993/11/29 21:25:38 jtc Exp $ +.\" @(#)shutdown.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt SHUTDOWN 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/sigaction.2 b/lib/libc/sys/sigaction.2 index 6ab21b10200..dc038623c01 100644 --- a/lib/libc/sys/sigaction.2 +++ b/lib/libc/sys/sigaction.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1990 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: sigaction.2,v 1.6 1995/02/27 12:37:19 cgd Exp $ +.\" +.\" Copyright (c) 1980, 1990, 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)sigaction.2 6.3 (Berkeley) 7/23/91 -.\" $Id: sigaction.2,v 1.5 1994/10/17 23:49:15 cgd Exp $ +.\" @(#)sigaction.2 8.2 (Berkeley) 4/3/94 .\" -.Dd July 23, 1991 +.Dd April 3, 1994 .Dt SIGACTION 2 .Os .Sh NAME @@ -51,7 +52,7 @@ struct sigaction { .Fn sigaction "int sig" "struct sigaction *act" "struct sigaction *oact" .Sh DESCRIPTION The system defines a set of signals that may be delivered to a process. -Signal delivery resembles the occurence of a hardware interrupt: +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 @@ -150,6 +151,13 @@ See the signal list below for each signal's default action. If .Fa sa_handler is +.Dv SIG_DFL , +the default action for the signal is to discard the signal, +and if a signal is pending, +the pending signal is discarded even if the signal is masked. +If +.Fa sa_handler +is set to .Dv SIG_IGN current and pending instances of the signal are ignored and discarded. @@ -179,6 +187,7 @@ If a signal is caught during the system calls listed below, the call may be forced to terminate with the error .Dv EINTR , +the call may return with a data transfer shorter than requested, or the call may be restarted. Restart of pending calls is requested by setting the @@ -186,6 +195,7 @@ by setting the bit in .Ar sa_flags . The affected system calls include +.Xr open 2 , .Xr read 2 , .Xr write 2 , .Xr sendto 2 , @@ -221,7 +231,7 @@ The following is a list of all signals with names as in the include file .Aq Pa signal.h : .Bl -column SIGVTALARMXX "create core imagexxx" -.It Sy " NAME " " Default Action " " Description" +.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" @@ -268,35 +278,57 @@ The mask specified in is not allowed to block .Dv SIGKILL or -.Dv SIGSTOP +.Dv SIGSTOP . This is done silently by the system. .Sh RETURN VALUES A 0 value indicated that the call succeeded. A \-1 return value indicates an error occurred and .Va errno is set to indicated the reason. -.Sh ERROR +.Sh EXAMPLE +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. +.Fa Code +is a parameter that is either a constant +or the code provided by +the hardware. +.Fa Scp +is a pointer to the +.Fa sigcontext +structure (defined in +.Aq Pa signal.h ) , +used to restore the context from before the signal. +.Sh ERRORS .Fn Sigaction will fail and no new signal handler will be installed if one of the following occurs: -.Tw Er -.Tl Bq Er EFAULT +.Bl -tag -width Er +.It Bq Er EFAULT Either .Fa act or .Fa oact points to memory that is not a valid part of the process address space. -.Tl Bq Er EINVAL +.It Bq Er EINVAL .Fa Sig is not a valid signal number. -.Tl Bq Er EINVAL +.It Bq Er EINVAL An attempt is made to ignore or supply a handler for -.Em SIGKIL +.Dv SIGKILL or -.Dv SIGSTOP -.Tl -.Sh STANDARD +.Dv SIGSTOP . +.El +.Sh STANDARDS The .Nm sigaction function is defined by @@ -320,7 +352,7 @@ as are the signals, .Dv SIGWINCH , and .Dv SIGINFO . -Most of those signals are available on most +Those signals are available on most .Tn BSD Ns \-derived systems. .Sh SEE ALSO @@ -329,7 +361,6 @@ systems. .Xr kill 2 , .Xr sigaction 2 , .Xr sigprocmask 2 , -.Xr sigsetops 2 , .Xr sigsuspend 2 , .Xr sigblock 2 , .Xr sigsetmask 2 , @@ -338,33 +369,5 @@ systems. .Xr sigvec 3 , .Xr setjmp 3 , .Xr siginterrupt 3 , +.Xr sigsetops 3 , .Xr tty 4 -.Sh EXAMPLE -On a -.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. -.Em Code -is a parameter that is either a constant -as given below or 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). -.Fa Scp -is a pointer to the -.Fa sigcontext -structure (defined in -.Aq Pa signal.h ) , -used to restore the context from before the signal. diff --git a/lib/libc/sys/sigpending.2 b/lib/libc/sys/sigpending.2 index 0c87d4ff90a..3a0b95e9e2b 100644 --- a/lib/libc/sys/sigpending.2 +++ b/lib/libc/sys/sigpending.2 @@ -1,3 +1,5 @@ +.\" $NetBSD: sigpending.2,v 1.2 1995/02/27 12:37:26 cgd Exp $ +.\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. .\" diff --git a/lib/libc/sys/sigprocmask.2 b/lib/libc/sys/sigprocmask.2 index f62c52c71ba..cd33571d52f 100644 --- a/lib/libc/sys/sigprocmask.2 +++ b/lib/libc/sys/sigprocmask.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: sigprocmask.2,v 1.6 1995/02/27 12:37:33 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)sigprocmask.2 6.4 (Berkeley) 7/23/91 -.\" $Id: sigprocmask.2,v 1.5 1995/01/04 18:48:00 jtc Exp $ +.\" @(#)sigprocmask.2 8.1 (Berkeley) 6/4/93 .\" -.Dd July 23, 1991 +.Dd June 4, 1993 .Dt SIGPROCMASK 2 .Os .Sh NAME diff --git a/lib/libc/sys/sigreturn.2 b/lib/libc/sys/sigreturn.2 index 93527b0cb34..d92b3cf55d1 100644 --- a/lib/libc/sys/sigreturn.2 +++ b/lib/libc/sys/sigreturn.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1985, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: sigreturn.2,v 1.6 1995/02/27 12:37:40 cgd Exp $ +.\" +.\" Copyright (c) 1985, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,17 +31,16 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)sigreturn.2 6.5 (Berkeley) 3/10/91 -.\" $Id: sigreturn.2,v 1.5 1994/10/17 23:49:17 cgd Exp $ +.\" @(#)sigreturn.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt SIGRETURN 2 .Os BSD 4.3 .Sh NAME .Nm sigreturn .Nd return from signal .Sh SYNOPSIS -.Fd #include <sys/signal.h> +.Fd #include <signal.h> .Bd -literal struct sigcontext { int sc_onstack; diff --git a/lib/libc/sys/sigsuspend.2 b/lib/libc/sys/sigsuspend.2 index 820bbc76944..93f7ff56a55 100644 --- a/lib/libc/sys/sigsuspend.2 +++ b/lib/libc/sys/sigsuspend.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: sigsuspend.2,v 1.4 1995/02/27 12:37:46 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)sigsuspend.2 6.3 (Berkeley) 7/23/91 -.\" $Id: sigsuspend.2,v 1.3 1994/06/13 14:26:18 jtc Exp $ +.\" @(#)sigsuspend.2 8.1 (Berkeley) 6/4/93 .\" -.Dd July 23, 1991 +.Dd June 4, 1993 .Dt SIGSUSPEND 2 .Os .Sh NAME diff --git a/lib/libc/sys/socket.2 b/lib/libc/sys/socket.2 index add4303e169..364ab4a3c05 100644 --- a/lib/libc/sys/socket.2 +++ b/lib/libc/sys/socket.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: socket.2,v 1.5 1995/02/27 12:37:53 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)socket.2 6.8 (Berkeley) 3/10/91 -.\" $Id: socket.2,v 1.4 1993/11/29 21:25:43 jtc Exp $ +.\" @(#)socket.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt SOCKET 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/socketpair.2 b/lib/libc/sys/socketpair.2 index fa11a6b11f8..f5ae7ebfb8d 100644 --- a/lib/libc/sys/socketpair.2 +++ b/lib/libc/sys/socketpair.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: socketpair.2,v 1.5 1995/02/27 12:38:00 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)socketpair.2 6.4 (Berkeley) 3/10/91 -.\" $Id: socketpair.2,v 1.4 1993/11/29 21:25:44 jtc Exp $ +.\" @(#)socketpair.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt SOCKETPAIR 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/stat.2 b/lib/libc/sys/stat.2 index 58169e278be..0dcebd4c2df 100644 --- a/lib/libc/sys/stat.2 +++ b/lib/libc/sys/stat.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: stat.2,v 1.8 1995/02/27 12:38:08 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)stat.2 6.9 (Berkeley) 3/10/91 -.\" $Id: stat.2,v 1.7 1994/04/22 00:13:48 jtc Exp $ +.\" @(#)stat.2 8.3 (Berkeley) 4/19/94 .\" -.Dd March 10, 1991 +.Dd April 19, 1994 .Dt STAT 2 .Os BSD 4 .Sh NAME @@ -44,11 +45,11 @@ .Fd #include <sys/types.h> .Fd #include <sys/stat.h> .Ft int -.Fn stat "const char *path" "struct stat *buf" +.Fn stat "const char *path" "struct stat *sb" .Ft int -.Fn lstat "const char *path" "struct stat *buf" +.Fn lstat "const char *path" "struct stat *sb" .Ft int -.Fn fstat "int fd" "struct stat *buf" +.Fn fstat "int fd" "struct stat *sb" .Sh DESCRIPTION The .Fn stat @@ -68,19 +69,24 @@ returns information about the link, while .Fn stat returns information about the file the link references. +Unlike other filesystem objects, +symbolic links do not have an owner, group, access mode, times, etc. +Instead, these attributes are taken from the directory that +contains the link. +The only attributes returned from an +.Fn lstat +that refer to the symbolic link itself are the file type (S_IFLNK), +size, blocks, and link count (always 1). .Pp The .Fn fstat obtains the same information about an open file known by the file descriptor -.Fa fd , -such as would -be obtained by an -.Xr open -call. +.Fa fd . .Pp -.Fa Buf -is a pointer to a +The +.Fa sb +argument is a pointer to a .Fn stat structure as defined by @@ -96,15 +102,12 @@ struct stat { uid_t st_uid; /* user-id of owner */ gid_t st_gid; /* group-id of owner */ dev_t st_rdev; /* device type, for special file inode */ + struct timespec st_atimespec; /* time of last access */ + struct timespec st_mtimespec; /* time of last data modification */ + struct timespec st_ctimespec; /* time of last file status change */ off_t st_size; /* file size, in bytes */ - time_t st_atime; /* time of last access */ - long st_spare1; - time_t st_mtime; /* time of last data modification */ - long st_spare2; - time_t st_ctime; /* time of last file status change */ - long st_spare3; - long st_blksize;/* optimal file sys I/O ops blocksize */ - long st_blocks; /* blocks allocated for file */ + quad_t st_blocks; /* blocks allocated for file */ + u_long st_blksize;/* optimal file sys I/O ops blocksize */ u_long st_flags; /* user defined flags for file */ u_long st_gen; /* file generation number */ }; @@ -113,38 +116,53 @@ struct stat { The time-related fields of .Fa struct stat are as follows: -.Bl -tag -width st_blocks +.Bl -tag -width XXXst_mtime .It st_atime -Time when file data last accessed. Changed by the following system -calls: +Time when file data last accessed. +Changed by the .Xr mknod 2 , -.Xr utimes 2 , +.Xr utimes 2 and -.Xr read 2 . +.Xr read 2 +system calls. .It st_mtime Time when file data last modified. -Changed by the following system calls: +Changed by the .Xr mknod 2 , -.Xr utimes 2 , -.Xr write 2 . +.Xr utimes 2 +and +.Xr write 2 +system calls. .It st_ctime Time when file status was last changed (inode data modification). -Changed by the following system calls: -.Xr chmod 2 +Changed by the +.Xr chmod 2 , .Xr chown 2 , .Xr link 2 , .Xr mknod 2 , .Xr rename 2 , .Xr unlink 2 , -.Xr utimes 2 , -.Xr write 2 . +.Xr utimes 2 +and +.Xr write 2 +system calls. +.El +.Pp +The size-related fields of the +.Fa struct stat +are as follows: +.Bl -tag -width XXXst_blksize +.It st_blksize +The optimal I/O block size for the file. .It st_blocks The actual number of blocks allocated for the file in 512-byte units. +As short symbolic links are stored in the inode, this number may +be zero. .El .Pp The status information word .Fa st_mode -has bits: +has the following bits: .Bd -literal #define S_IFMT 0170000 /* type of file */ #define S_IFIFO 0010000 /* named pipe (fifo) */ @@ -172,6 +190,17 @@ Upon successful completion a value of 0 is returned. Otherwise, a value of -1 is returned and .Va errno is set to indicate the error. +.Sh COMPATIBILITY +Previous versions of the system used different types for the +.Li st_dev , +.Li st_uid , +.Li st_gid , +.Li st_rdev , +.Li st_size , +.Li st_blksize +and +.Li st_blocks +fields. .Sh ERRORS .Fn Stat and @@ -193,7 +222,7 @@ Search permission is denied for a component of the path prefix. .It Bq Er ELOOP Too many symbolic links were encountered in translating the pathname. .It Bq Er EFAULT -.Fa Buf +.Fa Sb or .Em name points to an invalid address. @@ -208,13 +237,13 @@ will fail if: .Fa fd is not a valid open file descriptor. .It Bq Er EFAULT -.Fa Buf +.Fa Sb points to an invalid address. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. .El .Sh CAVEAT -The fields in the stat structure currently marked +The fields in the stat structure currently marked .Fa st_spare1 , .Fa st_spare2 , and @@ -227,6 +256,7 @@ depend on the time stamps being contiguous (in calls to .Xr chmod 2 , .Xr chown 2 , .Xr utimes 2 +.Xr symlink 7 .Sh BUGS Applying .Xr fstat diff --git a/lib/libc/sys/swapon.2 b/lib/libc/sys/swapon.2 index a0f2cb11a4f..af187f69343 100644 --- a/lib/libc/sys/swapon.2 +++ b/lib/libc/sys/swapon.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: swapon.2,v 1.7 1995/02/27 12:38:21 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)swapon.2 6.7 (Berkeley) 3/10/91 -.\" $Id: swapon.2,v 1.6 1994/04/22 00:13:50 jtc Exp $ +.\" @(#)swapon.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt SWAPON 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/symlink.2 b/lib/libc/sys/symlink.2 index a352407b809..312324e1273 100644 --- a/lib/libc/sys/symlink.2 +++ b/lib/libc/sys/symlink.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: symlink.2,v 1.7 1995/02/27 12:38:34 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)symlink.2 6.6 (Berkeley) 3/10/91 -.\" $Id: symlink.2,v 1.6 1994/04/22 00:13:51 jtc Exp $ +.\" @(#)symlink.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt SYMLINK 2 .Os BSD 4.2 .Sh NAME diff --git a/lib/libc/sys/sync.2 b/lib/libc/sys/sync.2 index 0232c85cf03..a94475b4e07 100644 --- a/lib/libc/sys/sync.2 +++ b/lib/libc/sys/sync.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: sync.2,v 1.4 1995/02/27 12:38:41 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)sync.2 6.3 (Berkeley) 3/10/91 -.\" $Id: sync.2,v 1.3 1993/11/25 00:39:53 jtc Exp $ +.\" @(#)sync.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt SYNC 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/sysarch.2 b/lib/libc/sys/sysarch.2 index 1940d838335..49e5379d863 100644 --- a/lib/libc/sys/sysarch.2 +++ b/lib/libc/sys/sysarch.2 @@ -1,3 +1,5 @@ +.\" $NetBSD: sysarch.2,v 1.4 1995/02/27 12:38:47 cgd Exp $ +.\" .\" Copyright (c) 1980, 1991 Regents of the University of California. .\" All rights reserved. .\" @@ -30,11 +32,10 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)syscall.2 6.3 (Berkeley) 3/10/91 -.\" $Id: sysarch.2,v 1.3 1993/12/01 18:51:28 jtc Exp $ .\" .Dd October 11, 1993 .Dt SYSARCH 2 -.Os NetBSD 0.9a +.Os .Sh NAME .Nm sysarch .Nd architecture-depenent system call @@ -72,4 +73,4 @@ for information about their return values. The .Fn sysarch function call appeared in -NetBSD 0.9a. +.Nx 0.9a . diff --git a/lib/libc/sys/syscall.2 b/lib/libc/sys/syscall.2 index ab75cf28523..9de1e392227 100644 --- a/lib/libc/sys/syscall.2 +++ b/lib/libc/sys/syscall.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: syscall.2,v 1.4 1995/02/27 12:38:53 cgd Exp $ +.\" +.\" 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 @@ -29,20 +31,22 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)syscall.2 6.3 (Berkeley) 3/10/91 -.\" $Id: syscall.2,v 1.3 1993/11/25 00:39:55 jtc Exp $ +.\" @(#)syscall.2 8.1 (Berkeley) 6/16/93 .\" -.Dd March 10, 1991 +.Dd June 16, 1993 .Dt SYSCALL 2 .Os BSD 4 .Sh NAME -.Nm syscall +.Nm syscall , +.Nm __syscall .Nd indirect system call .Sh SYNOPSIS -.Fd #include <unistd.h> .Fd #include <sys/syscall.h> +.Fd #include <unistd.h> .Ft int .Fn syscall "int number" "..." +.Ft int +.Fn __syscall "quad_t number" "..." .Sh DESCRIPTION .Fn Syscall performs the system call whose assembly language @@ -50,19 +54,21 @@ interface has the specified .Fa number with the specified arguments. Symbolic constants for system calls can be found in the header file -.Ao Pa syscall.h Ac . -.Pp +.Ao Pa sys/syscall.h Ac . +The +.Nm __syscall +form should be used when one or more of the parameters is a +64-bit argument to ensure that argument alignment is correct. +This system call is useful for testing new system calls that +do not have entries in the C library. .Sh RETURN VALUES -The r0 value of the system call is returned. -When the C-bit is set, -.Fn syscall -returns -1 and sets the -external variable -.Va errno -(see -.Xr intro 2 ) . +The return values are defined by the system call being invoked. +In general, a 0 return value indicates success. +A -1 return value indicates an error, +and an error code is stored in +.Va errno . .Sh BUGS -There is no way to simulate system calls +There is no way to simulate system calls that have multiple return values such as .Xr pipe 2 . .Sh HISTORY diff --git a/lib/libc/sys/truncate.2 b/lib/libc/sys/truncate.2 index 2af26c93da3..06f01dec084 100644 --- a/lib/libc/sys/truncate.2 +++ b/lib/libc/sys/truncate.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1983, 1991 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: truncate.2,v 1.7 1995/02/27 12:39:00 cgd Exp $ +.\" +.\" Copyright (c) 1983, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -29,14 +31,14 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)truncate.2 6.9 (Berkeley) 3/10/91 -.\" $Id: truncate.2,v 1.6 1994/04/22 00:13:53 jtc Exp $ +.\" @(#)truncate.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt TRUNCATE 2 .Os BSD 4.2 .Sh NAME -.Nm truncate +.Nm truncate , +.Nm ftruncate .Nd truncate a file to a specified length .Sh SYNOPSIS .Fd #include <unistd.h> diff --git a/lib/libc/sys/umask.2 b/lib/libc/sys/umask.2 index 9d676f4d1fa..92eff34f7cf 100644 --- a/lib/libc/sys/umask.2 +++ b/lib/libc/sys/umask.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: umask.2,v 1.6 1995/02/27 12:39:06 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)umask.2 6.2 (Berkeley) 3/10/91 -.\" $Id: umask.2,v 1.5 1994/05/18 14:36:13 jtc Exp $ +.\" @(#)umask.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt UMASK 2 .Os BSD 4 .Sh NAME @@ -60,12 +61,13 @@ and .Xr mknod 2 to turn off corresponding bits requested in file mode. -(see +(See .Xr chmod 2 ) . This clearing allows each user to restrict the default access to his files. .Pp -The default mask value is 022 (write access for owner only). +The default mask value is S_IWGRP|S_IWOTH (022, write access for the +owner only). Child processes inherit the mask of the calling process. .Sh RETURN VALUES The previous value of the file mode mask is returned by the call. diff --git a/lib/libc/sys/unlink.2 b/lib/libc/sys/unlink.2 index b38a30fa3c8..6dfd46035f1 100644 --- a/lib/libc/sys/unlink.2 +++ b/lib/libc/sys/unlink.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: unlink.2,v 1.7 1995/02/27 12:39:13 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)unlink.2 6.3 (Berkeley) 3/10/91 -.\" $Id: unlink.2,v 1.6 1994/04/22 00:13:54 jtc Exp $ +.\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt UNLINK 2 .Os BSD 4 .Sh NAME @@ -107,6 +108,7 @@ points outside the process's allocated address space. .Xr close 2 , .Xr link 2 , .Xr rmdir 2 +.Xr symlink 7 .Sh HISTORY An .Fn unlink diff --git a/lib/libc/sys/utimes.2 b/lib/libc/sys/utimes.2 index 06ad3947c10..74f14740ab9 100644 --- a/lib/libc/sys/utimes.2 +++ b/lib/libc/sys/utimes.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1990 The Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: utimes.2,v 1.7 1995/02/27 12:39:22 cgd Exp $ +.\" +.\" Copyright (c) 1990, 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 @@ -29,9 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)utimes.2 6.7 (Berkeley) 4/19/91 +.\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" -.Dd April 19, 1991 +.Dd June 4, 1993 .Dt UTIMES 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/vfork.2 b/lib/libc/sys/vfork.2 index 2141a2147a1..06e201dfcf2 100644 --- a/lib/libc/sys/vfork.2 +++ b/lib/libc/sys/vfork.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: vfork.2,v 1.6 1995/02/27 12:39:30 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)vfork.2 6.3 (Berkeley) 3/10/91 -.\" $Id: vfork.2,v 1.5 1994/10/17 23:49:19 cgd Exp $ +.\" @(#)vfork.2 8.1 (Berkeley) 6/4/93 .\" -.Dd March 10, 1991 +.Dd June 4, 1993 .Dt VFORK 2 .Os BSD 4 .Sh NAME diff --git a/lib/libc/sys/wait.2 b/lib/libc/sys/wait.2 index f9dd4c776e4..8be94eda0fe 100644 --- a/lib/libc/sys/wait.2 +++ b/lib/libc/sys/wait.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: wait.2,v 1.6 1995/02/27 12:39:37 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)wait.2 6.5 (Berkeley) 3/10/91 -.\" $Id: wait.2,v 1.5 1994/01/10 23:54:38 jtc Exp $ +.\" @(#)wait.2 8.2 (Berkeley) 4/19/94 .\" -.Dd March 10, 1991 +.Dd April 19, 1994 .Dt WAIT 2 .Os BSD 4 .Sh NAME @@ -40,7 +41,7 @@ .Nm waitpid , .Nm wait4 , .Nm wait3 -.Nd wait for process terminatation +.Nd wait for process termination .Sh SYNOPSIS .Fd #include <sys/types.h> .Fd #include <sys/wait.h> diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2 index a3ebc4e2690..bb4813789d3 100644 --- a/lib/libc/sys/write.2 +++ b/lib/libc/sys/write.2 @@ -1,5 +1,7 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" All rights reserved. +.\" $NetBSD: write.2,v 1.6 1995/02/27 12:39:43 cgd Exp $ +.\" +.\" 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 @@ -29,10 +31,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" from: @(#)write.2 6.6 (Berkeley) 3/10/91 -.\" $Id: write.2,v 1.5 1994/09/16 03:08:47 mycroft Exp $ +.\" @(#)write.2 8.5 (Berkeley) 4/2/94 .\" -.Dd March 10, 1991 +.Dd April 2, 1994 .Dt WRITE 2 .Os BSD 4 .Sh NAME @@ -40,13 +41,13 @@ .Nm writev .Nd write output .Sh SYNOPSIS -.Fd #include <unistd.h> .Fd #include <sys/types.h> .Fd #include <sys/uio.h> +.Fd #include <unistd.h> .Ft ssize_t .Fn write "int d" "const void *buf" "size_t nbytes" -.Ft int -.Fn writev "int d" "struct iovec *iov" "int iovcnt" +.Ft ssize_t +.Fn writev "int d" "const struct iovec *iov" "int iovcnt" .Sh DESCRIPTION .Fn Write attempts to write @@ -68,10 +69,11 @@ For the .Fa iovec structure is defined as: +.Pp .Bd -literal -offset indent -compact struct iovec { - caddr_t iov_base; - int iov_len; + void *iov_base; + size_t iov_len; }; .Ed .Pp @@ -156,7 +158,7 @@ The user's quota of disk blocks on the file system containing the file has been exhausted. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. -.It Bq Er EWOULDBLOCK +.It Bq Er EAGAIN The file was marked for non-blocking I/O, and no data could be written immediately. .El |
