man page macro and text revisions (-mdoc version 3)
authorCynthia A. E. Livingston <cael@ucbvax.Berkeley.EDU>
Mon, 11 Mar 1991 15:49:59 +0000 (07:49 -0800)
committerCynthia A. E. Livingston <cael@ucbvax.Berkeley.EDU>
Mon, 11 Mar 1991 15:49:59 +0000 (07:49 -0800)
SCCS-vsn: lib/libc/sys/_exit.2 6.5
SCCS-vsn: lib/libc/sys/access.2 6.7
SCCS-vsn: lib/libc/sys/acct.2 6.5
SCCS-vsn: lib/libc/sys/adjtime.2 1.7
SCCS-vsn: lib/libc/sys/bind.2 6.9
SCCS-vsn: lib/libc/sys/brk.2 6.5
SCCS-vsn: lib/libc/sys/chdir.2 6.7
SCCS-vsn: lib/libc/sys/chflags.2 6.4
SCCS-vsn: lib/libc/sys/chmod.2 6.6
SCCS-vsn: lib/libc/sys/chown.2 6.7
SCCS-vsn: lib/libc/sys/chroot.2 6.5
SCCS-vsn: lib/libc/sys/close.2 6.4
SCCS-vsn: lib/libc/sys/connect.2 6.9
SCCS-vsn: lib/libc/sys/dup.2 6.4
SCCS-vsn: lib/libc/sys/execve.2 6.9
SCCS-vsn: lib/libc/sys/fcntl.2 6.7
SCCS-vsn: lib/libc/sys/flock.2 6.7
SCCS-vsn: lib/libc/sys/fork.2 6.5
SCCS-vsn: lib/libc/sys/fsync.2 6.7
SCCS-vsn: lib/libc/sys/getdirentries.2 6.4
SCCS-vsn: lib/libc/sys/getdtablesize.2 6.5
SCCS-vsn: lib/libc/sys/getfh.2 6.3
SCCS-vsn: lib/libc/sys/getfsstat.2 6.5
SCCS-vsn: lib/libc/sys/getgid.2 6.3
SCCS-vsn: lib/libc/sys/getgroups.2 6.7
SCCS-vsn: lib/libc/compat-43/gethostid.3 6.6
SCCS-vsn: lib/libc/gen/gethostname.3 6.7
SCCS-vsn: lib/libc/sys/getitimer.2 6.6
SCCS-vsn: lib/libc/sys/getlogin.2 6.2
SCCS-vsn: lib/libc/gen/getpagesize.3 6.4
SCCS-vsn: lib/libc/sys/getpeername.2 6.5
SCCS-vsn: lib/libc/sys/getpgrp.2 6.4
SCCS-vsn: lib/libc/sys/getpid.2 6.4
SCCS-vsn: lib/libc/sys/getpriority.2 6.9
SCCS-vsn: lib/libc/sys/getrlimit.2 6.7
SCCS-vsn: lib/libc/sys/getrusage.2 6.9
SCCS-vsn: lib/libc/sys/getsockname.2 6.4
SCCS-vsn: lib/libc/sys/getsockopt.2 6.7
SCCS-vsn: lib/libc/sys/gettimeofday.2 6.11
SCCS-vsn: lib/libc/sys/getuid.2 6.4
SCCS-vsn: lib/libc/sys/intro.2 6.11
SCCS-vsn: lib/libc/sys/ioctl.2 6.4
SCCS-vsn: lib/libc/sys/kill.2 6.6
SCCS-vsn: lib/libc/sys/link.2 6.4
SCCS-vsn: lib/libc/sys/listen.2 6.5
SCCS-vsn: lib/libc/sys/lseek.2 6.5
SCCS-vsn: lib/libc/sys/mkdir.2 6.7
SCCS-vsn: lib/libc/sys/mkfifo.2 6.3
SCCS-vsn: lib/libc/sys/mknod.2 6.5
SCCS-vsn: lib/libc/sys/mount.2 6.11
SCCS-vsn: lib/libc/sys/nfssvc.2 6.5
SCCS-vsn: lib/libc/sys/open.2 6.6
SCCS-vsn: lib/libc/sys/pipe.2 6.3
SCCS-vsn: lib/libc/sys/quotactl.2 6.12
SCCS-vsn: lib/libc/sys/read.2 6.7
SCCS-vsn: lib/libc/sys/readlink.2 6.8
SCCS-vsn: lib/libc/sys/reboot.2 6.5
SCCS-vsn: lib/libc/sys/recv.2 6.9
SCCS-vsn: lib/libc/sys/rename.2 6.7
SCCS-vsn: lib/libc/sys/rmdir.2 6.6
SCCS-vsn: lib/libc/sys/select.2 6.8
SCCS-vsn: lib/libc/sys/send.2 6.7
SCCS-vsn: lib/libc/sys/setgroups.2 6.7
SCCS-vsn: lib/libc/sys/setpgid.2 6.3
SCCS-vsn: lib/libc/compat-43/setreuid.2 6.4
SCCS-vsn: lib/libc/sys/shutdown.2 6.4
SCCS-vsn: lib/libc/sys/sigprocmask.2 6.3
SCCS-vsn: lib/libc/sys/sigreturn.2 6.5
SCCS-vsn: lib/libc/sys/sigstack.2 6.5
SCCS-vsn: lib/libc/sys/sigsuspend.2 6.2
SCCS-vsn: lib/libc/sys/socket.2 6.8
SCCS-vsn: lib/libc/sys/socketpair.2 6.4
SCCS-vsn: lib/libc/sys/stat.2 6.9
SCCS-vsn: lib/libc/sys/statfs.2 6.4
SCCS-vsn: lib/libc/sys/swapon.2 6.7
SCCS-vsn: lib/libc/sys/symlink.2 6.6
SCCS-vsn: lib/libc/sys/sync.2 6.3
SCCS-vsn: lib/libc/sys/syscall.2 6.3
SCCS-vsn: lib/libc/sys/truncate.2 6.9
SCCS-vsn: lib/libc/sys/umask.2 6.2
SCCS-vsn: lib/libc/sys/unlink.2 6.3
SCCS-vsn: lib/libc/sys/utimes.2 6.6
SCCS-vsn: lib/libc/sys/vfork.2 6.3
SCCS-vsn: lib/libc/sys/wait.2 6.5
SCCS-vsn: lib/libc/sys/write.2 6.6
SCCS-vsn: lib/libc/compat-43/creat.2 6.9
SCCS-vsn: lib/libc/compat-43/killpg.2 6.5
SCCS-vsn: lib/libc/compat-43/sigblock.2 6.7
SCCS-vsn: lib/libc/compat-43/sigpause.2 6.6
SCCS-vsn: lib/libc/compat-43/sigsetmask.2 6.7

90 files changed:
usr/src/lib/libc/compat-43/creat.2
usr/src/lib/libc/compat-43/gethostid.3
usr/src/lib/libc/compat-43/killpg.2
usr/src/lib/libc/compat-43/setreuid.2
usr/src/lib/libc/compat-43/sigblock.2
usr/src/lib/libc/compat-43/sigpause.2
usr/src/lib/libc/compat-43/sigsetmask.2
usr/src/lib/libc/gen/gethostname.3
usr/src/lib/libc/gen/getpagesize.3
usr/src/lib/libc/sys/_exit.2
usr/src/lib/libc/sys/access.2
usr/src/lib/libc/sys/acct.2
usr/src/lib/libc/sys/adjtime.2
usr/src/lib/libc/sys/bind.2
usr/src/lib/libc/sys/brk.2
usr/src/lib/libc/sys/chdir.2
usr/src/lib/libc/sys/chflags.2
usr/src/lib/libc/sys/chmod.2
usr/src/lib/libc/sys/chown.2
usr/src/lib/libc/sys/chroot.2
usr/src/lib/libc/sys/close.2
usr/src/lib/libc/sys/connect.2
usr/src/lib/libc/sys/dup.2
usr/src/lib/libc/sys/execve.2
usr/src/lib/libc/sys/fcntl.2
usr/src/lib/libc/sys/flock.2
usr/src/lib/libc/sys/fork.2
usr/src/lib/libc/sys/fsync.2
usr/src/lib/libc/sys/getdirentries.2
usr/src/lib/libc/sys/getdtablesize.2
usr/src/lib/libc/sys/getfh.2
usr/src/lib/libc/sys/getfsstat.2
usr/src/lib/libc/sys/getgid.2
usr/src/lib/libc/sys/getgroups.2
usr/src/lib/libc/sys/getitimer.2
usr/src/lib/libc/sys/getlogin.2
usr/src/lib/libc/sys/getpeername.2
usr/src/lib/libc/sys/getpgrp.2
usr/src/lib/libc/sys/getpid.2
usr/src/lib/libc/sys/getpriority.2
usr/src/lib/libc/sys/getrlimit.2
usr/src/lib/libc/sys/getrusage.2
usr/src/lib/libc/sys/getsockname.2
usr/src/lib/libc/sys/getsockopt.2
usr/src/lib/libc/sys/gettimeofday.2
usr/src/lib/libc/sys/getuid.2
usr/src/lib/libc/sys/intro.2
usr/src/lib/libc/sys/ioctl.2
usr/src/lib/libc/sys/kill.2
usr/src/lib/libc/sys/link.2
usr/src/lib/libc/sys/listen.2
usr/src/lib/libc/sys/lseek.2
usr/src/lib/libc/sys/mkdir.2
usr/src/lib/libc/sys/mkfifo.2
usr/src/lib/libc/sys/mknod.2
usr/src/lib/libc/sys/mount.2
usr/src/lib/libc/sys/nfssvc.2
usr/src/lib/libc/sys/open.2
usr/src/lib/libc/sys/pipe.2
usr/src/lib/libc/sys/quotactl.2
usr/src/lib/libc/sys/read.2
usr/src/lib/libc/sys/readlink.2
usr/src/lib/libc/sys/reboot.2
usr/src/lib/libc/sys/recv.2
usr/src/lib/libc/sys/rename.2
usr/src/lib/libc/sys/rmdir.2
usr/src/lib/libc/sys/select.2
usr/src/lib/libc/sys/send.2
usr/src/lib/libc/sys/setgroups.2
usr/src/lib/libc/sys/setpgid.2
usr/src/lib/libc/sys/shutdown.2
usr/src/lib/libc/sys/sigprocmask.2
usr/src/lib/libc/sys/sigreturn.2
usr/src/lib/libc/sys/sigstack.2
usr/src/lib/libc/sys/sigsuspend.2
usr/src/lib/libc/sys/socket.2
usr/src/lib/libc/sys/socketpair.2
usr/src/lib/libc/sys/stat.2
usr/src/lib/libc/sys/statfs.2
usr/src/lib/libc/sys/swapon.2
usr/src/lib/libc/sys/symlink.2
usr/src/lib/libc/sys/sync.2
usr/src/lib/libc/sys/syscall.2
usr/src/lib/libc/sys/truncate.2
usr/src/lib/libc/sys/umask.2
usr/src/lib/libc/sys/unlink.2
usr/src/lib/libc/sys/utimes.2
usr/src/lib/libc/sys/vfork.2
usr/src/lib/libc/sys/wait.2
usr/src/lib/libc/sys/write.2

index 4d91780..517369a 100644 (file)
@@ -1,30 +1,32 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1990 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)creat.2     6.8 (Berkeley) %G%
+.\"     @(#)creat.2    6.9 (Berkeley) %G%
 .\"
 .\"
-.TH CREAT 2 ""
-.UC 4
-.SH NAME
-creat \- create a new file
-.SH SYNOPSIS
-.nf
-.ft B
-creat(path, mode)
-char *path;
-mode_t mode;
-.ft R
-.fi
-.SH DESCRIPTION
-.B "This interface is made obsolete by open(2).
-.PP
-.I Creat
+.Dd 
+.Dt CREAT 2
+.Os BSD 4
+.Sh NAME
+.Nm creat
+.Nd create a new file
+.Sh SYNOPSIS
+.Fn creat "char *path" "mode_t mode"
+.Sh DESCRIPTION
+.Bf -symbolic
+This interface is made obsolete by:
+.Ef
+.Xr open 2 .
+.Pp
+.Fn Creat
 is the same as:
 is the same as:
-.sp
-.RS
+.Bd -literal -offset indent
 open(path, O_WRONLY | O_CREAT | O_WRONLY, mode);
 open(path, O_WRONLY | O_CREAT | O_WRONLY, mode);
-.RE
-.SH "SEE ALSO"
-open(2)
+.Ed
+.Sh SEE ALSO
+.Xr open 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in Version 6 AT&T UNIX.
index a9d971d..e25cbb9 100644 (file)
@@ -1,35 +1,40 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)gethostid.3 6.5 (Berkeley) %G%
+.\"     @(#)gethostid.3        6.6 (Berkeley) %G%
 .\"
 .\"
-.TH GETHOSTID 2 ""
-.UC 5
-.SH NAME
-gethostid, sethostid \- get/set unique identifier of current host
-.SH SYNOPSIS
-.nf
-.ft B
-hostid = gethostid()
-long hostid;
-.PP
-.ft B
-sethostid(hostid)
-long hostid;
-.fi
-.SH DESCRIPTION
-.I Sethostid
+.Dd 
+.Dt GETHOSTID 2
+.Os BSD 4.2
+.Sh NAME
+.Nm gethostid ,
+.Nm sethostid
+.Nd get/set unique identifier of current host
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft long
+.Fn gethostid void
+.Ft int
+.Fn sethostid "long hostid"
+.Sh DESCRIPTION
+.Fn Sethostid
 establishes a 32-bit identifier for the
 current processor that is intended to be unique among all
 UNIX systems in existence.  This is normally a DARPA Internet
 address for the local machine.  This call is allowed only to the
 super-user and is normally performed at boot time.
 establishes a 32-bit identifier for the
 current processor that is intended to be unique among all
 UNIX systems in existence.  This is normally a DARPA Internet
 address for the local machine.  This call is allowed only to the
 super-user and is normally performed at boot time.
-.PP
-.I Gethostid
+.Pp
+.Fn Gethostid
 returns the 32-bit identifier for the current processor.
 returns the 32-bit identifier for the current processor.
-.SH SEE ALSO
-hostid(1), gethostname(2)
-.SH BUGS
+.Sh SEE ALSO
+.Xr hostid 1 ,
+.Xr gethostname 2
+.Sh BUGS
 32 bits for the identifier is too small.
 32 bits for the identifier is too small.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 3f19055..052f45e 100644 (file)
@@ -1,56 +1,69 @@
-.\" Copyright (c) 1980 The Regents of the University of California.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)killpg.2    6.4 (Berkeley) %G%
+.\"     @(#)killpg.2   6.5 (Berkeley) %G%
 .\"
 .\"
-.TH KILLPG 2 ""
-.UC 4
-.SH NAME
-killpg \- send signal to a process group
-.SH SYNOPSIS
-.ft B
-killpg(pgrp, sig)
-.br
-int pgrp, sig;
-.ft R
-.SH DESCRIPTION
-.I Killpg
+.Dd 
+.Dt KILLPG 2
+.Os BSD 4
+.Sh NAME
+.Nm killpg
+.Nd send signal to a process group
+.Sh SYNOPSIS
+.Fd #include <sys/signal.h>
+.Ft int
+.Fn killpg "pid_t pgrp" "int sig"
+.Sh DESCRIPTION
+.Fn Killpg
 sends the signal
 sends the signal
-.I sig
+.Fa sig
 to the process group
 to the process group
-.IR pgrp .
+.Fa pgrp .
 See
 See
-.IR sigvec (2)
+.Xr sigaction 2
 for a list of signals.
 for a list of signals.
-.PP
+If
+.Fa pgrp
+is 0,
+.Fn killpg
+sends the signal to the sending process's process group.
+.Pp
 The sending process and members of the process group must
 have the same effective user ID, or
 the sender must be the super-user.
 As a single special case the continue signal SIGCONT may be sent
 to any process that is a descendant of the current process.
 The sending process and members of the process group must
 have the same effective user ID, or
 the sender must be the super-user.
 As a single special case the continue signal SIGCONT may be sent
 to any process that is a descendant of the current process.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.  Otherwise,
 Upon successful completion, a value of 0 is returned.  Otherwise,
-a value of \-1 is returned and the global variable \fIerrno\fP
+a value of -1 is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH "ERRORS
-\fIKillpg\fP will fail and no signal will be sent if any of the
-following occur:
-.TP 15
-[EINVAL]
-\fISig\fP is not a valid signal number.
-.TP 15
-[ESRCH]
-No process can be found in the process group specified by \fIpgrp\fP.
-.TP 15
-[ESRCH]
+.SERRORS
+.Fn Killpg
+will fail and no signal will be sent if:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+.Fa Sig
+is not a valid signal number.
+.It Bq Er ESRCH
+No process can be found in the process group specified by
+.Fa pgrp .
+.It Bq Er ESRCH
 The process group was given as 0
 but the sending process does not have a process group.
 The process group was given as 0
 but the sending process does not have a process group.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The sending process is not the super-user and one or more
 of the target processes has an effective user ID different from that
 of the sending process.
 The sending process is not the super-user and one or more
 of the target processes has an effective user ID different from that
 of the sending process.
-.SH "SEE ALSO"
-kill(2), getpgrp(2), sigvec(2)
+.El
+.Sh SEE ALSO
+.Xr kill 2 ,
+.Xr getpgrp 2 ,
+.Xr sigaction 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.0 .
index ebc0faf..7a9ff58 100644 (file)
@@ -1,40 +1,49 @@
-.\" Copyright (c) 1980 The Regents of the University of California.
+.\" Copyright (c) 1980, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)setreuid.2  6.3 (Berkeley) %G%
+.\"     @(#)setreuid.2 6.4 (Berkeley) %G%
 .\"
 .\"
-.TH SETREUID 2 ""
-.UC 4
-.SH NAME
-setreuid \- set real and effective user ID's
-.SH SYNOPSIS
-.ft B
-.nf
-setreuid(ruid, euid)
-int ruid, euid;
-.fi
-.ft R
-.SH DESCRIPTION
+.Dd 
+.Dt SETREUID 2
+.Os BSD 4
+.Sh NAME
+.Nm setreuid
+.Nd set real and effective user ID's
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn setreuid "int ruid" "int euid"
+.Sh DESCRIPTION
 The real and effective user ID's of the
 current process are set according to the arguments.
 If
 The real and effective user ID's of the
 current process are set according to the arguments.
 If
-.I ruid
+.Fa ruid
 or 
 or 
-.I euid
-is \-1, the current uid is filled in by the system.
+.Fa euid
+is -1, the current uid is filled in by the system.
 Unprivileged users may change the real user
 ID to the effective user ID and vice-versa; only the super-user may
 make other changes.
 Unprivileged users may change the real user
 ID to the effective user ID and vice-versa; only the super-user may
 make other changes.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.  Otherwise,
 Upon successful completion, a value of 0 is returned.  Otherwise,
-a value of \-1 is returned and \fIerrno\fP is set to indicate the error.
-.SH "ERRORS
-.TP 15
-[EPERM]
+a value of -1 is returned and
+.Va errno
+is set to indicate the error.
+.Sh ERRORS
+.Bl -tag -width [EPERM]
+.It Bq Er EPERM
 The current process is not the super-user and a change
 other than changing the effective user-id to the real user-id
 was specified.
 The current process is not the super-user and a change
 other than changing the effective user-id to the real user-id
 was specified.
-.SH "SEE ALSO"
-getuid(2), setregid(2), setuid(3)
+.El
+.Sh SEE ALSO
+.Xr getuid 2 ,
+.Xr setregid 2 ,
+.Xr setuid 3
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 4de4c6e..eff6d31 100644 (file)
@@ -1,42 +1,58 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)sigblock.2  6.6 (Berkeley) %G%
+.\"     @(#)sigblock.2 6.7 (Berkeley) %G%
 .\"
 .\"
-.TH SIGBLOCK 2 ""
-.UC 5
-.SH NAME
-sigblock \- block signals
-.SH SYNOPSIS
-.nf
-.B #include <signal.h>
-
-.B sigblock(mask);
-.B int mask;
-
-.B mask = sigmask(signum)
-.SH DESCRIPTION
-.B "This interface is made obsolete by sigprocmask(2).
-.LP
-.I Sigblock
-causes the signals specified in
-.I mask
-to be added to the set of signals currently
+.Dd 
+.Dt SIGBLOCK 2
+.Os BSD 4.2
+.Sh NAME
+.Nm sigblock
+.Nd block signals
+.Sh SYNOPSIS
+.Fd #include <sys/signal.h>
+.Ft int
+.Fn sigblock "int mask"
+.Ft int
+.Fn sigmask signum
+.Sh DESCRIPTION
+.Bf -symbolic
+This interface is made obsolete by:
+.Ef
+.Xr sigprocmask 2 .
+.Pp
+.Fn Sigblock
+adds the signals specified in
+.Fa mask
+to the set of signals currently
 being blocked from delivery.
 Signals are blocked if the
 corresponding bit in 
 being blocked from delivery.
 Signals are blocked if the
 corresponding bit in 
-.I mask
+.Fa mask
 is a 1; the macro
 is a 1; the macro
-.I sigmask
+.Fn sigmask
 is provided to construct the mask for a given
 is provided to construct the mask for a given
-.IR signum .
-.PP
-It is not possible to block SIGKILL
-or SIGSTOP; this restriction is silently
+.Fa signum .
+.Pp
+It is not possible to block
+.Dv SIGKILL
+or
+.Dv SIGSTOP ;
+this restriction is silently
 imposed by the system.
 imposed by the system.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 The previous set of masked signals is returned.
 The previous set of masked signals is returned.
-.SH "SEE ALSO"
-kill(2), sigprocmask(2), sigaction(2), sigsetmask(2), sigsetops(3)
+.Sh SEE ALSO
+.Xr kill 2 ,
+.Xr sigprocmask 2 ,
+.Xr sigaction 2 ,
+.Xr sigsetmask 2 ,
+.Xr sigsetops 3
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2
+and has been deprecated.
index fd55c6d..8e729d0 100644 (file)
@@ -1,45 +1,48 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)sigpause.2  6.5 (Berkeley) %G%
+.\"     @(#)sigpause.2 6.6 (Berkeley) %G%
 .\"
 .\"
-.TH SIGPAUSE 2 ""
-.UC 4
-.SH NAME
-sigpause \- atomically release blocked signals and wait for interrupt
-.SH SYNOPSIS
-.ft B
-sigpause(sigmask)
-.br
-int sigmask;
-.ft R
-.SH DESCRIPTION
-.B "This interface is made obsolete by sigsuspend(2).
-.LP
-.I Sigpause
+.Dd 
+.Dt SIGPAUSE 2
+.Os BSD 4
+.Sh NAME
+.Nm sigpause
+.Nd atomically release blocked signals and wait for interrupt
+.Sh SYNOPSIS
+.Fd #include <sys/signal.h>
+.Ft int
+.Fn sigpause "int sigmask"
+.Sh DESCRIPTION
+.Sy This interface is made obsolete by
+.Xr sigsuspend 2 .
+.Pp
+.Fn Sigpause
 assigns 
 assigns 
-.I sigmask
+.Fa sigmask
 to the set of masked signals
 and then waits for a signal to arrive;
 on return the set of masked signals is restored.
 to the set of masked signals
 and then waits for a signal to arrive;
 on return the set of masked signals is restored.
-.I Sigmask
+.Fa Sigmask
 is usually 0 to indicate that no
 is usually 0 to indicate that no
-signals are now to be blocked.
-.I Sigpause
-always terminates by being interrupted, returning \-1 with
-.I errno
-set to EINTR.
-.PP
-In normal usage, a signal is blocked using
-.IR sigblock (2),
-to begin a critical section, variables modified on the occurrence
-of the signal are examined to determine that there is no work
-to be done, and the process pauses awaiting work by using
-.I sigpause
-with the mask returned by
-.IR sigblock .
-.SH SEE ALSO
-sigsuspend(2), kill(2), sigaction(2), sigprocmask(2),
-sigblock(2), sigvec(2)
+signals are to be blocked.
+.Fn Sigpause
+always terminates by being interrupted, returning -1 with
+.Va errno
+set to
+.Dv EINTR
+.Sh SEE ALSO
+.Xr sigsuspend 2 ,
+.Xr kill 2 ,
+.Xr sigaction 2 ,
+.Xr sigprocmask 2 ,
+.Xr sigblock 2 ,
+.Xr sigvec 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2
+and has been deprecated.
index 84b7060..5114c94 100644 (file)
@@ -1,40 +1,56 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)sigsetmask.2        6.6 (Berkeley) %G%
+.\"     @(#)sigsetmask.2       6.7 (Berkeley) %G%
 .\"
 .\"
-.TH SIGSETMASK 2 ""
-.UC 5
-.SH NAME
-sigsetmask \- set current signal mask
-.SH SYNOPSIS
-.nf
-.B #include <signal.h>
-
-.B sigsetmask(mask);
-.B int mask;
-
-.B mask = sigmask(signum)
-.SH DESCRIPTION
-.B "This interface is made obsolete by sigprocmask(2).
-.LP
-.I Sigsetmask
-sets the current signal mask (those signals
-that are blocked from delivery).
-Signals are blocked if the
+.Dd 
+.Dt SIGSETMASK 2
+.Os BSD 4.2
+.Sh NAME
+.Nm sigsetmask
+.Nd set current signal mask
+.Sh SYNOPSIS
+.Fd #include <sys/signal.h>
+.Ft int
+.Fn sigsetmask "int mask"
+.Fn sigmask signum
+.Sh DESCRIPTION
+.Bf -symbolic
+This interface is made obsoleted by:
+.Ef
+.Xr sigprocmask 2 .
+.Pp
+.Fn Sigsetmask
+sets the current signal mask
+Signals are blocked from delivery if the
 corresponding bit in 
 corresponding bit in 
-.I mask
+.Fa mask
 is a 1; the macro
 is a 1; the macro
-.I sigmask
+.Fn sigmask
 is provided to construct the mask for a given
 is provided to construct the mask for a given
-.IR signum .
-.PP
+.Fa signum .
+.Pp
 The system
 The system
-quietly disallows SIGKILL or SIGSTOP to be blocked.
-.SH "RETURN VALUE
+quietly disallows
+.Dv SIGKILL
+or
+.Dv SIGSTOP
+to be blocked.
+.Sh RETURN VALUES
 The previous set of masked signals is returned.
 The previous set of masked signals is returned.
-.SH "SEE ALSO"
-sigprocmask(2), kill(2), sigaction(2), sigsuspend(2),
-sigvec(2), sigblock(2), sigsetops(3)
+.Sh SEE ALSO
+.Xr sigprocmask 2 ,
+.Xr kill 2 ,
+.Xr sigaction 2 ,
+.Xr sigsuspend 2 ,
+.Xr sigvec 2 ,
+.Xr sigblock 2 ,
+.Xr sigsetops 3
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2
+and has been deprecated.
index 3c19267..e15883d 100644 (file)
@@ -1,61 +1,70 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)gethostname.3       6.6 (Berkeley) %G%
+.\"     @(#)gethostname.3      6.7 (Berkeley) %G%
 .\"
 .\"
-.TH GETHOSTNAME 2 ""
-.UC 5
-.SH NAME
-gethostname, sethostname \- get/set name of current host
-.SH SYNOPSIS
-.nf
-.ft B
-gethostname(name, namelen)
-char *name;
-int namelen;
-.PP
-.ft B
-sethostname(name, namelen)
-char *name;
-int namelen;
-.fi
-.SH DESCRIPTION
-.I Gethostname
+.Dd 
+.Dt GETHOSTNAME 2
+.Os BSD 4.2
+.Sh NAME
+.Nm gethostname ,
+.Nm sethostname
+.Nd get/set name of current host
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn gethostname "char *name" "int namelen"
+.Ft int
+.Fn sethostname "const char *name" "int namelen"
+.Sh DESCRIPTION
+.Fn Gethostname
 returns the standard host name for the current processor, as
 previously set by
 returns the standard host name for the current processor, as
 previously set by
-.IR sethostname . 
+.Fn sethostname .
 The parameter
 The parameter
-.I namelen
+.Fa namelen
 specifies the size of the 
 specifies the size of the 
-.I name
+.Fa name
 array.  The returned name is null-terminated unless insufficient
 space is provided.
 array.  The returned name is null-terminated unless insufficient
 space is provided.
-.PP
-.I Sethostname
+.Pp
+.Fn Sethostname
 sets the name of the host machine to be
 sets the name of the host machine to be
-.IR name ,
+.Fa name ,
 which has length
 which has length
-.IR namelen .
+.Fa namelen .
 This call is restricted to the super-user and
 is normally used only when the system is bootstrapped.
 This call is restricted to the super-user and
 is normally used only when the system is bootstrapped.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 If the call succeeds a value of 0 is returned.  If the call
 If the call succeeds a value of 0 is returned.  If the call
-fails, then a value of \-1 is returned and an error code is
-placed in the global location \fIerrno\fP.
-.SH "ERRORS
+fails, a value of -1 is returned and an error code is
+placed in the global location
+.Va errno .
+.Sh ERRORS
 The following errors may be returned by these calls:
 The following errors may be returned by these calls:
-.TP 15
-[EFAULT]
-The \fIname\fP or \fInamelen\fP parameter gave an
+.Bl -tag -width Er
+.It Bq Er EFAULT
+The
+.Fa name
+or
+.Fa namelen
+parameter gave an
 invalid address.
 invalid address.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The caller tried to set the hostname and was not the super-user.
 The caller tried to set the hostname and was not the super-user.
-.SH SEE ALSO
-gethostid(2)
-.SH BUGS
-Host names are limited to MAXHOSTNAMELEN (from
-.IR <sys/param.h> )
+.El
+.Sh SEE ALSO
+.Xr gethostid 2
+.Sh BUGS
+Host names are limited to
+.Dv MAXHOSTNAMELEN
+(from
+.Ao Pa sys/param.h Ac )
 characters, currently 64.
 characters, currently 64.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index b0983bc..7a7d4fe 100644 (file)
@@ -1,30 +1,35 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getpagesize.3       6.3 (Berkeley) %G%
+.\"     @(#)getpagesize.3      6.4 (Berkeley) %G%
 .\"
 .\"
-.TH GETPAGESIZE 2 ""
-.UC 5
-.SH NAME
-getpagesize \- get system page size
-.SH SYNOPSIS
-.nf
-.ft B
-pagesize = getpagesize()
-int pagesize;
-.ft R
-.fi
-.SH DESCRIPTION
-.I Getpagesize
+.Dd 
+.Dt GETPAGESIZE 2
+.Os BSD 4.2
+.Sh NAME
+.Nm getpagesize
+.Nd get system page size
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn getpagesize void
+.Sh DESCRIPTION
+.Fn Getpagesize
 returns the number of bytes in a page.
 Page granularity is the granularity of many of the memory
 management calls.
 returns the number of bytes in a page.
 Page granularity is the granularity of many of the memory
 management calls.
-.PP
+.Pp
 The page size is a 
 The page size is a 
-.I system
+.Xr system
 page size and may not be the same as the underlying
 hardware page size.
 page size and may not be the same as the underlying
 hardware page size.
-.SH SEE ALSO
-sbrk(2), pagesize(1)
+.Sh SEE ALSO
+.Xr sbrk 2 ,
+.Xr pagesize 1
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 18cd5a9..b5a164d 100644 (file)
@@ -1,49 +1,67 @@
 .\" Copyright (c) 1980 Regents of the University of California.
 .\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)_exit.2     6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH EXIT 2 ""
-.UC 4
-.SH NAME
-_exit \- terminate a process
-.SH SYNOPSIS
-.nf
-.ft B
-_exit(status)
-int status;
-.fi
-.SH DESCRIPTION
-.I _exit
+.\"     @(#)_exit.2    6.5 (Berkeley) %G%
+.\"
+.Dt EXIT 2
+.Dd 
+.Os BSD 4
+.Sh NAME
+.Nm _exit
+.Nd terminate the calling process
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft void volatile
+.Fn _exit "int status"
+.Sh DESCRIPTION
+The
+.Fn _exit
+function
 terminates a process with the following consequences:
 terminates a process with the following consequences:
-.in +5n
-.PP
+.Bl -bullet
+.It
 All of the descriptors open in the calling process are closed.
 This may entail delays, for example, waiting for output to drain;
 a process in this state may not be killed, as it is already dying.
 All of the descriptors open in the calling process are closed.
 This may entail delays, for example, waiting for output to drain;
 a process in this state may not be killed, as it is already dying.
-.PP
-If the parent process of the calling process is executing a
-.I wait
-or is interested in the SIGCHLD signal,
-then it is notified of the calling process's termination and
-the low-order eight bits of \fIstatus\fP are made available to it;
-see
-.IR wait (2).
-.PP
-The parent process ID of all of the calling process's existing child
-processes are also set to 1.  This means that the initialization process
-(see 
-.IR intro (2))
-inherits each of these processes as well.
-Any stopped children are restarted with a hangup signal (SIGHUP).
-.in -5n
-.PP
+.It
+If the parent process of the calling process has an outstanding
+.Xr wait
+call
+or is interested in the
+.Dv SIGCHLD
+signal,
+it is notified of the calling process's termination and
+the
+.Em status
+area is set as defined by
+.Xr wait 2 .
+.It
+The parent process-ID of all of the calling process's existing child
+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 .
+.El
+.Pp
 Most C programs call the library routine
 Most C programs call the library routine
-.IR exit (3),
-which performs cleanup actions in the standard I/O library before
-calling \fI_exit\fP\|.
-.SH "RETURN VALUE"
-This call never returns.
-.SH "SEE ALSO"
-fork(2), sigvec(2), wait(2), exit(3)
+.Xr exit 3 ,
+which flushes buffers, closes streams, unlinks temporary files, etc.,
+before
+calling
+.Fn _exit .
+.Sh RETURN VALUE
+.Fn _exit
+can never return.
+.Sh SEE ALSO
+.Xr fork 2 ,
+.Xr sigvec 2 ,
+.Xr wait 2 ,
+.Xr exit 3
+.Sh HISTORY
+An
+.Nm exit
+function call appeared in Version 6 AT&T UNIX.
index b3c78ce..efaa854 100644 (file)
@@ -1,88 +1,84 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)access.2    6.6 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH ACCESS 2 ""
-.UC 4
-.SH NAME
-access \- determine accessibility of file
-.SH SYNOPSIS
-.nf
-.ft B
-#include <unistd.h>
-
-accessible = access(path, mode)
-int accessible;
-char *path;
-int mode;
-.ft R
-.fi
-.SH DESCRIPTION
-.I Access
-checks the given
-file
-.I path
-for accessibility according to
-.IR mode ,
-which is the bitwise inclusive OR of the access permissions to be
-checked (R_OK for read permission, W_OK for write permission and X_OK
-for execute/search permission) or the existence test, F_OK.
-Specifying
-.I mode
-as F_OK tests whether the directories leading to the file can be
-searched and the file exists.
-.PP
-The real user ID and the group access list
+.\"     @(#)access.2   6.7 (Berkeley) %G%
+.\"
+.Dd 
+.Dt ACCESS 2
+.Os BSD 4
+.Sh NAME
+.Nm access
+.Nd check access permissions of a file or pathname
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn access "const char *path" "int mode"
+.Sh DESCRIPTION
+The
+.Fn access
+function checks the accessibility of the
+file named by
+.Fa path
+for the access permissions indicated by
+.Fa mode .
+The value of
+.Fa mode
+is the bitwise inclusive OR of the access permissions to be
+checked
+.Pf ( Dv R_OK
+for read permission,
+.Dv W_OK
+for write permission and
+.Dv X_OK
+for execute/search permission) or the existence test,
+.Dv F_OK .
+All components of the pathname
+.Fa path
+are checked for access permissions (including
+.Dv F_OK ) .
+.Pp
+The real user ID is used in place of the effective user ID
+and the real group access list
 (including the real group ID) are
 (including the real group ID) are
-used in verifying permission, so this call
-is useful to set-UID programs.
-.PP
-Notice that only access bits are checked.
-A directory may be indicated as writable by
-.IR access ,
-but an attempt to open it for writing will fail
-(although files may be created there);
-a file may look executable, but
-.I execve
-will fail unless it is in proper format.
-.SH "RETURN VALUE
+used in place of the effective ID for verifying permission.
+.Pp
+Even if a process has appropriate privileges and indicates success for
+.Dv X_OK ,
+the file may not actually have execute permission bits set.
+Likewise for
+.Dv R_OK
+and
+.Dv W_OK .
+.Sh RETURN VALUES
 If
 If
-.I path
+.Fa path
 cannot be found or if any of the desired access modes would
 cannot be found or if any of the desired access modes would
-not be granted, then a \-1 value is returned; otherwise
+not be granted, then a -1 value is returned; otherwise
 a 0 value is returned.
 a 0 value is returned.
-.SH "ERRORS
-Access to the file is denied if one or more of the following are true:
-.TP 15
-[ENOTDIR]
+.SERRORS
+Access to the file is denied if:
+.Bl -tag -width Er
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named file does not exist.
 The named file does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 Write access is requested for a file on a read-only file system.
 Write access is requested for a file on a read-only file system.
-.TP 15
-[ETXTBSY]
+.It Bq Er ETXTBSY
 Write access is requested for a pure procedure (shared text)
 Write access is requested for a pure procedure (shared text)
-file that is being executed.
-.TP 15
-[EACCES]
+file presently being executed.
+.It Bq Er EACCES
 Permission bits of the file mode do not permit the requested
 access, or search permission is denied on a component of the
 path prefix.  The owner of a file has permission checked with
 Permission bits of the file mode do not permit the requested
 access, or search permission is denied on a component of the
 path prefix.  The owner of a file has permission checked with
@@ -91,12 +87,20 @@ members of the file's group other than the owner have permission
 checked with respect to the ``group'' mode bits, and all
 others have permissions checked with respect to the ``other''
 mode bits.
 checked with respect to the ``group'' mode bits, and all
 others have permissions checked with respect to the ``other''
 mode bits.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.SH "SEE ALSO
-chmod(2), stat(2)
+.El
+.Sh SEE ALSO
+.Xr chmod 2 ,
+.Xr stat 2
+.Sh STANDARDS
+.Fn Access
+conforms to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
+.Sh CAVEAT
+.Fn Access
+is a potential security hole and
+should never be used.
index 76ccf91..ef0e384 100644 (file)
@@ -1,84 +1,89 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)acct.2      6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH ACCT 2 ""
-.UC 4
-.SH NAME
-acct \- turn accounting on or off
-.SH SYNOPSIS
-.nf
-.ft B
-acct(file)
-char *file;
-.ft R
-.fi
-.SH DESCRIPTION
-The system is prepared to write a record
-in an accounting
-.I file
-for each process as it terminates.
-This
-call, with a null-terminated string naming an existing file
-as argument, turns on accounting;
-records for each terminating process are appended to
-.IR file .
-An argument of 0 causes accounting to be turned off.
-.PP
-The accounting file format is given in
-.IR acct (5).
-.PP
+.\"     @(#)acct.2     6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt ACCT 2
+.Os BSD 4
+.Sh NAME
+.Nm acct
+.Nd enable or disable process accounting
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn acct "const char *file"
+.Sh DESCRIPTION
+The
+.Fn acct
+call enables or disables the collection of system accounting
+records.
+If the argument
+.Fa file
+is a nil pointer, accounting is disabled.
+If
+.Fa file
+is an
+.Em existing
+pathname (null-terminated), record collection is enabled and for 
+every process initiated which terminates under normal
+conditions an accounting record is appended to
+.Fa file .
+Abnormal conditions of termination are reboots
+or other fatal system problems.
+Records for processes which never terminate can not be
+produced by
+.Fn acct .
+.Pp
+For more information on the record structure used by
+.Fn acct ,
+see
+.Pa /usr/include/sys/acct.h
+and
+.Xr acct 5 .
+.Pp
 This call is permitted only to the super-user.
 This call is permitted only to the super-user.
-.SH NOTES
+.Sh NOTES
 Accounting is automatically disabled when the file system the
 accounting file resides on runs out of space; it is enabled when
 space once again becomes available.
 Accounting is automatically disabled when the file system the
 accounting file resides on runs out of space; it is enabled when
 space once again becomes available.
-.SH "RETURN VALUE
-On error \-1 is returned.
+.Sh RETURN VALUES
+On error -1 is returned.
 The file must exist and the call may be exercised only by the super-user.
 The file must exist and the call may be exercised only by the super-user.
-It is erroneous to try to turn on accounting when it is already on.
-.SH ERRORS
-.I Acct
+.Sh ERRORS
+.Fn Acct
 will fail if one of the following is true:
 will fail if one of the following is true:
-.TP 15
-[EPERM]
+.Bl -tag -width Er
+.It Bq Er EPERM
 The caller is not the super-user.
 The caller is not the super-user.
-.TP 15
-[ENOTDIR]
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named file does not exist.
 The named file does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix,
 or the path name is not a regular file.
 Search permission is denied for a component of the path prefix,
 or the path name is not a regular file.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The named file resides on a read-only file system.
 The named file resides on a read-only file system.
-.TP 15
-[EFAULT]
-.I File
+.It Bq Er EFAULT
+.Fa File
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.SH "SEE ALSO"
-acct(5), sa(8)
-.SH BUGS
-No accounting is produced for programs running
-when a crash occurs.
-In particular non-terminating programs are never
-accounted for.
+.El
+.Sh SEE ALSO
+.Xr acct 5 ,
+.Xr sa 8
+.Sh HISTORY
+An
+.Nm
+function call appeared in Version 7 AT&T UNIX.
index 5d50af5..38dfbe5 100644 (file)
@@ -1,68 +1,85 @@
-.\" Copyright (c) 1980 Regents of the University of California.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)adjtime.2   1.6 (Berkeley) %G%
+.\"     @(#)adjtime.2  1.7 (Berkeley) %G%
 .\"
 .\"
-.TH ADJTIME 2 ""
-.UC 6
-.SH NAME
-adjtime \- correct the time to allow synchronization of the system clock
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/time.h>
-.PP
-.ft B
-adjtime(delta, olddelta)
-struct timeval *delta; 
-struct timeval *olddelta;
-.fi
-.SH DESCRIPTION
-.I Adjtime
+.Dd 
+.Dt ADJTIME 2
+.Os BSD 4.3
+.Sh NAME
+.Nm adjtime
+.Nd "correct the time to allow synchronization of the system clock"
+.Sh SYNOPSIS
+.Fd #include <sys/time.h>
+.Ft int
+.Fn adjtime "struct timeval *delta" "struct timeval *olddelta"
+.Sh DESCRIPTION
+.Fn Adjtime
 makes small adjustments to the system time, as returned by
 makes small adjustments to the system time, as returned by
-.IR gettimeofday (2),
+.Xr gettimeofday 2 ,
 advancing or retarding it
 by the time specified by the timeval
 advancing or retarding it
 by the time specified by the timeval
-\fIdelta\fP.
-If \fIdelta\fP is negative, the clock is
+.Fa delta .
+If
+.Fa delta
+is negative, the clock is
 slowed down by incrementing it more slowly than normal until
 the correction is complete.
 slowed down by incrementing it more slowly than normal until
 the correction is complete.
-If \fIdelta\fP is positive, a larger increment than normal
+If
+.Fa delta
+is positive, a larger increment than normal
 is used.
 The skew used to perform the correction is generally a fraction of one percent.
 Thus, the time is always
 a monotonically increasing function.
 is used.
 The skew used to perform the correction is generally a fraction of one percent.
 Thus, the time is always
 a monotonically increasing function.
-A time correction from an earlier call to \fIadjtime\fP
-may not be finished when \fIadjtime\fP is called again.
-If \fIolddelta\fP is non-zero,
-then the structure pointed to will contain, upon return, the
+A time correction from an earlier call to
+.Fn adjtime
+may not be finished when
+.Fn adjtime
+is called again.
+If
+.Fa olddelta
+is non-nil,
+the structure pointed to will contain, upon return, the
 number of microseconds still to be corrected
 from the earlier call.
 number of microseconds still to be corrected
 from the earlier call.
-.PP
+.Pp
 This call may be used by time servers that synchronize the clocks
 of computers in a local area network.
 Such time servers would slow down the clocks of some machines
 and speed up the clocks of others to bring them to the average network time.
 This call may be used by time servers that synchronize the clocks
 of computers in a local area network.
 Such time servers would slow down the clocks of some machines
 and speed up the clocks of others to bring them to the average network time.
-.PP
+.Pp
 The call 
 The call 
-.IR adjtime (2)
+.Fn adjtime
 is restricted to the super-user.
 is restricted to the super-user.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 A return value of 0 indicates that the call succeeded.
 A return value of 0 indicates that the call succeeded.
-A return value of \-1 indicates that an error occurred, and in this
-case an error code is stored in the global variable \fIerrno\fP.
-.SH "ERRORS
-The following error codes may be set in \fIerrno\fP:
-.TP 15
-[EFAULT]
+A return value of -1 indicates that an error occurred, and in this
+case an error code is stored in the global variable
+.Va errno .
+.Sh ERRORS
+.Fn Adjtime
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EFAULT
 An argument points outside the process's allocated address space.
 An argument points outside the process's allocated address space.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The process's effective user ID is not that of the super-user.
 The process's effective user ID is not that of the super-user.
-.SH "SEE ALSO"
-date(1), gettimeofday(2), timed(8), timedc(8),
-.br
-\fITSP: The Time Synchronization Protocol for UNIX 4.3BSD\fP, 
-R. Gusella and S. Zatti
+.El
+.Sh SEE ALSO
+.Xr date 1 ,
+.Xr gettimeofday 2 ,
+.Xr timed 8 ,
+.Xr timedc 8 ,
+.Rs
+.%T "TSP: The Time Synchronization Protocol for UNIX 4.3BSD"
+.%A R. Gusella
+.%A S. Zatti
+.Re
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.3 .
index 1336c2b..890404b 100644 (file)
@@ -3,99 +3,98 @@
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)bind.2      6.8 (Berkeley) %G%
+.\"     @(#)bind.2     6.9 (Berkeley) %G%
 .\"
 .\"
-.TH BIND 2 ""
-.UC 5
-.SH NAME
-bind \- bind a name to a socket
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/socket.h>
-.PP
-.ft B
-bind(s, name, namelen)
-int s;
-struct sockaddr *name;
-int namelen;
-.fi
-.SH DESCRIPTION
-.I Bind
+.Dd 
+.Dt BIND 2
+.Os BSD 4.2
+.Sh NAME
+.Nm bind
+.Nd bind a name to a socket
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/socket.h>
+.Ft int
+.Fn bind "int s" "struct sockaddr *name" "int namelen"
+.Sh DESCRIPTION
+.Fn Bind
 assigns a name to an unnamed socket.
 When a socket is created 
 with
 assigns a name to an unnamed socket.
 When a socket is created 
 with
-.IR socket (2)
+.Xr socket 2
 it exists in a name space (address family)
 but has no name assigned.
 it exists in a name space (address family)
 but has no name assigned.
-.I Bind
+.Fn Bind
 requests that
 requests that
-.IR name 
+.Fa name
 be assigned to the socket.
 be assigned to the socket.
-.SH NOTES
+.Sh NOTES
 Binding a name in the UNIX domain creates a socket in the file
 system that must be deleted by the caller when it is no longer
 needed (using
 Binding a name in the UNIX domain creates a socket in the file
 system that must be deleted by the caller when it is no longer
 needed (using
-.IR unlink (2)).
-.PP
+.Xr unlink 2 ) .
+.Pp
 The rules used in name binding vary between communication domains.
 Consult the manual entries in section 4 for detailed information.
 The rules used in name binding vary between communication domains.
 Consult the manual entries in section 4 for detailed information.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 If the bind is successful, a 0 value is returned.
 If the bind is successful, a 0 value is returned.
-A return value of \-1 indicates an error, which is
-further specified in the global \fIerrno\fP.
-.SH ERRORS
-The \fIbind\fP call will fail if:
-.TP 20
-[EBADF]
-\fIS\fP is not a valid descriptor.
-.TP 20
-[ENOTSOCK]
-\fIS\fP is not a socket.
-.TP 20
-[EADDRNOTAVAIL]
+A return value of -1 indicates an error, which is
+further specified in the global
+.Va errno .
+.Sh ERRORS
+The
+.Fn bind
+call will fail if:
+.Bl -tag -width EADDRNOTAVA
+.It Bq Er EBADF
+.Fa S
+is not a valid descriptor.
+.It Bq Er ENOTSOCK
+.Fa S
+is not a socket.
+.It Bq Er EADDRNOTAVAIL
 The specified address is not available from the local machine.
 The specified address is not available from the local machine.
-.TP 20
-[EADDRINUSE]
+.It Bq Er EADDRINUSE
 The specified address is already in use.
 The specified address is already in use.
-.TP 20
-[EINVAL]
+.It Bq Er EINVAL
 The socket is already bound to an address.
 The socket is already bound to an address.
-.TP 20
-[EACCES]
+.It Bq Er EACCES
 The requested address is protected, and the current user
 has inadequate permission to access it.
 The requested address is protected, and the current user
 has inadequate permission to access it.
-.TP 20
-[EFAULT]
-The \fIname\fP parameter is not in a valid part of the user
+.It Bq Er EFAULT
+The
+.Fa name
+parameter is not in a valid part of the user
 address space.
 address space.
-.PP
+.El
+.Pp
 The following errors are specific to binding names in the UNIX domain.
 The following errors are specific to binding names in the UNIX domain.
-.TP 15
-[ENOTDIR]
+.Bl -tag -width EADDRNOTAVA
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 A prefix component of the path name does not exist.
 A prefix component of the path name does not exist.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while making the directory entry or allocating the inode.
 An I/O error occurred while making the directory entry or allocating the inode.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The name would reside on a read-only file system.
 The name would reside on a read-only file system.
-.TP 15
-[EISDIR]
-A null pathname was specified.
-.SH SEE ALSO
-connect(2), listen(2), socket(2), getsockname(2)
+.It Bq Er EISDIR
+An empty pathname was specified.
+.El
+.Sh SEE ALSO
+.Xr connect 2 ,
+.Xr listen 2 ,
+.Xr socket 2 ,
+.Xr getsockname 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index b85991d..d6e48d5 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)brk.2       6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH BRK 2 ""
-.UC 4
-.SH NAME
-brk, sbrk \- change data segment size
-.SH SYNOPSIS
-.nf
-#include <sys/types.h>
-.PP
-.ft B
-char *brk(addr)
-char *addr;
-.PP
-.ft B
-char *sbrk(incr)
-int incr;
-.fi
-.SH DESCRIPTION
-.I Brk
-sets the system's idea of the lowest data segment 
-location not used by the program (called the break)
-to
-.I addr
-(rounded up to the next multiple of the system's page size).
-Locations greater than
-.I addr
-and below the stack pointer
-are not in the address space and will thus
-cause a memory violation if accessed.
-.PP
-In the alternate function
-.IR sbrk ,
-.I incr
-more bytes are added to the
-program's data space and a pointer to the
-start of the new area is returned.
-.PP
-When a program begins execution via
-.I execve
-the break is set at the
-highest location defined by the program
-and data storage areas.
-Ordinarily, therefore, only programs with growing
-data areas need to use
-.IR sbrk .
-.PP
+.\"     @(#)brk.2      6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt BRK 2
+.Os BSD 4
+.Sh NAME
+.Nm brk ,
+.Nm sbrk
+.Nd change data segment size
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Ft char
+.Fn *brk "const char *addr"
+.Ft char *
+.Fn *sbrk "int incr"
+.Sh DESCRIPTION
+.Bf -symbolic
+The brk and sbrk functions are historical curiosities
+left over from earlier days before the advent of virtual memory management.
+.Ef
+The
+.Fn brk
+function
+sets the break or lowest address
+of a process's data segment (unilitialized data) to
+.Fa addr
+(immediately above bss).
+Data addressing is restricted between
+.Fa addr
+and the lowest stack pointer to the stack segment.
+Memory is allocated by
+.Fa brk
+in page size pieces;
+if
+.Fa addr
+is not evenly divisible by the system page size, it is
+increased to the next page boundary.
+.Pp
+.\" The
+.\" .Nm sbrk
+.\" function
+.\" allocates chunks of
+.\" .Fa incr
+.\" bytes
+.\" to the process's data space
+.\" and returns an address pointer.
+.\" The
+.\" .Xr malloc 3
+.\" function utilizes
+.\" .Nm sbrk .
+.\" .Pp
 The current value of the program break is reliably returned by
 The current value of the program break is reliably returned by
-``sbrk(0)'' (see also 
-.IR end (3)).
+.Dq Li sbrk(0)
+(see also 
+.Xr end 3 ) .
 The
 The
-.IR getrlimit (2)
+.Xr getrlimit 2
 system call may be used to determine
 the maximum permissible size of the
 system call may be used to determine
 the maximum permissible size of the
-.I data
+.Em data
 segment;
 it will not be possible to set the break
 beyond the
 segment;
 it will not be possible to set the break
 beyond the
-.I rlim_max
+.Em rlim_max
 value returned from a call to
 value returned from a call to
-.IR getrlimit ,
-e.g. \*(lqetext + rlp\(->rlim_max.\*(rq
+.Xr getrlimit ,
+e.g.
+.Dq qetext + rlp\(->rlim_max.
 (see
 (see
-.IR end (3)
+.Xr end 3
 for the definition of
 for the definition of
-.IR etext ).
-.SH "RETURN VALUE
-Zero is returned if the 
-.I brk
-could be set;
-\-1 if the program requests more
-memory than the system limit.
-.I Sbrk
-returns \-1 if the break could not be set.
-.SH ERRORS
-.I Sbrk
-will fail and no additional memory will be allocated if
-one of the following are true:
-.TP 15
-[ENOMEM]
-The limit, as set by
-.IR setrlimit (2),
-was exceeded.
-.TP 15
-[ENOMEM]
-The maximum possible size of a data segment (compiled into the
-system) was exceeded.
-.TP 15
-[ENOMEM]
-Insufficient space existed in the swap area
-to support the expansion.
-.SH "SEE ALSO"
-execve(2), getrlimit(2), malloc(3), end(3)
-.SH BUGS
+.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.
+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 [ENOMEM]
+.\" .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 ,
+.Xr malloc 3 ,
+.Xr end 3
+.Sh BUGS
 Setting the break may fail due to a temporary lack of
 swap space.  It is not possible to distinguish this
 from a failure caused by exceeding the maximum size of
 the data segment without consulting 
 Setting the break may fail due to a temporary lack of
 swap space.  It is not possible to distinguish this
 from a failure caused by exceeding the maximum size of
 the data segment without consulting 
-.IR getrlimit .
+.Xr getrlimit .
+.Sh HISTORY
+A
+.Nm
+function call appeared in Version 7 AT&T UNIX.
index 49b0e8a..f68f051 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)chdir.2     6.6 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH CHDIR 2 ""
-.UC 4
-.SH NAME
-chdir, fchdir \- change current working directory
-.SH SYNOPSIS
-.nf
-.ft B
-chdir(path)
-char *path;
-.ft R
-.fi
-.LP
-.nf
-.ft B
-fchdir(fd)
-int fd;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Path
-is the pathname of a directory.
-.I Chdir
-causes this directory
-to become the current working directory,
-the starting point for path names not beginning with ``/''.
-.PP
-.I Fchdir
+.\"     @(#)chdir.2    6.7 (Berkeley) %G%
+.\"
+.Dd 
+.Dt CHDIR 2
+.Os BSD 4
+.Sh NAME
+.Nm chdir ,
+.Nm fchdir
+.Nd change current working directory
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn chdir "const char *path"
+.Ft int
+.Fn fchdir "int fd"
+.Sh DESCRIPTION
+The
+.Fa path
+arument points to the pathname of a directory.
+The
+.Fn chdir
+function
+causes the named directory
+to become the current working directory, that is,
+the starting point for path searches of pathnames not beginning with
+a slash,
+.Ql / .
+.Pp
+The
+.Fn fchdir
+function
 causes the directory referenced by
 causes the directory referenced by
-.I fd
+.Fa fd
 to become the current working directory,
 to become the current working directory,
-the starting point for path names not beginning with ``/''.
-.PP
+the starting point for path searches of pathnames not beginning with
+a slash,
+.Ql / .
+.Pp
 In order for a directory to become the current directory,
 a process must have execute (search) access to the directory.
 In order for a directory to become the current directory,
 a process must have execute (search) access to the directory.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Upon successful completion, a value of 0 is returned.
-Otherwise, a value of \-1 is returned and \fIerrno\fP is set to indicate
+Otherwise, a value of -1 is returned and
+.Va errno
+is set to indicate
 the error.
 the error.
-.SH ERRORS
-.I Chdir
+.Sh ERRORS
+.Fn Chdir
 will fail and the current working directory will be unchanged if
 one or more of the following are true:
 will fail and the current working directory will be unchanged if
 one or more of the following are true:
-.TP 15
-[ENOTDIR]
+.Bl -tag -width Er
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named directory does not exist.
 The named directory does not exist.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for any component of
 the path name.
 Search permission is denied for any component of
 the path name.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.LP
-.I Fchdir
+.El
+.Pp
+.Fn Fchdir
 will fail and the current working directory will be unchanged if
 one or more of the following are true:
 will fail and the current working directory will be unchanged if
 one or more of the following are true:
-.TP 15
-[EACCES]
+.Bl -tag -width Er
+.It Bq Er EACCES
 Search permission is denied for the directory referenced by the
 file descriptor.
 Search permission is denied for the directory referenced by the
 file descriptor.
-.TP 15
-[ENOTDIR]
+.It Bq Er ENOTDIR
 The file descriptor does not reference a directory.
 The file descriptor does not reference a directory.
-.TP 15
-EBADF
+.It Bq Er EBADF
 The argument
 The argument
-.I fd
+.Fa fd
 is not a valid file descriptor.
 is not a valid file descriptor.
-.SH "SEE ALSO"
-chroot(2)
+.El
+.Sh SEE ALSO
+.Xr chroot 2
+.Sh STANDARDS
+.Fn Chdir
+is expected to conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
+.Sh HISTORY
+The
+.Fn fchdir
+function call
+appeared in
+.Bx 4.2 .
index 032c351..b962391 100644 (file)
@@ -3,96 +3,89 @@
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)chflags.2   6.3 (Berkeley) %G%
+.\"     @(#)chflags.2  6.4 (Berkeley) %G%
 .\"
 .\"
-.TH CHFALGS 2 ""
-.UC 7
-.SH NAME
-chflags, fchflags \- set file flags
-.SH SYNOPSIS
-.nf
-.ft B
-chflags(path, flags)
-char *path;
-long flags;
-.LP
-.ft B
-fchflags(fd, flags)
-int fd;
-long flags;
-.fi
-.ft R
-.SH DESCRIPTION
+.Dd 
+.Dt CHFALGS 2
+.Os BSD 4.4
+.Sh NAME
+.Nm chflags ,
+.Nm fchflags
+.Nd set file flags
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn chflags "const char *path"  "long flags"
+.Ft int
+.Fn fchflags "int fd" "long flags"
+.Sh DESCRIPTION
 The file whose name
 The file whose name
-is given by \fIpath\fP
+is given by
+.Fa path
 or referenced by the descriptor
 or referenced by the descriptor
-.I fd
+.Fa fd
 has its flags changed to
 has its flags changed to
-.IR flags .
-.PP
+.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.
 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.
-.SH RETURN VALUE
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Upon successful completion, a value of 0 is returned.
-Otherwise, \-1 is returned and the global variable
-.I errno
+Otherwise, -1 is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Chflags
-fails if one or more of the following are true:
-.TP 15
-[ENOTDIR]
+.Sh ERRORS
+.Fn Chflags
+fails if:
+.Bl -tag -width Er
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named file does not exist.
 The named file does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The effective user ID does not match the owner of the file and
 the effective user ID is not the super-user.
 The effective user ID does not match the owner of the file and
 the effective user ID is not the super-user.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The named file resides on a read-only file system.
 The named file resides on a read-only file system.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.PP
-.I Fchflags
+.El
+.Pp
+.Fn Fchflags
 will fail if:
 will fail if:
-.TP 15
-[EBADF]
+.Bl -tag -width Er
+.It Bq Er EBADF
 The descriptor is not valid.
 The descriptor is not valid.
-.TP 15
-[EINVAL]
-.I Fd
+.It Bq Er EINVAL
+.Fa Fd
 refers to a socket, not to a file.
 refers to a socket, not to a file.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The effective user ID does not match the owner of the file and
 the effective user ID is not the super-user.
 The effective user ID does not match the owner of the file and
 the effective user ID is not the super-user.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The file resides on a read-only file system.
 The file resides on a read-only file system.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.SH "SEE ALSO"
-chmod(2), open(2), chown(2), stat(2)
+.El
+.Sh SEE ALSO
+.Xr chmod 2 ,
+.Xr open 2 ,
+.Xr chown 2 ,
+.Xr stat 2
+.Sh HISTORY
+The
+.Nm
+function call is currently under development.
index 62c013a..b21c814 100644 (file)
@@ -1,65 +1,89 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)chmod.2     6.5 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH CHMOD 2 ""
-.UC 4
-.SH NAME
-chmod \- change mode of file
-.SH SYNOPSIS
-.nf
-.ft B
-chmod(path, mode)
-char *path;
-int mode;
-.PP
-.ft B
-fchmod(fd, mode)
-int fd, mode;
-.fi
-.SH DESCRIPTION
-The file whose name
-is given by \fIpath\fP
-or referenced by the descriptor
-.I fd
-has its mode changed to
-.IR mode .
-Modes are constructed by
-.IR or 'ing
-together some
-combination of the following, defined in
-.IR <sys/inode.h> :
-.PP
-.RS
-.nf
-.ta \w'IWRITE\ \ 'u +\w'04000\ \ \ 'u
-ISUID  04000   set user ID on execution
-ISGID  02000   set group ID on execution
-ISVTX  01000   `sticky bit' (see below)
-IREAD  00400   read by owner
-IWRITE 00200   write by owner
-IEXEC  00100   execute (search on directory) by owner
-       00070   read, write, execute (search) by group
-       00007   read, write, execute (search) by others
-.fi
-.RE
-.PP
-If an executable file is set up for sharing (this is the default)
-then mode ISVTX (the `sticky bit') prevents the system from
-abandoning the swap-space image of the program-text portion
-of the file when its last user terminates.
-Ability to set this bit on executable files is restricted to the super-user.
-.PP
-If mode ISVTX (the `sticky bit') is set on a directory,
+.\"     @(#)chmod.2    6.6 (Berkeley) %G%
+.\"
+.Dd 
+.Dt CHMOD 2
+.Os BSD 4
+.Sh NAME
+.Nm chmod ,
+.Nm fchmod
+.Nd change mode of file
+.Sh SYNOPSIS
+.Fd #include <sys/stat.h>
+.Ft int
+.Fn chmod "const char *path" "mode_t mode"
+.Ft int
+.Fn fchmod "int fd" "mode_t mode"
+.Sh DESCRIPTION
+The function
+.Fn chmod
+sets the file permission bits
+of the file
+specified by the pathname
+.Fa path
+to
+.Fa mode .
+.Fn Fchmod
+sets the permission bits of the specified
+file descriptor
+.Fa fd .
+.Fn Chmod
+verifies that the process owner (user) either owns
+the file specified by
+.Fa path
+(or
+.Fa fd ) ,
+or
+is the super-user.
+A mode is created from
+.Em or'd
+permission bit masks
+defined in
+.Aq Pa sys/stat.h :
+.Bd -literal -offset indent -compact
+#define S_IRWXU 0000700    /* RWX mask for owner */
+#define S_IRUSR 0000400    /* R for owner */
+#define S_IWUSR 0000200    /* W for owner */
+#define S_IXUSR 0000100    /* X for owner */
+
+#define S_IRWXG 0000070    /* RWX mask for group */
+#define S_IRGRP 0000040    /* R for group */
+#define S_IWGRP 0000020    /* W for group */
+#define S_IXGRP 0000010    /* X for group */
+
+#define S_IRWXO 0000007    /* RWX mask for other */
+#define S_IROTH 0000004    /* R for other */
+#define S_IWOTH 0000002    /* W for other */
+#define S_IXOTH 0000001    /* X for other */
+
+#define S_ISUID 0004000    /* set user id on execution */
+#define S_ISGID 0002000    /* set group id on execution */
+#define S_ISVTX 0001000    /* save swapped text even after use */
+.Ed
+.Pp
+The
+.Dv ISVTX
+(the
+.Em sticky bit )
+indicates to the system which executable files are shareable (the
+default) and the system maintains the program text of the files
+in the swap area. The sticky bit may only be set by the super user
+on shareable executable files.
+.Pp
+If mode
+.Dv ISVTX
+(the `sticky bit') is set on a directory,
 an unprivileged user may not delete or rename
 an unprivileged user may not delete or rename
-files of other users in that directory.
+files of other users in that directory. The sticky bit may be
+set by any user on a directory which the user owns or has appropriate
+permissions.
 For more details of the properties of the sticky bit, see
 For more details of the properties of the sticky bit, see
-.IR sticky (8).
-.PP
-Only the owner of a file (or the super-user) may change the mode.
-.PP
+.Xr sticky 8 .
+.Pp
 Writing or changing the owner of a file
 turns off the set-user-id and set-group-id bits
 unless the user is the super-user.
 Writing or changing the owner of a file
 turns off the set-user-id and set-group-id bits
 unless the user is the super-user.
@@ -67,62 +91,66 @@ This makes the system somewhat more secure
 by protecting set-user-id (set-group-id) files
 from remaining set-user-id (set-group-id) if they are modified,
 at the expense of a degree of compatibility.
 by protecting set-user-id (set-group-id) files
 from remaining set-user-id (set-group-id) if they are modified,
 at the expense of a degree of compatibility.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Upon successful completion, a value of 0 is returned.
-Otherwise, a value of \-1 is returned and
-.I errno
+Otherwise, a value of -1 is returned and
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH "ERRORS
-.I Chmod
+.SERRORS
+.Fn Chmod
 will fail and the file mode will be unchanged if:
 will fail and the file mode will be unchanged if:
-.TP 15
-[ENOTDIR]
+.Bl -tag -width Er
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named file does not exist.
 The named file does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The effective user ID does not match the owner of the file and
 the effective user ID is not the super-user.
 The effective user ID does not match the owner of the file and
 the effective user ID is not the super-user.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The named file resides on a read-only file system.
 The named file resides on a read-only file system.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.PP
-.I Fchmod
+.El
+.Pp
+.Fn Fchmod
 will fail if:
 will fail if:
-.TP 15
-[EBADF]
+.Bl -tag -width Er
+.It Bq Er EBADF
 The descriptor is not valid.
 The descriptor is not valid.
-.TP 15
-[EINVAL]
-.I Fd
+.It Bq Er EINVAL
+.Fa Fd
 refers to a socket, not to a file.
 refers to a socket, not to a file.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The file resides on a read-only file system.
 The file resides on a read-only file system.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.SH "SEE ALSO"
-chmod(1), open(2), chown(2), stat(2), sticky(8)
+.El
+.Sh SEE ALSO
+.Xr chmod 1 ,
+.Xr open 2 ,
+.Xr chown 2 ,
+.Xr stat 2 ,
+.Xr sticky 8
+.Sh STANDARDS
+.Fn Chmod
+is expected to conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
+.Sh HISTORY
+The
+.Fn fchmod
+function call
+appeared in
+.Bx 4.2 .
index 5236170..5d653d9 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)chown.2     6.6 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH CHOWN 2 ""
-.UC 4
-.SH NAME
-chown \- change owner and group of a file
-.SH SYNOPSIS
-.nf
-.ft B
-chown(path, owner, group)
-char *path;
-int owner, group;
-.PP
-.ft B
-fchown(fd, owner, group)
-int fd, owner, group;
-.fi
-.SH DESCRIPTION
-The file
-that is named by \fIpath\fP or referenced by \fIfd\fP
-has its
-.I owner
+.\"     @(#)chown.2    6.7 (Berkeley) %G%
+.\"
+.Dd 
+.Dt CHOWN 2
+.Os BSD 4
+.Sh NAME
+.Nm chown ,
+.Nm fchown
+.Nd change owner and group of a file
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn chown "const char *path" "uid_t owner" "gid_t group"
+.Ft int
+.Fn fchown "int fd" "int owner" "int group"
+.Sh DESCRIPTION
+The owner ID and group ID of the file
+named by
+.Fa path
+or referenced by
+.Fa fd
+is changed as specified by the arguments
+.Fa owner
 and 
 and 
-.I group
-changed as specified.
-Only the super-user
-may change the owner of the file,
-because if users were able to give files away,
-they could defeat the file-space accounting procedures.
-The owner of the file may change the group
-to a group of which he is a member.
-.PP
-On some systems,
-.I chown
+.Fa group .
+The owner of a file may change the
+.Fa group
+to a group of which
+he or she is a member,
+but the change
+.Fa owner
+capability is restricted to the super-user.
+.Pp
+.Fn Chown
 clears the set-user-id and set-group-id bits
 on the file
 clears the set-user-id and set-group-id bits
 on the file
-to prevent accidental creation of
+to prevent accidental or mischievious creation of
 set-user-id and set-group-id programs.
 set-user-id and set-group-id programs.
-.PP
-.I Fchown
+.Pp
+.Fn Fchown
 is particularly useful when used in conjunction
 with the file locking primitives (see
 is particularly useful when used in conjunction
 with the file locking primitives (see
-.IR flock (2)).
-.PP
+.Xr flock 2 ) .
+.Pp
 One of the owner or group id's
 One of the owner or group id's
-may be left unchanged by specifying it as \-1.
-.PP
+may be left unchanged by specifying it as -1.
+.Pp
 If the final component of
 If the final component of
-.I path
+.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.
 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 VALUE
+.Sh RETURN VALUES
 Zero is returned if the operation was successful;
 Zero is returned if the operation was successful;
-\-1 is returned if an error occurs, with a more specific
-error code being placed in the global variable \fIerrno\fP.
-.SH "ERRORS
-.I Chown
+-1 is returned if an error occurs, with a more specific
+error code being placed in the global variable
+.Va errno .
+.Sh ERRORS
+.Fn Chown
 will fail and the file will be unchanged if:
 will fail and the file will be unchanged if:
-.TP 15
-[ENOTDIR]
+.Bl -tag -width Er
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named file does not exist.
 The named file does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The effective user ID is not the super-user.
 The effective user ID is not the super-user.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The named file resides on a read-only file system.
 The named file resides on a read-only file system.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.PP
-.I Fchown
+.El
+.Pp
+.Fn Fchown
 will fail if:
 will fail if:
-.TP 15
-[EBADF]
-.I Fd
+.Bl -tag -width Er
+.It Bq Er EBADF
+.Fa Fd
 does not refer to a valid descriptor.
 does not refer to a valid descriptor.
-.TP 15
-[EINVAL]
-.I Fd
+.It Bq Er EINVAL
+.Fa Fd
 refers to a socket, not a file.
 refers to a socket, not a file.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The effective user ID is not the super-user.
 The effective user ID is not the super-user.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The named file resides on a read-only file system.
 The named file resides on a read-only file system.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.SH "SEE ALSO"
-chown(8), chgrp(1), chmod(2), flock(2)
+.El
+.Sh SEE ALSO
+.Xr chown 8 ,
+.Xr chgrp 1 ,
+.Xr chmod 2 ,
+.Xr flock 2
+.Sh STANDARDS
+.Fn Chown
+is expected to conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
+.Sh HISTORY
+The
+.Fn fchown
+function call
+appeared in
+.Bx 4.2 .
index 3b5bfb7..d8d2fa5 100644 (file)
@@ -1,68 +1,71 @@
-.\" Copyright (c) 1983 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1983, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)chroot.2    6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH CHROOT 2 ""
-.UC 5
-.SH NAME
-chroot \- change root directory
-.SH SYNOPSIS
-.nf
-.ft B
-chroot(dirname)
-char *dirname;
-.ft R
-.fi
-.SH DESCRIPTION
-.I Dirname
-is the address of the pathname of a directory, terminated by a null byte.
-.I Chroot
-causes this directory
+.\"     @(#)chroot.2   6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt CHROOT 2
+.Os BSD 4.2
+.Sh NAME
+.Nm chroot
+.Nd change root directory
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn chroot "const char *dirname"
+.Sh DESCRIPTION
+.Fa Dirname
+is the address of the pathname of a directory, terminated by an ASCII NUL.
+.Fn Chroot
+causes
+.Fa dirname
 to become the root directory,
 to become the root directory,
-the starting point for path names beginning with ``/''.
-.PP
+that is, the starting point for path searches of pathnames
+beginning with
+.Ql / .
+.Pp
 In order for a directory to become the root directory
 In order for a directory to become the root directory
-a process must have execute (search) access to the directory.
-.PP
+a process must have execute (search) access for that directory.
+.Pp
 It should be noted that
 It should be noted that
-.I chroot
+.Fn chroot
 has no effect on the process's current directory.
 has no effect on the process's current directory.
-.PP
+.Pp
 This call is restricted to the super-user.
 This call is restricted to the super-user.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.  Otherwise,
 Upon successful completion, a value of 0 is returned.  Otherwise,
-a value of \-1 is returned and \fIerrno\fP is set to indicate an error.
-.SH ERRORS
-.I Chroot
-will fail and the root directory will be unchanged if
-one or more of the following are true:
-.TP 15
-[ENOTDIR]
+a value of -1 is returned and
+.Va errno
+is set to indicate an error.
+.Sh ERRORS
+.Fn Chroot
+will fail and the root directory will be unchanged if:
+.Bl -tag -width [ENOTDIR]
+.It Bq Er ENOTDIR
 A component of the path name is not a directory.
 A component of the path name is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named directory does not exist.
 The named directory does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for any component of the path name.
 Search permission is denied for any component of the path name.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.SH "SEE ALSO"
-chdir(2)
+.El
+.Sh SEE ALSO
+.Xr chdir 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index d7324fb..40e4b73 100644 (file)
@@ -1,70 +1,94 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)close.2     6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH CLOSE 2 ""
-.UC 4
-.SH NAME
-close \- delete a descriptor
-.SH SYNOPSIS
-.B close(d)
-.br
-.B "int d;"
-.SH DESCRIPTION
+.\"     @(#)close.2    6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt CLOSE 2
+.Os BSD 4
+.Sh NAME
+.Nm close
+.Nd delete a descriptor
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn close "int d"
+.Sh DESCRIPTION
 The
 The
-\fIclose\fP call deletes a descriptor from the per-process object
+.Fn close
+call deletes a descriptor from the per-process object
 reference table.
 reference table.
-If this is the last reference to the underlying object, then
-it will be deactivated.
+If this is the last reference to the underlying object, the
+object will be deactivated.
 For example, on the last close of a file
 For example, on the last close of a file
-the current \fIseek\fP pointer associated with the file is lost;
+the current
+.Em seek
+pointer associated with the file is lost;
 on the last close of a
 on the last close of a
-.IR socket (2)
+.Xr socket 2
 associated naming information and queued data are discarded;
 on the last close of a file holding an advisory lock
 the lock is released (see further
 associated naming information and queued data are discarded;
 on the last close of a file holding an advisory lock
 the lock is released (see further
-.IR flock (2)\fR).
-.PP
-A close of all of a process's descriptors is automatic on
-.IR exit ,
-but since
-there is a limit on the number of active descriptors per process,
-.I close
-is necessary for programs that deal with many descriptors.
-.PP
+.Xr flock 2 ) .
+.Pp
+When a process exits,
+all associated file descriptors are freed, but since there is
+a limit on active descriptors per processes, the
+.Fn close
+function call
+is useful when a large quanitity of file descriptors are being handled.
+.Pp
 When a process forks (see
 When a process forks (see
-.IR fork (2)),
+.Xr fork 2 ) ,
 all descriptors for the new child process reference the same
 objects as they did in the parent before the fork.
 If a new process is then to be run using
 all descriptors for the new child process reference the same
 objects as they did in the parent before the fork.
 If a new process is then to be run using
-.IR execve (2),
+.Xr execve 2 ,
 the process would normally inherit these descriptors.  Most
 of the descriptors can be rearranged with
 the process would normally inherit these descriptors.  Most
 of the descriptors can be rearranged with
-.IR dup2 (2)
+.Xr dup2 2
 or deleted with
 or deleted with
-.I close
+.Fn close
 before the
 before the
-.I execve
+.Xr execve
 is attempted, but if some of these descriptors will still
 be needed if the execve fails, it is necessary to arrange for them
 to be closed if the execve succeeds.
 is attempted, but if some of these descriptors will still
 be needed if the execve fails, it is necessary to arrange for them
 to be closed if the execve succeeds.
-For this reason, the call ``fcntl(d, F_SETFD, 1)'' is provided,
+For this reason, the call
+.Dq Li fcntl(d, F_SETFD, 1)
+is provided,
 which arranges that a descriptor will be closed after a successful
 which arranges that a descriptor will be closed after a successful
-execve; the call ``fcntl(d, F_SETFD, 0)'' restores the default,
+execve; the call
+.Dq Li fcntl(d, F_SETFD, 0)
+restores the default,
 which is to not close the descriptor.
 which is to not close the descriptor.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Upon successful completion, a value of 0 is returned.
-Otherwise, a value of \-1 is returned and the global integer variable
-.I errno
+Otherwise, a value of -1 is returned and the global integer variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Close
+.Sh ERRORS
+.Fn Close
 will fail if:
 will fail if:
-.TP 15
-[EBADF]
-\fID\fP is not an active descriptor.
-.SH "SEE ALSO"
-accept(2), flock(2), open(2), pipe(2), socket(2), socketpair(2),
-execve(2), fcntl(2)
+.Bl -tag -width Er
+.It Bq Er EBADF
+.Fa D
+is not an active descriptor.
+.It Bq Er EINTR
+An interupt was received.
+.El
+.Sh SEE ALSO
+.Xr accept 2 ,
+.Xr flock 2 ,
+.Xr open 2 ,
+.Xr pipe 2 ,
+.Xr socket 2 ,
+.Xr socketpair 2 ,
+.Xr execve 2 ,
+.Xr fcntl 2
+.Sh STANDARDS
+.Fn Close
+conforms to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index 1ac7136..b86c8e2 100644 (file)
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)connect.2   6.8 (Berkeley) %G%
+.\"     @(#)connect.2  6.9 (Berkeley) %G%
 .\"
 .\"
-.TH CONNECT 2 ""
-.UC 5
-.SH NAME
-connect \- initiate a connection on a socket
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/socket.h>
-.PP
-.ft B
-connect(s, name, namelen)
-int s;
-struct sockaddr *name;
-int namelen;
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt CONNECT 2
+.Os BSD 4.2
+.Sh NAME
+.Nm connect
+.Nd initiate a connection on a socket
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/socket.h>
+.Ft int
+.Fn connect "int s" "struct sockaddr *name" "int namelen"
+.Sh DESCRIPTION
 The parameter
 The parameter
-.I s
+.Fa s
 is a socket.
 is a socket.
-If it is of type SOCK_DGRAM,
-then this call specifies the peer with which the socket is to be associated;
+If it is of type
+.Dv SOCK_DGRAM ,
+this call specifies the peer with which the socket is to be associated;
 this address is that to which datagrams are to be sent,
 and the only address from which datagrams are to be received.
 this address is that to which datagrams are to be sent,
 and the only address from which datagrams are to be received.
-If the socket is of type SOCK_STREAM,
-then this call attempts to make a connection to
+If the socket is of type
+.Dv SOCK_STREAM ,
+this call attempts to make a connection to
 another socket.
 The other socket is specified by
 another socket.
 The other socket is specified by
-.I name,
+.Fa name ,
 which is an address in the communications space of the socket.
 Each communications space interprets the
 which is an address in the communications space of the socket.
 Each communications space interprets the
-.I name
+.Fa name
 parameter in its own way.
 Generally, stream sockets may successfully
 parameter in its own way.
 Generally, stream sockets may successfully
-.I connect
+.Fn connect
 only once; datagram sockets may use
 only once; datagram sockets may use
-.I connect
+.Fn connect
 multiple times to change their association.
 Datagram sockets may dissolve the association
 by connecting to an invalid address, such as a null address.
 multiple times to change their association.
 Datagram sockets may dissolve the association
 by connecting to an invalid address, such as a null address.
-.SH "RETURN VALUE
-If the connection or binding succeeds, then 0 is returned.
-Otherwise a \-1 is returned, and a more specific error
-code is stored in \fIerrno\fP.
-.SH "ERRORS
-The call fails if:
-.TP 20
-[EBADF]
-.I S
+.Sh RETURN VALUES
+If the connection or binding succeeds, 0 is returned.
+Otherwise a -1 is returned, and a more specific error
+code is stored in
+.Va errno .
+.Sh ERRORS
+The
+.Fn connect
+call fails if:
+.Bl -tag -width EADDRNOTAVAILABB
+.It Bq Er EBADF
+.Fa S
 is not a valid descriptor.
 is not a valid descriptor.
-.TP 20
-[ENOTSOCK]
-.I S
+.It Bq Er ENOTSOCK
+.Fa S
 is a descriptor for a file, not a socket.
 is a descriptor for a file, not a socket.
-.TP 20
-[EADDRNOTAVAIL]
+.It Bq Er EADDRNOTAVAIL
 The specified address is not available on this machine.
 The specified address is not available on this machine.
-.TP 20
-[EAFNOSUPPORT]
+.It Bq Er EAFNOSUPPORT
 Addresses in the specified address family cannot be used with this socket.
 Addresses in the specified address family cannot be used with this socket.
-.TP 20
-[EISCONN]
+.It Bq Er EISCONN
 The socket is already connected.
 The socket is already connected.
-.TP 20
-[ETIMEDOUT]
+.It Bq Er ETIMEDOUT
 Connection establishment timed out without establishing a connection.
 Connection establishment timed out without establishing a connection.
-.TP 20
-[ECONNREFUSED]
+.It Bq Er ECONNREFUSED
 The attempt to connect was forcefully rejected.
 The attempt to connect was forcefully rejected.
-.TP 20
-[ENETUNREACH]
+.It Bq Er ENETUNREACH
 The network isn't reachable from this host.
 The network isn't reachable from this host.
-.TP 20
-[EADDRINUSE]
+.It Bq Er EADDRINUSE
 The address is already in use.
 The address is already in use.
-.TP 20
-[EFAULT]
-The \fIname\fP parameter specifies an area outside
+.It Bq Er EFAULT
+The
+.Fa name
+parameter specifies an area outside
 the process address space.
 the process address space.
-.TP 20
-[EINPROGRESS]
+.It Bq Er EINPROGRESS
 The socket is non-blocking 
 and the connection cannot
 be completed immediately.
 It is possible to
 The socket is non-blocking 
 and the connection cannot
 be completed immediately.
 It is possible to
-.IR select (2)
+.Xr select 2
 for completion by selecting the socket for writing.
 for completion by selecting the socket for writing.
-.TP 20
-[EALREADY]
+.It Bq Er EALREADY
 The socket is non-blocking
 and a previous connection attempt
 has not yet been completed.
 The socket is non-blocking
 and a previous connection attempt
 has not yet been completed.
-.PP
+.El
+.Pp
 The following errors are specific to connecting names in the UNIX domain.
 These errors may not apply in future versions of the UNIX IPC domain.
 The following errors are specific to connecting names in the UNIX domain.
 These errors may not apply in future versions of the UNIX IPC domain.
-.TP 15
-[ENOTDIR]
+.Bl -tag -width EADDRNOTAVAILABB
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named socket does not exist.
 The named socket does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Write access to the named socket is denied.
 Write access to the named socket is denied.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.SH SEE ALSO
-accept(2), select(2), socket(2), getsockname(2)
+.El
+.Sh SEE ALSO
+.Xr accept 2 ,
+.Xr select 2 ,
+.Xr socket 2 ,
+.Xr getsockname 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index bf41c93..13d65d3 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)dup.2       6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH DUP 2 ""
-.UC 4
-.SH NAME
-dup, dup2 \- duplicate a descriptor
-.SH SYNOPSIS
-.nf
-.ft B
-newd = dup(oldd)
-int newd, oldd;
-.PP
-.ft B
-dup2(oldd, newd)
-int oldd, newd;
-.fi
-.SH DESCRIPTION
-.I Dup
-duplicates an existing object descriptor.
-The argument \fIoldd\fP is a small non-negative integer index in
+.\"     @(#)dup.2      6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt DUP 2
+.Os BSD 4
+.Sh NAME
+.Nm dup ,
+.Nm dup2
+.Nd duplicate an existing file descriptor
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn dup "int oldd"
+.Ft int
+.Fn dup2 "int oldd" "int newd"
+.Sh DESCRIPTION
+.Fn Dup
+duplicates an existing object descriptor and returns its value to
+the calling process
+.Fa ( newd
+=
+.Fn dup oldd ) .
+The argument
+.Fa oldd
+is a small non-negative integer index in
 the per-process descriptor table.  The value must be less
 than the size of the table, which is returned by
 the per-process descriptor table.  The value must be less
 than the size of the table, which is returned by
-.IR getdtablesize (2).
-The new descriptor returned by the call,
-.I newd,
-is the lowest numbered descriptor that is
-not currently in use by the process.
-.PP
+.Xr getdtablesize 2 .
+The new descriptor returned by the call
+is the lowest numbered descriptor
+currently not in use by the process.
+.Pp
 The object referenced by the descriptor does not distinguish
 The object referenced by the descriptor does not distinguish
-between references using \fIoldd\fP and \fInewd\fP in any way.
-Thus if \fInewd\fP and \fIoldd\fP are duplicate references to an open
+between
+.Fa oldd
+and
+.Fa newd
+in any way.
+Thus if
+.Fa newd
+and
+.Fa oldd
+are duplicate references to an open
 file,
 file,
-.IR read (2),
-.IR write (2)
+.Xr read 2 ,
+.Xr write 2
 and
 and
-.IR lseek (2)
+.Xr lseek 2
 calls all move a single pointer into the file,
 and append mode, non-blocking I/O and asynchronous I/O options
 are shared between the references.
 If a separate pointer into the file is desired, a different
 object reference to the file must be obtained by issuing an
 additional
 calls all move a single pointer into the file,
 and append mode, non-blocking I/O and asynchronous I/O options
 are shared between the references.
 If a separate pointer into the file is desired, a different
 object reference to the file must be obtained by issuing an
 additional
-.IR open (2)
+.Xr open 2
 call.
 The close-on-exec flag on the new file descriptor is unset.
 call.
 The close-on-exec flag on the new file descriptor is unset.
-.PP
-In the second form of the call, the value of
-.IR newd
-desired is specified.  If this descriptor is already
+.Pp
+In 
+.Fn dup2 ,
+the value of the new descriptor
+.Fa newd
+is specified.  If this descriptor is already
 in use, the descriptor is first deallocated as if a
 in use, the descriptor is first deallocated as if a
-.IR close (2)
+.Xr close 2
 call had been done first.
 call had been done first.
-.SH "RETURN VALUE
-The value \-1 is returned if an error occurs in either call.
+.Sh RETURN VALUES
+The value -1 is returned if an error occurs in either call.
 The external variable
 The external variable
-.I errno
+.Va errno
 indicates the cause of the error.
 indicates the cause of the error.
-.SH "ERRORS
-.I Dup
+.SERRORS
+.Fn Dup
 and
 and
-.I dup2
+.Fn dup2
 fail if:
 fail if:
-.TP 15
-[EBADF]
-\fIOldd\fP or
-\fInewd\fP is not a valid active descriptor
-.TP 15
-[EMFILE]
+.Bl -tag -width Er
+.It Bq Er EBADF
+.Fa Oldd
+or
+.Fa newd
+is not a valid active descriptor
+.It Bq Er EMFILE
 Too many descriptors are active.
 Too many descriptors are active.
-.SH "SEE ALSO"
-accept(2),
-open(2),
-close(2),
-fcntl(2),
-pipe(2),
-socket(2),
-socketpair(2),
-getdtablesize(2)
+.El
+.Sh SEE ALSO
+.Xr accept 2 ,
+.Xr open 2 ,
+.Xr close 2 ,
+.Xr fcntl 2 ,
+.Xr pipe 2 ,
+.Xr socket 2 ,
+.Xr socketpair 2 ,
+.Xr getdtablesize 2
+.Sh STANDARDS
+.Fn Dup
+and
+.Fn dup2
+are expected to conform
+to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index 5affa03..1ba96f9 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)execve.2    6.8 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH EXECVE 2 ""
-.UC 4
-.SH NAME
-execve \- execute a file
-.SH SYNOPSIS
-.ft B
-execve(path, argv, envp)
-.br
-char *path, **argv, **envp;
-.fi
-.SH DESCRIPTION
-.I Execve
+.\"     @(#)execve.2   6.9 (Berkeley) %G%
+.\"
+.Dd 
+.Dt EXECVE 2
+.Os BSD 4
+.Sh NAME
+.Nm execve
+.Nd execute a file
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn execve "const char *path" "const * char *argv" "const * char *envp"
+.Sh DESCRIPTION
+.Fn Execve
 transforms the calling process into a new process.
 The new process is constructed from an ordinary file,
 whose name is pointed to by
 transforms the calling process into a new process.
 The new process is constructed from an ordinary file,
 whose name is pointed to by
-.IR path ,
-called the \fInew process file\fP.
+.Fa path ,
+called the
+.Em new process file .
 This file is either an executable object file,
 or a file of data for an interpreter.
 An executable object file consists of an identifying header,
 followed by pages of data representing the initial program (text)
 and initialized data pages.  Additional pages may be specified
 This file is either an executable object file,
 or a file of data for an interpreter.
 An executable object file consists of an identifying header,
 followed by pages of data representing the initial program (text)
 and initialized data pages.  Additional pages may be specified
-by the header to be initialized with zero data.  See
-.IR a.out (5).
-.PP
-An interpreter file begins with a line of the form
-.RB `` "#! \fIinterpreter\fP [\fIarg\fP]" ''.
+by the header to be initialized with zero data;  see
+.Xr a.out 5 .
+.Pp
+An interpreter file begins with a line of the form:
+.Pp
+.Bd -filled -offset indent -compact
+.Sy \&#!
+.Em interpreter
+.Bq Em arg
+.Ed
+.Pp
 When an interpreter file is
 When an interpreter file is
-.IR execve\| 'd,
-the system \fIexecve\fP\|'s the specified \fIinterpreter\fP.
+.Fn execve Ap d ,
+the system
+.Fn execve Ap s
+the specified
+.Em interpreter .
 If the optional
 If the optional
-.I arg
+.Em arg
 is specified, it becomes the first argument to the
 is specified, it becomes the first argument to the
-.IR interpreter ,
+.Em interpreter ,
 and the name of the originally
 and the name of the originally
-.BR execve 'd
+.Fn execve Ap d
 file becomes the second argument;
 otherwise, the name of the originally
 file becomes the second argument;
 otherwise, the name of the originally
-.BR execve 'd
+.Fn execve Ap d
 file becomes the first argument.  The original arguments are shifted over to
 become the subsequent arguments.  The zeroth argument, normally the name of the
 file becomes the first argument.  The original arguments are shifted over to
 become the subsequent arguments.  The zeroth argument, normally the name of the
-.BR execve 'd
+.Fn execve Ap d
 file, is left unchanged.
 file, is left unchanged.
-.PP
-There can be no return from a successful \fIexecve\fP because the calling
-core image is lost.
-This is the mechanism whereby different process images become active.
-.PP
-The argument \fIargv\fP is a pointer to a null-terminated array of
+.Pp
+The argument
+.Fa argv
+is a pointer to a null-terminated array of
 character pointers to null-terminated character strings.
 character pointers to null-terminated character strings.
-These strings constitute the argument list to be made available to the new
-process.  By convention, at least one argument must be present in
-this array, and the first element of this array should be
-the name of the executed program (i.e., the last component of \fIpath\fP).
-.PP
-The argument \fIenvp\fP is also a pointer to a null-terminated array of
+These strings construct the argument list to be made available to the new
+process.  At least one argument must be present in
+the array; by custom, the first element should be
+the name of the executed program (for example, the last component of
+.Fa path ) .
+.Pp
+The argument
+.Fa envp
+is also a pointer to a null-terminated array of
 character pointers to null-terminated strings.
 character pointers to null-terminated strings.
+A pointer to this array is normally stored in the global variable
+.Va environ.
 These strings pass information to the
 new process that is not directly an argument to the command (see
 These strings pass information to the
 new process that is not directly an argument to the command (see
-.IR environ (7)).
-.PP
-Descriptors open in the calling process remain open in
-the new process, except for those for which the close-on-exec
+.Xr environ 7 ) .
+.Pp
+File descriptors open in the calling process image remain open in
+the new process image, except for those for which the close-on-exec
 flag is set (see
 flag is set (see
-.IR close (2)
+.Xr close 2
 and
 and
-.IR fcntl (2)).
+.Xr fcntl 2 ) .
 Descriptors that remain open are unaffected by
 Descriptors that remain open are unaffected by
-.IR execve .
-.PP
-Ignored signals remain ignored across an
-.IR execve ,
-but signals that are caught are reset to their default values.
+.Fn execve .
+.Pp
+Signals set to be ignored in the calling process are set to be ignored in
+the
+new process. Signals which are set to be caught in the calling process image
+are set to default action in the new process image.
 Blocked signals remain blocked regardless of changes to the signal action.
 The signal stack is reset to be undefined (see
 Blocked signals remain blocked regardless of changes to the signal action.
 The signal stack is reset to be undefined (see
-.IR sigvec (2) 
+.Xr sigaction 2
 for more information).
 for more information).
-.PP
-Each process has
-.I real
-user and group IDs and an
-.I effective
-user and group IDs.  The
-.I real
-ID identifies the person using the system; the
-.I effective
-ID determines his access privileges.
-.I Execve
-changes the effective user and group ID to
-the owner of the executed file if the file has the \*(lqset-user-ID\*(rq
-or \*(lqset-group-ID\*(rq modes.  The
-.I real
-user and group IDs are not affected.
-.PP
+.Pp
+If the set-user-ID mode bit of the new process image file is set
+(see
+.Xr chmod 2 ) ,
+the effective user ID of the new process image is set to the owner ID
+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 real user ID, real group ID and
+supplementary group IDs of the new process image remain the same as the calling
+process image.
+.Pp
 The new process also inherits the following attributes from
 the calling process:
 The new process also inherits the following attributes from
 the calling process:
-.PP
-.in +5n
-.nf
-.ta +2i
-process ID     see \fIgetpid\fP\|(2)
-parent process ID      see \fIgetppid\fP\|(2)
-process group ID       see \fIgetpgrp\fP\|(2)
-access groups  see \fIgetgroups\fP\|(2)
-working directory      see \fIchdir\fP\|(2)
-root directory see \fIchroot\fP\|(2)
-control terminal       see \fItty\fP\|(4)
-resource usages        see \fIgetrusage\fP\|(2)
-interval timers        see \fIgetitimer\fP\|(2)
-resource limits        see \fIgetrlimit\fP\|(2)
-file mode mask see \fIumask\fP\|(2)
-signal mask    see \fIsigvec\fP\|(2), \fIsigsetmask\fP\|(2)
-.in -5n
-.fi
-.PP
-When the executed program begins, it is called as follows:
-.PP
-.DT
-.nf
-       main(argc, argv, envp)
-       int argc;
-       char **argv, **envp;
-.fi
-.PP
+.Pp
+.Bl -column parent_process_ID -offset indent -compact
+.It process ID Ta see Xr getpid 2
+.It parent process ID Ta see Xr getppid 2
+.It process group ID Ta see Xr getpgrp 2
+.It access groups Ta see Xr getgroups 2
+.It working directory Ta see Xr chdir 2
+.It root directory Ta see Xr chroot 2
+.It control terminal Ta see Xr termios 4
+.It resource usages Ta see Xr getrusage 2
+.It interval timers Ta see Xr getitimer 2
+.It resource limits Ta see Xr getrlimit 2
+.It file mode mask Ta see Xr umask 2
+.It signal mask Ta see Xr sigvec 2 ,
+.Xr sigsetmask 2
+.El
+.Pp
+When a program is executed as a result of an
+.Fn execve
+call, it is entered as follows:
+.Bd -literal -offset indent
+main(argc, argv, envp)
+int argc;
+char **argv, **envp;
+.Ed
+.Pp
 where
 where
-.I argc
-is the number of elements in \fIargv\fP
+.Fa argc
+is the number of elements in
+.Fa argv
 (the ``arg count'')
 and
 (the ``arg count'')
 and
-.I argv
+.Fa argv
 points to the array of character pointers
 to the arguments themselves.
 points to the array of character pointers
 to the arguments themselves.
-.PP
-.I Envp
-is a pointer to an array of strings that constitute
-the
-.I environment
-of the process.
-A pointer to this array is also stored in the global variable ``environ''.
-Each string consists of a name, an \*(lq=\*(rq, and a null-terminated value.
-The array of pointers is terminated by a null pointer.
-The shell
-.IR sh (1)
-passes an environment entry for each global shell variable
-defined when the program is called.
-See
-.IR environ (7)
-for some conventionally
-used names.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
+As the
+.Fn execve
+function overlays the current process image 
+with a new process image the successful call
+has no process to return to.
 If
 If
-.I execve
-returns to the calling process an error has occurred; the
-return value will be \-1 and the global variable
-.I errno
-will contain an error code.
-.SH ERRORS
-.I Execve
-will fail and return to the calling process if one or more
-of the following are true:
-.TP 15
-[ENOTDIR]
+.Fn execve
+does return to the calling process an error has occurred; the
+return value will be -1 and the global variable
+.Va errno
+is set to indicate the error.
+.Sh ERRORS
+.Fn Execve
+will fail and return to the calling process if:
+.Bl -tag -width [ENAMETOOLONG]
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The new process file does not exist.
 The new process file does not exist.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 The new process file is not an ordinary file.
 The new process file is not an ordinary file.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 The new process file mode denies execute permission.
 The new process file mode denies execute permission.
-.TP 15
-[ENOEXEC]
+.It Bq Er ENOEXEC
 The new process file has the appropriate access
 permission, but has an invalid magic number in its header.
 The new process file has the appropriate access
 permission, but has an invalid magic number in its header.
-.TP 15
-[ETXTBSY]
+.It Bq Er ETXTBSY
 The new process file is a pure procedure (shared text)
 file that is currently open for writing or reading by some process.
 The new process file is a pure procedure (shared text)
 file that is currently open for writing or reading by some process.
-.TP 15
-[ENOMEM]
+.It Bq Er ENOMEM
 The new process requires more virtual memory than
 is allowed by the imposed maximum
 The new process requires more virtual memory than
 is allowed by the imposed maximum
-.RI ( getrlimit (2)).
-.TP 15
-[E2BIG]
+.Pq Xr getrlimit 2 .
+.It Bq Er E2BIG
 The number of bytes in the new process's argument list
 is larger than the system-imposed limit.
 The limit in the system as released is 20480 bytes
 The number of bytes in the new process's argument list
 is larger than the system-imposed limit.
 The limit in the system as released is 20480 bytes
-(NCARGS in
-.IR <sys/param.h> .
-.TP 15
-[EFAULT]
+.Pf ( Dv NCARGS
+in
+.Ao Pa sys/param.h Ac .
+.It Bq Er EFAULT
 The new process file is not as long as indicated by
 the size values in its header.
 The new process file is not as long as indicated by
 the size values in its header.
-.TP 15
-[EFAULT]
-\fIPath\fP\|, \fIargv\fP\|, or \fIenvp\fP point
+.It Bq Er EFAULT
+.Fa Path ,
+.Fa argv ,
+or
+.Fa envp
+point
 to an illegal address.
 to an illegal address.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from the file system.
 An I/O error occurred while reading from the file system.
-.SH CAVEATS
+.El
+.Sh CAVEAT
 If a program is
 If a program is
-.I setuid
+.Em setuid
 to a non-super-user, but is executed when
 to a non-super-user, but is executed when
-the real \fIuid\fP is ``root'', then the program has some of the powers
+the real
+.Em uid
+is ``root'', then the program has some of the powers
 of a super-user as well.
 of a super-user as well.
-.SH "SEE ALSO"
-exit(2), fork(2), execl(3), environ(7)
+.Sh SEE ALSO
+.Xr exit 2 ,
+.Xr fork 2 ,
+.Xr execl 3 ,
+.Xr environ 7
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index a18deeb..30ec901 100644 (file)
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)fcntl.2     6.6 (Berkeley) %G%
+.\"     @(#)fcntl.2    6.7 (Berkeley) %G%
 .\"
 .\"
-.TH FCNTL 2 ""
-.UC 5
-.SH NAME
-fcntl \- file control
-.SH SYNOPSIS
-.nf
-.ft B
-#include <fcntl.h>
-.PP
-.ft B
-res = fcntl(fd, cmd, arg)
-int res;
-int fd, cmd, arg;
-.ft R
-.SH DESCRIPTION
-.I Fcntl
+.Dd 
+.Dt FCNTL 2
+.Os BSD 4.2
+.Sh NAME
+.Nm fcntl
+.Nd file control
+.Sh SYNOPSIS
+.Fd #include <sys/fcntl.h>
+.Ft int
+.Fn fcntl "int fd" "int cmd" "int arg"
+.Sh DESCRIPTION
+.Fn Fcntl
 provides for control over descriptors.
 The argument
 provides for control over descriptors.
 The argument
-.I fd
+.Fa fd
 is a descriptor to be operated on by
 is a descriptor to be operated on by
-.I cmd
+.Fa cmd
 as follows:
 as follows:
-.TP 15
-F_DUPFD
+.Bl -tag -width F_GETOWNX
+.It Dv F_DUPFD
 Return a new descriptor as follows:
 Return a new descriptor as follows:
-.IP
+.Pp
+.Bl -bullet -compact -offset 4n
+.It
 Lowest numbered available descriptor greater than or equal to
 Lowest numbered available descriptor greater than or equal to
-.I arg.
-.IP
+.Fa arg .
+.It
 Same object references as the original descriptor.
 Same object references as the original descriptor.
-.IP
-New descriptor shares the same file pointer if the object
+.It
+New descriptor shares the same file offset if the object
 was a file.
 was a file.
-.IP
+.It
 Same access mode (read, write or read/write).
 Same access mode (read, write or read/write).
-.IP
+.It
 Same file status flags (i.e., both file descriptors
 share the same file status flags).
 Same file status flags (i.e., both file descriptors
 share the same file status flags).
-.IP
+.It
 The close-on-exec flag associated with the new file descriptor
 is set to remain open across
 The close-on-exec flag associated with the new file descriptor
 is set to remain open across
-.IR execv (2)
+.Xr execv 2
 system calls.
 system calls.
-.TP 15
-F_GETFD
+.El
+.It Dv F_GETFD
 Get the close-on-exec flag associated with the file descriptor
 Get the close-on-exec flag associated with the file descriptor
-.IR fd .
-If the low-order bit is 0, the file will remain open across
-.IR exec ,
+.Fa fd .
+If the low-order bit of the returned value is 0,
+the file will remain open across
+.Fn exec ,
 otherwise the file will be closed upon execution of
 otherwise the file will be closed upon execution of
-.I exec.
-.TP 15
-F_SETFD
+.Fn exec
+.Fa ( arg
+is ignored).
+.It Dv F_SETFD
 Set the close-on-exec flag associated with
 Set the close-on-exec flag associated with
-.I fd
+.Fa fd
 to the low order bit of
 to the low order bit of
-.I arg
+.Fa arg
 (0 or 1 as above).
 (0 or 1 as above).
-.TP 15
-F_GETFL
-Get descriptor status flags, as described below.
-.TP 15
-F_SETFL
-Set descriptor status flags.
-.TP 15
-F_GETOWN
+.It Dv F_GETFL
+Get descriptor status flags, as described below
+.Fa ( arg
+is ignored).
+.It Dv F_SETFL
+Set descriptor status flags to
+.Fa arg .
+.It Dv F_GETOWN
 Get the process ID or process group
 Get the process ID or process group
-currently receiving SIGIO and SIGURG
+currently receiving
+.Dv SIGIO
+and
+.Dv SIGURG
 signals; process groups are returned
 signals; process groups are returned
-as negative values.
-.TP
-F_SETOWN
+as negative values
+.Fa ( arg
+is ignored).
+.It Dv F_SETOWN
 Set the process or process group
 Set the process or process group
-to receive SIGIO and SIGURG signals;
+to receive
+.Dv SIGIO
+and
+.Dv SIGURG
+signals;
 process groups are specified by supplying
 process groups are specified by supplying
-.I arg
+.Fa arg
 as negative, otherwise 
 as negative, otherwise 
-.I arg
+.Fa arg
 is interpreted as a process ID.
 is interpreted as a process ID.
-.LP
-The flags for the F_GETFL and F_SETFL flags are as follows:
-.TP 15
-FNDELAY
+.El
+.Pp
+The flags for the
+.Dv F_GETFL
+and
+.Dv F_SETFL
+flags are as follows:
+.Bl -tag -width F_GETOWNX
+.It Dv O_NDELAY
 Non-blocking I/O; if no data is available to a
 Non-blocking I/O; if no data is available to a
-.I read
-call, or if a write operation would block,
-the call returns -1 with the error EWOULDBLOCK.
-.TP
-FAPPEND
+.Xr read
+call, or if a
+.Xr write
+operation would block,
+the read or write call returns -1 with the error
+.Er EWOULDBLOCK .
+.It Dv O_APPEND
 Force each write to append at the end of file;
 Force each write to append at the end of file;
-corresponds to the O_APPEND flag of
-.IR open (2).
-.TP
-FASYNC
-Enable the SIGIO signal to be sent to the process group
+corresponds to the
+.Dv O_APPEND
+flag of
+.Xr open 2 .
+.It Dv O_ASYNC
+Enable the
+.Dv SIGIO
+signal to be sent to the process group
 when I/O is possible, e.g.,
 upon availability of data to be read.
 when I/O is possible, e.g.,
 upon availability of data to be read.
-.SH "RETURN VALUE
+.El
+.Sh RETURN VALUES
 Upon successful completion, the value returned depends on
 Upon successful completion, the value returned depends on
-.I cmd
+.Fa cmd
 as follows:
 as follows:
-.sp .5v
-.nf
-.ta .25i 1.25i
-       F_DUPFD A new file descriptor.
-       F_GETFD Value of flag (only the low-order bit is defined).
-       F_GETFL Value of flags.
-       F_GETOWN        Value of file descriptor owner.
-       other   Value other than \-1.
-.fi
-.sp .5v
-Otherwise, a value of \-1 is returned and
-.I errno
+.Bl -tag -width F_GETOWNX -offset indent
+.It Dv F_DUPFD
+A new file descriptor.
+.It Dv F_GETFD
+Value of flag (only the low-order bit is defined).
+.It Dv F_GETFL
+Value of flags.
+.It Dv F_GETOWN
+Value of file descriptor owner.
+.It other
+Value other than -1.
+.El
+.Pp
+Otherwise, a value of -1 is returned and
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Fcntl
-will fail if one or more of the following are true:
-.TP 15
-[EBADF]
-.I Fildes
+.Sh ERRORS
+.Fn Fcntl
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EBADF
+.Fa Fildes
 is not a valid open file descriptor.
 is not a valid open file descriptor.
-.TP 15
-[EMFILE]
-.I Cmd
-is F_DUPFD and the maximum allowed number of file descriptors are currently
+.It Bq Er EMFILE
+.Fa Cmd
+is
+.Dv F_DUPFD
+and the maximum allowed number of file descriptors are currently
 open.
 open.
-.TP 15
-[EINVAL]
-.I Cmd
-is F_DUPFD and
-.I arg
+.It Bq Er EINVAL
+.Fa Cmd
+is
+.Dv F_DUPFD
+and
+.Fa arg
 is negative or greater than the maximum allowable number
 (see
 is negative or greater than the maximum allowable number
 (see
-.IR getdtablesize (2)).
-.TP 15
-[ESRCH]
-.I Cmd
-is F_SETOWN and
+.Xr getdtablesize 2 ) .
+.It Bq Er ESRCH
+.Fa Cmd
+is
+.Dv F_SETOWN
+and
 the process ID given as argument is not in use.
 the process ID given as argument is not in use.
-.SH "SEE ALSO
-close(2), execve(2), getdtablesize(2), open(2), sigvec(2)
-.SH BUGS
-The asynchronous I/O facilities of FNDELAY and FASYNC
+.El
+.Sh SEE ALSO
+.Xr close 2 ,
+.Xr execve 2 ,
+.Xr getdtablesize 2 ,
+.Xr open 2 ,
+.Xr sigvec 2
+.Sh BUGS
+The asynchronous I/O facilities of
+.Dv FNDELAY
+and
+.Dv FASYNC
 are currently available only for tty and socket operations.
 are currently available only for tty and socket operations.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index a50b134..96e20d4 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)flock.2     6.6 (Berkeley) %G%
+.\"     @(#)flock.2    6.7 (Berkeley) %G%
 .\"
 .\"
-.TH FLOCK 2 ""
-.UC 5
-.SH NAME
-flock \- apply or remove an advisory lock on an open file
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/file.h>
-.PP
-.ft B
-.DT
-#define        LOCK_SH 1       /* shared lock */
-#define        LOCK_EX 2       /* exclusive lock */
-#define        LOCK_NB 4       /* don't block when locking */
-#define        LOCK_UN 8       /* unlock */
-.PP
-.ft B
-flock(fd, operation)
-int fd, operation;
-.fi
-.SH DESCRIPTION
-.I Flock
+.Dd 
+.Dt FLOCK 2
+.Os BSD 4.2
+.Sh NAME
+.Nm flock
+.Nd "apply or remove an advisory lock on an open file"
+.Sh SYNOPSIS
+.Fd #include <sys/file.h>
+.Fd #define    LOCK_SH 1       /* shared lock */
+.Fd #define    LOCK_EX 2       /* exclusive lock */
+.Fd #define    LOCK_NB 4       /* don't block when locking */
+.Fd #define    LOCK_UN 8       /* unlock */
+.Ft int
+.Fn flock "int fd" "int operation"
+.Sh DESCRIPTION
+.Fn Flock
 applies or removes an
 applies or removes an
-.I advisory
+.Em advisory
 lock on the file associated with the file descriptor
 lock on the file associated with the file descriptor
-.IR fd .
+.Fa fd .
 A lock is applied by specifying an
 A lock is applied by specifying an
-.I operation
+.Fa operation
 parameter that is the inclusive or of
 parameter that is the inclusive or of
-LOCK_SH or LOCK_EX and, possibly, LOCK_NB.  To unlock
+.Dv LOCK_SH
+or
+.Dv LOCK_EX
+and, possibly,
+.Dv LOCK_NB .
+To unlock
 an existing lock
 an existing lock
-.I operation
-should be LOCK_UN.
-.PP
+.Dv operation
+should be
+.Dv LOCK_UN .
+.Pp
 Advisory locks allow cooperating processes to perform
 consistent operations on files, but do not guarantee
 consistency (i.e., processes may still access files
 without using advisory locks possibly resulting in
 inconsistencies).
 Advisory locks allow cooperating processes to perform
 consistent operations on files, but do not guarantee
 consistency (i.e., processes may still access files
 without using advisory locks possibly resulting in
 inconsistencies).
-.PP
+.Pp
 The locking mechanism allows two types of locks:
 The locking mechanism allows two types of locks:
-.I shared
+.Em shared
 locks and
 locks and
-.I exclusive
+.Em exclusive
 locks.
 At any time multiple shared locks may be applied to a file,
 but at no time are multiple exclusive, or both shared and exclusive,
 locks allowed simultaneously on a file.  
 locks.
 At any time multiple shared locks may be applied to a file,
 but at no time are multiple exclusive, or both shared and exclusive,
 locks allowed simultaneously on a file.  
-.PP
+.Pp
 A shared lock may be
 A shared lock may be
-.I upgraded
+.Em upgraded
 to an exclusive lock, and vice versa, simply by specifying
 the appropriate lock type; this results in the previous
 lock being released and the new lock applied (possibly
 after other processes have gained and released the lock).
 to an exclusive lock, and vice versa, simply by specifying
 the appropriate lock type; this results in the previous
 lock being released and the new lock applied (possibly
 after other processes have gained and released the lock).
-.PP
+.Pp
 Requesting a lock on an object that is already locked
 normally causes the caller to be blocked until the lock may be
 Requesting a lock on an object that is already locked
 normally causes the caller to be blocked until the lock may be
-acquired.  If LOCK_NB is included in
-.IR operation ,
+acquired.  If
+.Dv LOCK_NB
+is included in
+.Fa operation ,
 then this will not happen; instead the call will fail and
 then this will not happen; instead the call will fail and
-the error EWOULDBLOCK will be returned.
-.SH NOTES
+the error
+.Er EWOULDBLOCK
+will be returned.
+.Sh NOTES
 Locks are on files, not file descriptors.  That is, file descriptors
 duplicated through
 Locks are on files, not file descriptors.  That is, file descriptors
 duplicated through
-.IR dup (2)
+.Xr dup 2
 or
 or
-.IR fork (2)
+.Xr fork 2
 do not result in multiple instances of a lock, but rather multiple
 references to a single lock.  If a process holding a lock on a file
 forks and the child explicitly unlocks the file, the parent will
 lose its lock.
 do not result in multiple instances of a lock, but rather multiple
 references to a single lock.  If a process holding a lock on a file
 forks and the child explicitly unlocks the file, the parent will
 lose its lock.
-.PP
+.Pp
 Processes blocked awaiting a lock may be awakened by signals.
 Processes blocked awaiting a lock may be awakened by signals.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 Zero is returned if the operation was successful;
 Zero is returned if the operation was successful;
-on an error a \-1 is returned and an error code is left in
-the global location \fIerrno\fP.
-.SH "ERRORS
-The \fIflock\fP call fails if:
-.TP 20
-[EWOULDBLOCK]
-The file is locked and the LOCK_NB option was specified.
-.TP 20
-[EBADF]
-The argument \fIfd\fP is an invalid descriptor.
-.TP 20
-[EINVAL]
-The argument \fIfd\fP refers to an object other than a file.
-.SH "SEE ALSO"
-open(2), close(2), dup(2), execve(2), fork(2)
+on an error a -1 is returned and an error code is left in
+the global location
+.Va errno .
+.Sh ERRORS
+The
+.Fn flock
+call fails if:
+.Bl -tag -width EWOULDBLOCKAA
+.It Bq Er EWOULDBLOCK
+The file is locked and the
+.Dv LOCK_NB
+option was specified.
+.It Bq Er EBADF
+The argument
+.Fa fd
+is an invalid descriptor.
+.It Bq Er EINVAL
+The argument
+.Fa fd
+refers to an object other than a file.
+.El
+.Sh SEE ALSO
+.Xr open 2 ,
+.Xr close 2 ,
+.Xr dup 2 ,
+.Xr execve 2 ,
+.Xr fork 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 2b25ded..ad19538 100644 (file)
@@ -1,69 +1,81 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)fork.2      6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH FORK 2 ""
-.UC
-.SH NAME
-fork \- create a new process
-.SH SYNOPSIS
-.ft B
-pid = fork()
-.br
-int pid;
-.ft R
-.SH DESCRIPTION
-.I Fork
+.\"     @(#)fork.2     6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt FORK 2
+.Os BSD 4.0
+.Sh NAME
+.Nm fork
+.Nd create a new process
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft pid_t
+.Fn fork void
+.Sh DESCRIPTION
+.Fn Fork
 causes creation of a new process.
 The new process (child process) is an exact copy of the
 causes creation of a new process.
 The new process (child process) is an exact copy of the
-calling process except for the following:
-.in +5n
-.sp
+calling process (parent process) except for the following:
+.Bl -bullet -offset indent
+.It
 The child process has a unique process ID.
 The child process has a unique process ID.
-.sp
-The child process has a different parent process ID (i.e.,
-the process ID of the parent process).
-.sp
+.It
+The child process has a different parent
+process ID (i.e., the process ID of the parent process).
+.It
 The child process has its own copy of the parent's descriptors.
 These descriptors reference the same underlying objects, so that,
 for instance, file pointers in file objects are shared between
 the child and the parent, so that an
 The child process has its own copy of the parent's descriptors.
 These descriptors reference the same underlying objects, so that,
 for instance, file pointers in file objects are shared between
 the child and the parent, so that an
-.IR lseek (2)
+.Xr lseek 2
 on a descriptor in the child process can affect a subsequent
 on a descriptor in the child process can affect a subsequent
-.I read
+.Xr read
 or
 or
-.I write
+.Xr write
 by the parent.
 This descriptor copying is also used by the shell to
 establish standard input and output for newly created processes
 as well as to set up pipes.
 by the parent.
 This descriptor copying is also used by the shell to
 establish standard input and output for newly created processes
 as well as to set up pipes.
-.sp
-The child processes resource utilizations are set to 0;
-see
-.IR setrlimit (2).
-.SH "RETURN VALUE
-Upon successful completion, \fIfork\fP returns a value
+.It
+The child processes resource utilizations
+are set to 0; see
+.Xr setrlimit 2 .
+.El
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn fork
+returns a value
 of 0 to the child process and returns the process ID of the child
 of 0 to the child process and returns the process ID of the child
-process to the parent process.  Otherwise, a value of \-1 is returned
+process to the parent process.  Otherwise, a value of -1 is returned
 to the parent process, no child process is created, and the global
 to the parent process, no child process is created, and the global
-variable \fIerrno\fP is set to indicate the error.
-.SH ERRORS
-.I Fork
-will fail and no child process will be created if one or more of the
-following are true:
-.TP 15
-[EAGAIN]
+variable
+.Va errno
+is set to indicate the error.
+.Sh ERRORS
+.Fn Fork
+will fail and no child process will be created if:
+.Bl -tag -width [EAGAIN]
+.It Bq Er EAGAIN
 The system-imposed limit on the total
 number of processes under execution would be exceeded.
 This limit is configuration-dependent.
 The system-imposed limit on the total
 number of processes under execution would be exceeded.
 This limit is configuration-dependent.
-.TP 15
-[EAGAIN]
-The system-imposed limit MAXUPRC (\fI<sys/param.h>) \fRon the total number of
+.It Bq Er EAGAIN
+The system-imposed limit
+.Dv MAXUPRC
+.Pq Aq Pa sys/param.h
+on the total number of
 processes under execution by a single user would be exceeded.
 processes under execution by a single user would be exceeded.
-.TP 15
-[ENOMEM]
+.It Bq Er ENOMEM
 There is insufficient swap space for the new process.
 There is insufficient swap space for the new process.
-.SH "SEE ALSO"
-execve(2), wait(2)
+.El
+.Sh SEE ALSO
+.Xr execve 2 ,
+.Xr wait 2
+.Sh HISTORY
+A
+.Nm
+function call appeared in Version 6 AT&T UNIX.
index 3ab9e2b..5f3900b 100644 (file)
@@ -3,42 +3,53 @@
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)fsync.2     6.6 (Berkeley) %G%
+.\"     @(#)fsync.2    6.7 (Berkeley) %G%
 .\"
 .\"
-.TH FSYNC 2 ""
-.UC 5
-.SH NAME
-fsync \- synchronize a file's in-core state with that on disk
-.SH SYNOPSIS
-.ft B
-fsync(fd)
-.br
-int fd;
-.ft R
-.SH DESCRIPTION
-.I Fsync
-causes all modified data and attributes of \fIfd\fP
+.Dd 
+.Dt FSYNC 2
+.Os BSD 4.2
+.Sh NAME
+.Nm fsync
+.Nd "synchronize a file's in-core state with that on disk"
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn fsync "int fd"
+.Sh DESCRIPTION
+.Fn Fsync
+causes all modified data and attributes of
+.Fa fd
 to be moved to a permanent storage device.
 This normally results in all in-core modified copies
 of buffers for the associated file to be written to a disk.
 to be moved to a permanent storage device.
 This normally results in all in-core modified copies
 of buffers for the associated file to be written to a disk.
-.PP
-.I Fsync
+.Pp
+.Fn Fsync
 should be used by programs that require a file to be
 in a known state, for example, in building a simple transaction
 facility.
 should be used by programs that require a file to be
 in a known state, for example, in building a simple transaction
 facility.
-.SH "RETURN VALUE
-A 0 value is returned on success.  A \-1 value indicates
+.Sh RETURN VALUES
+A 0 value is returned on success.  A -1 value indicates
 an error.
 an error.
-.SH "ERRORS
-The \fIfsync\fP fails if:
-.TP 15
-[EBADF]
-\fIFd\fP is not a valid descriptor.
-.TP 15
-[EINVAL]
-\fIFd\fP refers to a socket, not to a file.
-.TP 15
-[EIO]
+.Sh ERRORS
+The
+.Fn fsync
+fails if:
+.Bl -tag -width Er
+.It Bq Er EBADF
+.Fa Fd
+is not a valid descriptor.
+.It Bq Er EINVAL
+.Fa Fd
+refers to a socket, not to a file.
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.SH "SEE ALSO"
-sync(2), sync(8), update(8)
+.El
+.Sh SEE ALSO
+.Xr sync 2 ,
+.Xr sync 8 ,
+.Xr update 8
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 6fd968f..c971b36 100644 (file)
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getdirentries.2     6.3 (Berkeley) %G%
+.\"     @(#)getdirentries.2    6.4 (Berkeley) %G%
 .\"
 .\"
-.TH GETDIRENTRIES 2 ""
-.UC 7
-.SH NAME
-getdirentries \- get directory entries in a filesystem independent format
-.SH SYNOPSIS
-.nf
-.ft B
-#include <dirent.h>
-.LP
-.ft B
-cc = getdirentries(fd, buf, nbytes, basep)
-int cc, fd;
-char *buf;
-int nbytes;
-long *basep;
-.fi
-.SH DESCRIPTION
-.I Getdirentries
+.Dd 
+.Dt GETDIRENTRIES 2
+.Os BSD 4.4
+.Sh NAME
+.Nm getdirentries
+.Nd "get directory entries in a filesystem independent format"
+.Sh SYNOPSIS
+.Fd #include <sys/dirent.h>
+.Ft int
+.Fn getdirentries "int fd" "char *buf" "int nbytes" "long *basep"
+.Sh DESCRIPTION
+.Fn Getdirentries
 reads directory entries from the directory
 referenced by the file descriptor
 reads directory entries from the directory
 referenced by the file descriptor
-.I fd
+.Fa fd
 into the buffer pointed to by
 into the buffer pointed to by
-.IR buf ,
+.Fa buf ,
 in a filesystem independent format.
 Up to
 in a filesystem independent format.
 Up to
-.I nbytes
+.Fa nbytes
 of data will be transferred.
 of data will be transferred.
-.I Nbytes
+.Fa Nbytes
 must be greater than or equal to the
 block size associated with the file,
 see
 must be greater than or equal to the
 block size associated with the file,
 see
-.IR stat(2) .
+.Xr stat 2 .
 Some filesystems may not support
 Some filesystems may not support
-.I getdirentries
+.Fn getdirentries
 with buffers smaller than this size.
 with buffers smaller than this size.
-.PP
+.Pp
 The data in the buffer is a series of
 The data in the buffer is a series of
-.I dirent
+.Em dirent
 structures each containing the following entries:
 structures each containing the following entries:
-.PP
-.RS
-.ta +\w'unsigned\0short\0'u +\w'd_name[MAXNAMELEN + 1];\0'u
-.nf
+.Bd -literal -offset indent
 unsigned long  d_fileno;
 unsigned short d_reclen;
 unsigned short d_namlen;
 unsigned long  d_fileno;
 unsigned short d_reclen;
 unsigned short d_namlen;
-char           d_name[MAXNAMELEN + 1]; /* see below */
-.fi
-.RE
-.PP
+char           d_name[MAXNAMELEN + 1]; /* see below */
+.Ed
+.Pp
 The
 The
-.I d_fileno
+.Fa d_fileno
 entry is a number which is unique for each
 distinct file in the filesystem.
 Files that are linked by hard links (see
 entry is a number which is unique for each
 distinct file in the filesystem.
 Files that are linked by hard links (see
-.IR link(2) )
+.Xr link 2 )
 have the same
 have the same
-.IR d_fileno .
+.Fa d_fileno .
 The
 The
-.I d_reclen
+.Fa d_reclen
 entry is the length, in bytes, of the directory record.
 The
 entry is the length, in bytes, of the directory record.
 The
-.I d_name
+.Fa d_name
 entry contains a null terminated file name.
 The
 entry contains a null terminated file name.
 The
-.I d_namlen
+.Fa d_namlen
 entry specifies the length of the file name excluding the null byte.
 Thus the actual size of
 entry specifies the length of the file name excluding the null byte.
 Thus the actual size of
-.I d_name
-may vary from 1 to \fBMAXNAMELEN + 1\fP.
-.PP
+.Fa d_name
+may vary from 1 to
+.Dv MAXNAMELEN
+\&+ 1.
+.Pp
 Entries may be separated by extra space.
 The
 Entries may be separated by extra space.
 The
-.I d_reclen
+.Fa d_reclen
 entry may be used as an offset from the start of a
 entry may be used as an offset from the start of a
-.I dirent
+.Fa dirent
 structure to the next structure, if any.
 structure to the next structure, if any.
-.PP
+.Pp
 The actual number of bytes transferred is returned.
 The current position pointer associated with
 The actual number of bytes transferred is returned.
 The current position pointer associated with
-.I fd
+.Fa fd
 is set to point to the next block of entries.
 The pointer may not advance by the number of bytes returned by
 is set to point to the next block of entries.
 The pointer may not advance by the number of bytes returned by
-.IR getdirentries .
+.Fn getdirentries .
 A value of zero is returned when
 the end of the directory has been reached.
 A value of zero is returned when
 the end of the directory has been reached.
-.PP
-.I Getdirentries
+.Pp
+.Fn Getdirentries
 writes the position of the block read into the location pointed to by
 writes the position of the block read into the location pointed to by
-.IR basep .
+.Fa basep .
 Alternatively, the current position pointer may be set and retrieved by
 Alternatively, the current position pointer may be set and retrieved by
-.IR lseek(2) .
+.Xr lseek 2 .
 The current position pointer should only be set to a value returned by
 The current position pointer should only be set to a value returned by
-.I lseek(2) ,
+.Xr lseek 2 ,
 a value returned in the location pointed to by
 a value returned in the location pointed to by
-.I basep ,
+.Fa basep ,
 or zero.
 or zero.
-.SH RETURN VALUE
+.Sh RETURN VALUES
 If successful, the number of bytes actually transferred is returned.
 If successful, the number of bytes actually transferred is returned.
-Otherwise, a \-1 is returned and the global variable
-.I errno
+Otherwise, -1 is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Getdirentries
-will fail if one or more of the following are true:
-.TP 15
-EBADF
-\fIfd\fP is not a valid file descriptor open for reading.
-.TP 15
-EFAULT
-Either \fIbuf\fP or \fIbasep\fP point outside the allocated address space.
-.TP 15
-EIO
+.Sh ERRORS
+.Fn Getdirentries
+will fail if:
+.Bl -tag -width [EFAULT]
+.It EBADF
+.Fa fd
+is not a valid file descriptor open for reading.
+.It EFAULT
+Either
+.Fa buf
+or
+.Fa basep
+point outside the allocated address space.
+.It EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.SH "SEE ALSO"
-open(2), lseek(2)
+.El
+.Sh SEE ALSO
+.Xr open 2 ,
+.Xr lseek 2
+.Sh HISTORY
+The
+.Nm
+function call is currently under development.
index 96aab57..1bd1fdb 100644 (file)
@@ -1,26 +1,34 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getdtablesize.2     6.4 (Berkeley) %G%
+.\"     @(#)getdtablesize.2    6.5 (Berkeley) %G%
 .\"
 .\"
-.TH GETDTABLESIZE 2 ""
-.UC 5
-.SH NAME
-getdtablesize \- get descriptor table size
-.SH SYNOPSIS
-.nf
-.ft B
-nfds = getdtablesize()
-int nfds;
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt GETDTABLESIZE 2
+.Os BSD 4.2
+.Sh NAME
+.Nm getdtablesize
+.Nd get descriptor table size
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn getdtablesize void
+.Sh DESCRIPTION
 Each process has a fixed size descriptor table,
 which is guaranteed to have at least 20 slots.  The entries in
 the descriptor table are numbered with small integers starting at 0.
 The call
 Each process has a fixed size descriptor table,
 which is guaranteed to have at least 20 slots.  The entries in
 the descriptor table are numbered with small integers starting at 0.
 The call
-.I getdtablesize
+.Fn getdtablesize
 returns the size of this table.
 returns the size of this table.
-.SH "SEE ALSO"
-close(2), dup(2), open(2), select(2)
+.Sh SEE ALSO
+.Xr close 2 ,
+.Xr dup 2 ,
+.Xr open 2 ,
+.Xr select 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index be21d56..d5501e5 100644 (file)
@@ -1,74 +1,67 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getfh.2     6.2 (Berkeley) %G%
+.\"     @(#)getfh.2    6.3 (Berkeley) %G%
 .\"
 .\"
-.TH GETFH 2 ""
-.UC 7
-.SH NAME
-getfh \- get file handle
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/mount.h>
-.LP
-.ft B
-getfh(path, fhp)
-char *path;
-struct fhandle_t *fhp;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Getfh
+.Dd 
+.Dt GETFH 2
+.Os BSD 4.4
+.Sh NAME
+.Nm getfh
+.Nd get file handle
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/mount.h>
+.Ft int
+.Fn getfh "char *path" "struct fhandle_t *fhp"
+.Sh DESCRIPTION
+.Fn Getfh
 returns a file handle for the specified file or directory
 in the file handle pointed to by
 returns a file handle for the specified file or directory
 in the file handle pointed to by
-.I fhp .
+.Fa fhp .
 This system call is restricted to the superuser.
 This system call is restricted to the superuser.
-.SH RETURN VALUE
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Upon successful completion, a value of 0 is returned.
-Otherwise, \-1 is returned and the global variable
-.I errno
+Otherwise, -1 is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Getfh
+.Sh ERRORS
+.Fn Getfh
 fails if one or more of the following are true:
 fails if one or more of the following are true:
-.TP 15
-ENOTDIR
+.Bl -tag -width Er
+.It Bq ENOTDIR
 A component of the path prefix of
 A component of the path prefix of
-.I path
+.Fa path
 is not a directory.
 is not a directory.
-.TP 15
-EINVAL
-.I path
+.It Bq EINVAL
+.Fa path
 contains a character with the high-order bit set.
 contains a character with the high-order bit set.
-.TP 15
-ENAMETOOLONG
+.It Bq ENAMETOOLONG
 The length of a component of
 The length of a component of
-.I path
+.Fa path
 exceeds 255 characters,
 or the length of
 exceeds 255 characters,
 or the length of
-.I path
+.Fa path
 exceeds 1023 characters.
 exceeds 1023 characters.
-.TP 15
-ENOENT
+.It Bq ENOENT
 The file referred to by
 The file referred to by
-.I path
+.Fa path
 does not exist.
 does not exist.
-.TP 15
-EACCES
+.It Bq EACCES
 Search permission is denied for a component of the path prefix of
 Search permission is denied for a component of the path prefix of
-.IR path .
-.TP 15
-ELOOP
+.Fa path .
+.It Bq ELOOP
 Too many symbolic links were encountered in translating
 Too many symbolic links were encountered in translating
-.IR path .
-.TP 15
-EFAULT
-.I Fhp
+.Fa path .
+.It Bq EFAULT
+.Fa Fhp
 points to an invalid address.
 points to an invalid address.
-.TP 15
-EIO
+.It Bq EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
+.El
+.Sh HISTORY
+The
+.Nm
+function call is currently under development.
index d7852d1..459e756 100644 (file)
@@ -1,55 +1,47 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getfsstat.2 6.4 (Berkeley) %G%
+.\"     @(#)getfsstat.2        6.5 (Berkeley) %G%
 .\"
 .\"
-.TH GETFSSTAT 2 ""
-.UC 7
-.SH NAME
-getfsstat \- get list of all mounted filesystems
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/mount.h>
-.LP
-.ft B
-getfsstat(buf, bufsize, flags)
-struct statfs *buf[];
-long bufsize;
-int flags;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Getfsstat
+.Dd 
+.Dt GETFSSTAT 2
+.Os BSD 4.4
+.Sh NAME
+.Nm getfsstat
+.Nd get list of all mounted filesystems
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/mount.h>
+.Ft int
+.Fn getfsstat "struct statfs *buf" "long bufsize" "int flags"
+.Sh DESCRIPTION
+.Fn Getfsstat
 returns information about all mounted filesystems.
 returns information about all mounted filesystems.
-.I Buf
-is a pointer to an array of
-.I statfs
+.Fa Buf
+is a pointer to
+.Xr statfs
 structures defined as follows:
 structures defined as follows:
-.IP
-.ta \w'#define\0\0'u +\w'fsid_t\0\0'u +\w'f_mntfromname[MNAMELEN]\0\0'u
-.nf
+.Bd -literal
 typedef quad fsid_t;
 typedef quad fsid_t;
-.sp 1
+
 #define MNAMELEN 32    /* length of buffer for returned name */
 #define MNAMELEN 32    /* length of buffer for returned name */
-.sp 1
+
 struct statfs {
 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_blocks;       /* total data blocks in filesystem */
-       long    f_bfree;        /* free blocks in fs */
-       long    f_bavail;       /* free blocks avail to non-superuser */
-       long    f_files;        /* total file nodes in filesystem */
-       long    f_ffree;        /* free file nodes in fs */
-       fsid_t  f_fsid; /* filesystem id */
-       long    f_spare[6];     /* spare for later */
-       char    f_mntonname[MNAMELEN];  /* directory on which mounted */
-       char    f_mntfromname[MNAMELEN];        /* mounted filesystem */
+    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_blocks;  /* total data blocks in filesystem */
+    long    f_bfree;   /* free blocks in fs */
+    long    f_bavail;  /* free blocks avail to non-superuser */
+    long    f_files;   /* total file nodes in filesystem */
+    long    f_ffree;   /* free file nodes in fs */
+    fsid_t  f_fsid;    /* filesystem id */
+    long    f_spare[6];        /* spare for later */
+    char    f_mntonname[MNAMELEN]; /* directory on which mounted */
+    char    f_mntfromname[MNAMELEN]; /* mounted filesystem */
 };
 /*
  * File system types.
 };
 /*
  * File system types.
@@ -57,50 +49,58 @@ struct statfs {
 #define        MOUNT_UFS       1
 #define        MOUNT_NFS       2
 #define        MOUNT_PC        3
 #define        MOUNT_UFS       1
 #define        MOUNT_NFS       2
 #define        MOUNT_PC        3
-.fi
-.PP
-Fields that are undefined for a particular filesystem are set to \-1.
+.Ed
+.Pp
+Fields that are undefined for a particular filesystem are set to -1.
 The buffer is filled with an array of
 The buffer is filled with an array of
-.I fsstat
+.Fa fsstat
 structures, one for each mounted filesystem
 up to the size specified by
 structures, one for each mounted filesystem
 up to the size specified by
-.I bufsize .
-.PP
+.Fa bufsize .
+.Pp
 If
 If
-.I buf
-is given as zero,
-.I getfsstat
+.Fa buf
+is given as NULL,
+.Fn getfsstat
 returns just the number of mounted filesystems.
 returns just the number of mounted filesystems.
-.PP
+.Pp
 Normally
 Normally
-.I flags
-should be specified as MNT_WAIT.
+.Fa flags
+should be specified as
+.Dv MNT_WAIT .
 If
 If
-.I flags
-is set to MNT_NOWAIT, then
-.I getfsstat
+.Fa flags
+is set to
+.Dv MNT_NOWAIT ,
+.Fn getfsstat
 will return the information it has available without requesting
 an update from each filesystem.
 Thus, some of the information will be out of date, but
 will return the information it has available without requesting
 an update from each filesystem.
 Thus, some of the information will be out of date, but
-.I getfsstat
+.Fn getfsstat
 will not block waiting for information from a filesystem that is
 unable to respond.
 will not block waiting for information from a filesystem that is
 unable to respond.
-.SH RETURN VALUE
+.Sh RETURN VALUES
 Upon successful completion, the number of 
 Upon successful completion, the number of 
-.I fsstat
+.Fa fsstat
 structures is returned.
 structures is returned.
-Otherwise, \-1 is returned and the global variable
-.I errno
+Otherwise, -1 is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Getfsstat
+.Sh ERRORS
+.Fn Getfsstat
 fails if one or more of the following are true:
 fails if one or more of the following are true:
-.TP 15
-EFAULT
-.I Buf
+.Bl -tag -width Er
+.It EFAULT
+.Fa Buf
 points to an invalid address.
 points to an invalid address.
-.TP 15
-EIO
+.It EIO
 An I/O error occurred while reading from or writing to the filesystem.
 An I/O error occurred while reading from or writing to the filesystem.
-.SH "SEE ALSO"
-statfs(2), fstab(5), mount(8)
+.El
+.Sh SEE ALSO
+.Xr statfs 2 ,
+.Xr fstab 5 ,
+.Xr mount 8
+.Sh HISTORY
+The
+.Nm
+function call is currently under development.
index 5d64571..8dfb228 100644 (file)
@@ -1,38 +1,53 @@
-.\" Copyright (c) 1983 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1983, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)getgid.2    6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH GETGID 2 ""
-.UC 5
-.SH NAME
-getgid, getegid \- get group identity
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-.PP
-.nf
-.ft B
-gid = getgid()
-gid_t gid;
-.PP
-.ft B
-egid = getegid()
-gid_t egid;
-.fi
-.SH DESCRIPTION
-.I Getgid
-returns the real group ID of the current process,
-.I getegid
-the effective group ID.
-.PP
+.\"     @(#)getgid.2   6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt GETGID 2
+.Os BSD 4.2
+.Sh NAME
+.Nm getgid ,
+.Nm getegid
+.Nd get group process identification
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Ft gid_t
+.Fn getgid void
+.Ft gid_t
+.Fn getegid void
+.Sh DESCRIPTION
+The
+.Fn getgid
+function returns the real group ID of the calling process,
+.Fn getegid
+returns the effective group ID of the calling process.
+.Pp
 The real group ID is specified at login time.
 The real group ID is specified at login time.
-.PP
-The effective group ID is more transient, and determines
-additional access permission during execution of a
-``set-group-ID'' process, and it is for such processes
-that \fIgetgid\fP is most useful.
-.SH "SEE ALSO"
-getuid(2), setregid(2), setgid(3)
+.Pp
+The real group ID is the group of the user who invoked the program.
+As the effective group ID gives the process additional permissions
+during the execution of
+.Dq Em set-group-ID
+mode processes,
+.Fn getgid
+is used to determine the real-user-id of the calling process.
+.Sh ERRORS
+The
+.Fn getgid
+and
+.Fn getegid
+functions are always successful, and no return value is reserved to
+indicate an error.
+.Sh SEE ALSO
+.Xr getuid 2 ,
+.Xr setregid 2 ,
+.Xr setgid 3
+.Sh STANDARDS
+.Fn Getgid
+and
+.Fn getegid
+conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index 7f3dfaf..b0ac324 100644 (file)
@@ -1,59 +1,70 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getgroups.2 6.6 (Berkeley) %G%
+.\"     @(#)getgroups.2        6.7 (Berkeley) %G%
 .\"
 .\"
-.TH GETGROUPS 2 ""
-.UC 5
-.SH NAME
-getgroups \- get group access list
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/param.h>
-.PP
-.ft B
-ngroups = getgroups(gidsetlen, gidset)
-int ngroups, gidsetlen, *gidset;
-.fi
-.SH DESCRIPTION
-.I Getgroups
+.Dd 
+.Dt GETGROUPS 2
+.Os BSD 4.2
+.Sh NAME
+.Nm getgroups
+.Nd get group access list
+.Sh SYNOPSIS
+.Fd #include <sys/param.h>
+.Fd #include <unistd.h>
+.Ft int
+.Fn getgroups "int gidsetlen" "int *gidset"
+.Sh DESCRIPTION
+.Fn Getgroups
 gets the current group access list of the user process
 and stores it in the array 
 gets the current group access list of the user process
 and stores it in the array 
-.IR gidset .
+.Fa gidset .
 The parameter
 The parameter
-.I gidsetlen
+.Fa gidsetlen
 indicates the number of entries that may be placed in 
 indicates the number of entries that may be placed in 
-.IR gidset.
-.I Getgroups
+.Fa gidset .
+.Fn Getgroups
 returns the actual number of groups returned in
 returns the actual number of groups returned in
-.IR gidset .
-No more than NGROUPS, as defined in
-.RI < sys/param.h >,
+.Fa gidset .
+No more than
+.Dv NGROUPS ,
+as defined in
+.Aq Pa sys/param.h ,
 will ever
 be returned.
 will ever
 be returned.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 A successful call returns the number of groups in the group set.
 A successful call returns the number of groups in the group set.
-A value of \-1 indicates that an error occurred, and the error
-code is stored in the global variable \fIerrno\fP\|.
-.SH "ERRORS
-The possible errors for \fIgetgroup\fP are:
-.TP 15
-[EINVAL]
+A value of -1 indicates that an error occurred, and the error
+code is stored in the global variable
+.Va errno .
+.Sh ERRORS
+The possible errors for
+.Fn getgroups
+are:
+.Bl -tag -width Er
+.It Bq Er EINVAL
 The argument
 The argument
-.I gidsetlen
+.Fa gidsetlen
 is smaller than the number of groups in the group set.
 is smaller than the number of groups in the group set.
-.TP
-[EFAULT]
-The argument \fIgidset\fP specifies
+.It Bq Er EFAULT
+The argument
+.Fa gidset
+specifies
 an invalid address.
 an invalid address.
-.SH "SEE ALSO
-setgroups(2), initgroups(3)
-.SH BUGS
+.El
+.Sh SEE ALSO
+.Xr setgroups 2 ,
+.Xr initgroups 3
+.Sh BUGS
 The
 The
-.I gidset
+.Fa gidset
 array should be of type
 array should be of type
-.BR gid_t ,
+.Vt gid_t ,
 but remains integer for compatibility with earlier systems.
 but remains integer for compatibility with earlier systems.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index a132423..7ddc75e 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getitimer.2 6.5 (Berkeley) %G%
+.\"     @(#)getitimer.2        6.6 (Berkeley) %G%
 .\"
 .\"
-.TH GETITIMER 2 ""
-.UC 5
-.SH NAME
-getitimer, setitimer \- get/set value of interval timer
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/time.h>
-.PP
-.ft B
-#define ITIMER_REAL    0       /* real time intervals */
-#define ITIMER_VIRTUAL 1       /* virtual time intervals */
-#define ITIMER_PROF    2       /* user and system virtual time */
-.sp
-.ft B
-getitimer(which, value)
-int which;
-struct itimerval *value;
-.PP
-.ft B
-setitimer(which, value, ovalue)
-int which;
-struct itimerval *value, *ovalue;
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt GETITIMER 2
+.Os BSD 4.2
+.Sh NAME
+.Nm getitimer ,
+.Nm setitimer
+.Nd get/set value of interval timer
+.Sh SYNOPSIS
+.Fd #include <sys/time.h>
+.Fd #define ITIMER_REAL                0
+.Fd #define ITIMER_VIRTUAL     1
+.Fd #define ITIMER_PROF                2
+.Ft int
+.Fn getitimer "int which" "struct itimerval *value"
+.Ft int
+.Fn setitimer "int which" "struct itimerval *value" "struct itimerval *ovalue"
+.Sh DESCRIPTION
 The system provides each process with three interval timers,
 defined in
 The system provides each process with three interval timers,
 defined in
-.RI < sys/time.h >.
+.Ao Pa sys/time.h Ac .
 The
 The
-.I getitimer
+.Fn getitimer
 call returns the current value for the timer specified in
 call returns the current value for the timer specified in
-.I which
+.Fa which
 in the structure at
 in the structure at
-.IR value .
+.Fa value .
 The
 The
-.I setitimer
+.Fn setitimer
 call sets a timer to the specified
 call sets a timer to the specified
-.I value
+.Fa value
 (returning the previous value of the timer if
 (returning the previous value of the timer if
-.I ovalue
-is nonzero).
-.PP
+.Fa ovalue
+is non-nil).
+.Pp
 A timer value is defined by the 
 A timer value is defined by the 
-.I itimerval
+.Fa itimerval
 structure:
 structure:
-.PP
-.nf
-.RS
-.DT
+.Bd -literal -offset indent
 struct itimerval {
        struct  timeval it_interval;    /* timer interval */
        struct  timeval it_value;       /* current value */
 };
 struct itimerval {
        struct  timeval it_interval;    /* timer interval */
        struct  timeval it_value;       /* current value */
 };
-.RE
-.fi
-.PP
+.Ed
+.Pp
 If
 If
-.I it_value
+.Fa it_value
 is non-zero, it indicates the time to the next timer expiration. 
 If
 is non-zero, it indicates the time to the next timer expiration. 
 If
-.I it_interval
+.Fa it_interval
 is non-zero, it specifies a value to be used in reloading 
 is non-zero, it specifies a value to be used in reloading 
-.I it_value
+.Fa it_value
 when the timer expires.
 Setting 
 when the timer expires.
 Setting 
-.I it_value
+.Fa it_value
 to 0 disables a timer.  Setting 
 to 0 disables a timer.  Setting 
-.I it_interval
+.Fa it_interval
 to 0 causes a timer to be disabled after its next expiration (assuming
 to 0 causes a timer to be disabled after its next expiration (assuming
-.I it_value
+.Fa it_value
 is non-zero).
 is non-zero).
-.PP
+.Pp
 Time values smaller than the resolution of the
 system clock are rounded up to this resolution
 Time values smaller than the resolution of the
 system clock are rounded up to this resolution
-(on the VAX, 10 milliseconds).
-.PP
-The ITIMER_REAL timer decrements in real time.  A SIGALRM signal is
+(typically 10 milliseconds).
+.Pp
+The
+.Dv ITIMER_REAL
+timer decrements in real time.  A
+.Dv SIGALRM
+signal is
 delivered when this timer expires.
 delivered when this timer expires.
-.PP
-The ITIMER_VIRTUAL timer decrements in process virtual time.
-It runs only when the process is executing.  A SIGVTALRM signal
+.Pp
+The
+.Dv ITIMER_VIRTUAL
+timer decrements in process virtual time.
+It runs only when the process is executing.  A
+.Dv SIGVTALRM
+signal
 is delivered when it expires.
 is delivered when it expires.
-.PP
-The ITIMER_PROF timer decrements both in process virtual time and
+.Pp
+The
+.Dv ITIMER_PROF
+timer decrements both in process virtual time and
 when the system is running on behalf of the process.  It is designed
 to be used by interpreters in statistically profiling the execution
 of interpreted programs.
 when the system is running on behalf of the process.  It is designed
 to be used by interpreters in statistically profiling the execution
 of interpreted programs.
-Each time the ITIMER_PROF timer expires, the SIGPROF signal is
+Each time the
+.Dv ITIMER_PROF
+timer expires, the
+.Dv SIGPROF
+signal is
 delivered.  Because this signal may interrupt in-progress
 system calls, programs using this timer must be prepared to
 restart interrupted system calls.
 delivered.  Because this signal may interrupt in-progress
 system calls, programs using this timer must be prepared to
 restart interrupted system calls.
-.SH NOTES
+.Sh NOTES
 Three macros for manipulating time values are defined in
 Three macros for manipulating time values are defined in
-.RI < sys/time.h >.
-.I Timerclear
+.Ao Pa sys/time.h Ac .
+.Fa Timerclear
 sets a time value to zero,
 sets a time value to zero,
-.I timerisset
+.Fa timerisset
 tests if a time value is non-zero, and
 tests if a time value is non-zero, and
-.I timercmp
+.Fa timercmp
 compares two time values (beware that >= and <= do not
 work with this macro).
 compares two time values (beware that >= and <= do not
 work with this macro).
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 If the calls succeed, a value of 0 is returned.  If an error occurs,
 If the calls succeed, a value of 0 is returned.  If an error occurs,
-the value \-1 is returned, and a more precise error code is placed
-in the global variable \fIerrno\fP.
-.SH "ERRORS
-The possible errors are:
-.TP 15
-[EFAULT]
-The \fIvalue\fP parameter specified a bad address.
-.TP 15
-[EINVAL]
-A \fIvalue\fP parameter specified a time was too large
+the value -1 is returned, and a more precise error code is placed
+in the global variable
+.Va errno .
+.Sh ERRORS
+.Fn Getitimer
+and
+.Fn setitimer
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EFAULT
+The
+.Fa value
+parameter specified a bad address.
+.It Bq Er EINVAL
+A
+.Fa value
+parameter specified a time was too large
 to be handled.
 to be handled.
-.SH "SEE ALSO"
-select(2), sigvec(2), gettimeofday(2)
+.El
+.Sh SEE ALSO
+.Xr select 2 ,
+.Xr sigvec 2 ,
+.Xr gettimeofday 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 3a3ada7..85a1194 100644 (file)
@@ -1,88 +1,99 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getlogin.2  6.1 (Berkeley) %G%
+.\"     @(#)getlogin.2 6.2 (Berkeley) %G%
 .\"
 .\"
-.TH GETLOGIN 2 ""
-.UC 5
-.SH NAME
-getlogin, setlogin \- get/set login name
-.SH SYNOPSIS
-.nf
-.ft B
-char *getlogin()
-.PP
-.ft B
-setlogin(name)
-char *name;
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt GETLOGIN 2
+.Os BSD 4.2
+.Sh NAME
+.Nm getlogin ,
+.Nm setlogin
+.Nd get/set login name
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft char *
+.Fn getlogin void
+.Ft int
+.Fn setlogin "const char *name"
+.Sh DESCRIPTION
 The
 The
-.I getlogin
+.Fn getlogin
 routine
 returns the login name of the user associated with the current session,
 as previously set by
 routine
 returns the login name of the user associated with the current session,
 as previously set by
-.IR setlogin .
+.Fn setlogin .
 The name is normally associated with a login shell
 at the time a session is created,
 and is inherited by all processes descended from the login shell.
 (This is true even if some of those processes assume another user ID,
 for example when
 The name is normally associated with a login shell
 at the time a session is created,
 and is inherited by all processes descended from the login shell.
 (This is true even if some of those processes assume another user ID,
 for example when
-.IR su (1)
+.Xr su 1
 is used.)
 is used.)
-.PP
-.I Setlogin
+.Pp
+.Fn Setlogin
 sets the login name of the user associated with the current session to
 sets the login name of the user associated with the current session to
-.IR name .
+.Fa name .
 This call is restricted to the super-user, and
 is normally used only when a new session is being created on behalf
 of the named user
 (for example, at login time, or when a remote shell is invoked).
 This call is restricted to the super-user, and
 is normally used only when a new session is being created on behalf
 of the named user
 (for example, at login time, or when a remote shell is invoked).
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 If a call to
 If a call to
-.I getlogin
+.Fn getlogin
 succeeds, it returns a pointer to a null-terminated string in a static buffer.
 If the name has not been set, it returns NULL.
 If a call to
 succeeds, it returns a pointer to a null-terminated string in a static buffer.
 If the name has not been set, it returns NULL.
 If a call to
-.I setlogin
+.Fn setlogin
 succeeds, a value of 0 is returned.  If
 succeeds, a value of 0 is returned.  If
-.I setlogin
-fails, then a value of \-1 is returned and an error code is
-placed in the global location \fIerrno\fP.
-.SH "ERRORS
+.Fn setlogin
+fails, a value of -1 is returned and an error code is
+placed in the global location
+.Va errno .
+.Sh ERRORS
 The following errors may be returned by these calls:
 The following errors may be returned by these calls:
-.TP 15
-[EFAULT]
-The \fIname\fP parameter gave an
+.Bl -tag -width Er
+.It Bq Er EFAULT
+The
+.Fa name
+parameter gave an
 invalid address.
 invalid address.
-.TP 15
-[EINVAL]
-The \fIname\fP parameter
+.It Bq Er EINVAL
+The
+.Fa name
+parameter
 pointed to a string that was too long.
 pointed to a string that was too long.
-Login names are limited to MAXLOGNAME (from
-.IR <sys/param.h> )
+Login names are limited to
+.Dv MAXLOGNAME
+(from
+.Ao Pa sys/param.h Ac )
 characters, currently 12.
 characters, currently 12.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The caller tried to set the login name and was not the super-user.
 The caller tried to set the login name and was not the super-user.
-.SH SEE ALSO
-setsid(2)
-.SH BUGS
+.El
+.Sh SEE ALSO
+.Xr setsid 2
+.Sh BUGS
 Login names are limited in length by
 Login names are limited in length by
-.IR setlogin .
+.Fn setlogin .
 However, lower limits are placed on login names elsewhere in the system
 However, lower limits are placed on login names elsewhere in the system
-(UT_NAMESIZE in
-.IR <utmp.h> ).
-.PP
+.Pf ( Dv UT_NAMESIZE
+in
+.Ao Pa utmp.h Ac ) .
+.Pp
 In earlier versions of the system,
 In earlier versions of the system,
-.I getlogin
+.Fn getlogin
 failed unless the process was associated with a login terminal.
 The current implementation (using
 failed unless the process was associated with a login terminal.
 The current implementation (using
-.IR setlogin )
+.Fn setlogin )
 allows getlogin to succeed even when the process has no controlling terminal.
 In earlier versions of the system, the value returned by
 allows getlogin to succeed even when the process has no controlling terminal.
 In earlier versions of the system, the value returned by
-.I getlogin
+.Fn getlogin
 could not be trusted without checking the user ID.
 Portable programs should probably still make this check.
 could not be trusted without checking the user ID.
 Portable programs should probably still make this check.
+.Sh HISTORY
+The
+.Nm
+function call is currently under development.
index 8607644..3352f16 100644 (file)
@@ -1,58 +1,63 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getpeername.2       6.4 (Berkeley) %G%
+.\"     @(#)getpeername.2      6.5 (Berkeley) %G%
 .\"
 .\"
-.TH GETPEERNAME 2 ""
-.UC 5
-.SH NAME
-getpeername \- get name of connected peer
-.SH SYNOPSIS
-.nf
-.PP
-.ft B
-getpeername(s, name, namelen)
-int s;
-struct sockaddr *name;
-int *namelen;
-.fi
-.SH DESCRIPTION
-.I Getpeername
+.Dd 
+.Dt GETPEERNAME 2
+.Os BSD 4.2
+.Sh NAME
+.Nm getpeername
+.Nd get name of connected peer
+.Sh SYNOPSIS
+.Ft int
+.Fn getpeername "int s" "struct sockaddr *name" "int *namelen"
+.Sh DESCRIPTION
+.Fn Getpeername
 returns the name of the peer connected to
 socket
 returns the name of the peer connected to
 socket
-.IR s .
+.Fa s .
 The
 The
-.I namelen
+.Fa namelen
 parameter should be initialized to indicate
 the amount of space pointed to by
 parameter should be initialized to indicate
 the amount of space pointed to by
-.IR name .
+.Fa name .
 On return it contains the actual size of the name
 returned (in bytes).
 The name is truncated if the buffer provided is too small.
 On return it contains the actual size of the name
 returned (in bytes).
 The name is truncated if the buffer provided is too small.
-.SH DIAGNOSTICS
-A 0 is returned if the call succeeds, \-1 if it fails.
-.SH ERRORS
+.Sh DIAGNOSTICS
+A 0 is returned if the call succeeds, -1 if it fails.
+.Sh ERRORS
 The call succeeds unless:
 The call succeeds unless:
-.TP 15
-[EBADF]
-The argument \fIs\fP is not a valid descriptor.
-.TP 15
-[ENOTSOCK]
-The argument \fIs\fP is a file, not a socket.
-.TP 15
-[ENOTCONN]
+.Bl -tag -width ENOTSOCKAA
+.It Bq Er EBADF
+The argument
+.Fa s
+is not a valid descriptor.
+.It Bq Er ENOTSOCK
+The argument
+.Fa s
+is a file, not a socket.
+.It Bq Er ENOTCONN
 The socket is not connected.
 The socket is not connected.
-.TP 15
-[ENOBUFS]
+.It Bq Er ENOBUFS
 Insufficient resources were available in the system
 to perform the operation.
 Insufficient resources were available in the system
 to perform the operation.
-.TP 15
-[EFAULT]
+.It Bq Er EFAULT
 The 
 The 
-.I name
+.Fa name
 parameter points to memory not in a valid part of the
 process address space.
 parameter points to memory not in a valid part of the
 process address space.
-.SH "SEE ALSO"
-accept(2), bind(2), socket(2), getsockname(2)
+.El
+.Sh SEE ALSO
+.Xr accept 2 ,
+.Xr bind 2 ,
+.Xr socket 2 ,
+.Xr getsockname 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 220a456..fe315ce 100644 (file)
@@ -1,42 +1,51 @@
-.\" Copyright (c) 1983 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1983, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)getpgrp.2   6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH GETPGRP 2 ""
-.UC 5
-.SH NAME
-getpgrp \- get process group
-.SH SYNOPSIS
-.ft B
-.nf
-pgrp = getpgrp(pid)
-int pgrp;
-int pid;
-.fi
-.ft R
-.SH DESCRIPTION
+.\"     @(#)getpgrp.2  6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt GETPGRP 2
+.Os BSD 4.2
+.Sh NAME
+.Nm getpgrp
+.Nd get process group
+.Sh SYNOPSIS
+.Ft pid_t
+.Fn getpgrp "int pid"
+.Sh DESCRIPTION
 The process group of the specified process is returned by
 The process group of the specified process is returned by
-.I getpgrp.
+.Fn getpgrp .
 If
 If
-.I pid
-is zero, then the call applies to the current process.
-.PP
+.Fa pid
+is zero, the call applies to the current process.
+.Pp
 Process groups are used for distribution of signals, and
 by terminals to arbitrate requests for their input: processes
 that have the same process group as the terminal are foreground
 and may read, while others will block with a signal if they attempt
 to read.
 Process groups are used for distribution of signals, and
 by terminals to arbitrate requests for their input: processes
 that have the same process group as the terminal are foreground
 and may read, while others will block with a signal if they attempt
 to read.
-.PP
+.Pp
 This call is thus used by programs such as
 This call is thus used by programs such as
-.IR csh (1)
+.Xr csh 1
 to create
 process groups
 in implementing job control.
 to create
 process groups
 in implementing job control.
-The TIOCGPGRP and TIOCSPGRP calls
+The
+.Dv TIOCGPGRP
+and
+.Dv TIOCSPGRP
+calls
 described in
 described in
-.IR tty (4)
+.Xr termios 4
 are used to get/set the process group of the control terminal.
 are used to get/set the process group of the control terminal.
-.SH "SEE ALSO"
-setpgrp(2), getuid(2), tty(4)
+.Sh SEE ALSO
+.Xr setpgrp 2 ,
+.Xr getuid 2 ,
+.Xr termios 4
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.0 .
index ac90ef9..5e21312 100644 (file)
@@ -1,33 +1,46 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)getpid.2    6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH GETPID 2 ""
-.UC 4
-.SH NAME
-getpid, getppid \- get process identification
-.SH SYNOPSIS
-.ft B
-.nf
-pid = getpid()
-int pid;
-.sp
-ppid = getppid()
-int ppid;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Getpid
+.\"     @(#)getpid.2   6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt GETPID 2
+.Os BSD 4
+.Sh NAME
+.Nm getpid ,
+.Nm getppid
+.Nd get parent or calling process identification
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft pid_t
+.Fn getpid void
+.Ft pid_t
+.Fn getppid void
+.Sh DESCRIPTION
+.Fn Getpid
 returns
 the process ID of
 returns
 the process ID of
-the current process.
-Most often it is used
-to generate uniquely-named temporary files.
-.PP
-.I Getppid
+the calling process.
+The ID is guaranteed to be unique and is
+useful for constructing temporary file names.
+.Pp
+.Fn Getppid
 returns the process ID of the parent
 returns the process ID of the parent
-of the current process. 
-.SH "SEE ALSO
-gethostid(2)
+of the calling process. 
+.Sh ERRORS
+The
+.Fn getpid
+and
+.Fn getppid
+functions are always successful, and no return value is reserved to
+indicate an error.
+.Sh SEE ALSO
+.Xr gethostid 2
+.Sh STANDARDS
+.Fn Getpid
+and
+.Fn getppid
+conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index e225836..b184023 100644 (file)
-.\" Copyright (c) 1980 The Regents of the University of California.
+.\" Copyright (c) 1980, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getpriority.2       6.8 (Berkeley) %G%
+.\"     @(#)getpriority.2      6.9 (Berkeley) %G%
 .\"
 .\"
-.TH GETPRIORITY 2 ""
-.UC 4
-.SH NAME
-getpriority, setpriority \- get/set program scheduling priority
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/time.h>
-#include <sys/resource.h>
-.PP
-.ft B
-prio = getpriority(which, who)
-int prio, which, who;
-.PP
-.ft B
-setpriority(which, who, prio)
-int which, who, prio;
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt GETPRIORITY 2
+.Os BSD 4
+.Sh NAME
+.Nm getpriority ,
+.Nm setpriority
+.Nd get/set program scheduling priority
+.Sh SYNOPSIS
+.Fd #include <sys/time.h>
+.Fd #include <sys/resource.h>
+.Ft int
+.Fn getpriority "int which" "int who"
+.Ft int
+.Fn setpriority "int which" "int who" "int prio"
+.Sh DESCRIPTION
 The scheduling
 priority of the process, process group, or user, as indicated by
 The scheduling
 priority of the process, process group, or user, as indicated by
-.I which
+.Fa which
 and
 and
-.I who
+.Fa who
 is obtained with the
 is obtained with the
-.I getpriority
+.Fn getpriority
 call and set with the
 call and set with the
-.I setpriority
+.Fn setpriority
 call.
 call.
-.I Which
-is one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER, and 
-.I who
+.Fa Which
+is one of
+.Dv PRIO_PROCESS ,
+.Dv PRIO_PGRP ,
+or
+.Dv PRIO_USER ,
+and 
+.Fa who
 is interpreted relative to 
 is interpreted relative to 
-.I which
-(a process identifier for PRIO_PROCESS, process group
-identifier for PRIO_PGRP, and a user ID for PRIO_USER).
+.Fa which
+(a process identifier for
+.Dv PRIO_PROCESS ,
+process group
+identifier for
+.Dv PRIO_PGRP ,
+and a user ID for
+.Dv PRIO_USER ) .
 A zero value of
 A zero value of
-.I who
+.Fa who
 denotes the current process, process group, or user.
 denotes the current process, process group, or user.
-.I Prio
-is a value in the range \-20 to 20.  The default priority is 0;
+.Fa Prio
+is a value in the range -20 to 20.  The default priority is 0;
 lower priorities cause more favorable scheduling.
 lower priorities cause more favorable scheduling.
-.PP
+.Pp
 The
 The
-.I getpriority
+.Fn getpriority
 call returns the highest priority (lowest numerical value)
 enjoyed by any of the specified processes.  The
 call returns the highest priority (lowest numerical value)
 enjoyed by any of the specified processes.  The
-.I setpriority
+.Fn setpriority
 call sets the priorities of all of the specified processes
 to the specified value.  Only the super-user may lower priorities.
 call sets the priorities of all of the specified processes
 to the specified value.  Only the super-user may lower priorities.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 Since
 Since
-.I getpriority
-can legitimately return the value \-1, it is necessary
-to clear the external variable \fIerrno\fP prior to the
+.Fn getpriority
+can legitimately return the value -1, it is necessary
+to clear the external variable
+.Va errno
+prior to the
 call, then check it afterward to determine
 call, then check it afterward to determine
-if a \-1 is an error or a legitimate value.
+if a -1 is an error or a legitimate value.
 The
 The
-.I setpriority
+.Fn setpriority
 call returns 0 if there is no error, or
 call returns 0 if there is no error, or
-\-1 if there is.
-.SH ERRORS
-.I Getpriority
+-1 if there is.
+.Sh ERRORS
+.Fn Getpriority
 and
 and
-.I setpriority
-may return one of the following errors:
-.TP 15
-[ESRCH]
+.Fn setpriority
+will fail if:
+.Bl -tag -width Er
+.It Bq Er ESRCH
 No process was located using the 
 No process was located using the 
-.I which
+.Fa which
 and
 and
-.I who
+.Fa who
 values specified.
 values specified.
-.TP 15
-[EINVAL]
-.I Which
-was not one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER.
-.PP
+.It Bq Er EINVAL
+.Fa Which
+was not one of
+.Dv PRIO_PROCESS ,
+.Dv PRIO_PGRP ,
+or
+.Dv PRIO_USER .
+.El
+.Pp
+.Bl -tag -width Er
 In addition to the errors indicated above,
 In addition to the errors indicated above,
-.I setpriority
-may fail with one of the following errors returned:
-.TP 15
-[EPERM]
+.Fn setpriority
+will fail if:
+.It Bq Er EPERM
 A process was located, but neither its effective nor real user
 ID matched the effective user ID of the caller.
 A process was located, but neither its effective nor real user
 ID matched the effective user ID of the caller.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 A non super-user attempted to lower a process priority.
 A non super-user attempted to lower a process priority.
-.SH "SEE ALSO"
-nice(1), fork(2), renice(8)
+.El
+.Sh SEE ALSO
+.Xr nice 1 ,
+.Xr fork 2 ,
+.Xr renice 8
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 99b2a7e..e924dc4 100644 (file)
-.\" Copyright (c) 1980 The Regents of the University of California.
+.\" Copyright (c) 1980, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getrlimit.2 6.6 (Berkeley) %G%
+.\"     @(#)getrlimit.2        6.7 (Berkeley) %G%
 .\"
 .\"
-.TH GETRLIMIT 2 ""
-.UC 4
-.SH NAME
-getrlimit, setrlimit \- control maximum system resource consumption
-.SH SYNOPSIS
-.ft B
-.nf
-#include <sys/time.h>
-#include <sys/resource.h>
-.PP
-.ft B
-getrlimit(resource, rlp)
-int resource;
-struct rlimit *rlp;
-.PP
-.ft B
-setrlimit(resource, rlp)
-int resource;
-struct rlimit *rlp;
-.fi
-.ft R
-.SH DESCRIPTION
+.Dd 
+.Dt GETRLIMIT 2
+.Os BSD 4
+.Sh NAME
+.Nm getrlimit ,
+.Nm setrlimit
+.Nd control maximum system resource consumption
+.Sh SYNOPSIS
+.Fd #include <sys/time.h>
+.Fd #include <sys/resource.h>
+.Ft int
+.Fn getrlimit "int resource" "struct rlimit *rlp"
+.Ft int
+.Fn setrlimit "int resource" "struct rlimit *rlp"
+.Sh DESCRIPTION
 Limits on the consumption of system resources by the current process
 and each process it creates may be obtained with the
 Limits on the consumption of system resources by the current process
 and each process it creates may be obtained with the
-.I getrlimit
+.Fn getrlimit
 call, and set with the
 call, and set with the
-.I setrlimit
+.Fn setrlimit
 call.  
 call.  
-.PP
+.Pp
 The
 The
-.I resource
+.Fa resource
 parameter is one of the following:
 parameter is one of the following:
-.TP 17
-RLIMIT_CPU
+.Bl -tag -width RLIMIT_FSIZEAA
+.It Dv RLIMIT_CPU
 the maximum amount of cpu time (in seconds) to be used by
 each process.
 the maximum amount of cpu time (in seconds) to be used by
 each process.
-.TP 17
-RLIMIT_FSIZE
+.It Dv RLIMIT_FSIZE
 the largest size, in bytes, of any single file that may be created.
 the largest size, in bytes, of any single file that may be created.
-.TP 17
-RLIMIT_DATA
+.It Dv 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
 the maximum size, in bytes, of the data segment for a process;
 this defines how far a program may extend its break with the
-.IR sbrk (2)
+.Xr sbrk 2
 system call.
 system call.
-.TP 17
-RLIMIT_STACK
+.It Dv 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.
 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.
-.TP 17
-RLIMIT_CORE
+.It Dv RLIMIT_CORE
 the largest size, in bytes, of a 
 the largest size, in bytes, of a 
-.I core
+.Xr core
 file that may be created.
 file that may be created.
-.TP 17
-RLIMIT_RSS
+.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.
 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.
-.PP
+.El
+.Pp
 A resource limit is specified as a soft limit and a hard limit.  When a
 soft limit is exceeded a process may receive a signal (for example, if
 the cpu time or file size is exceeded), but it will be allowed to
 continue execution until it reaches the hard limit (or modifies
 its resource limit).  The 
 A resource limit is specified as a soft limit and a hard limit.  When a
 soft limit is exceeded a process may receive a signal (for example, if
 the cpu time or file size is exceeded), but it will be allowed to
 continue execution until it reaches the hard limit (or modifies
 its resource limit).  The 
-.I rlimit
+.Em rlimit
 structure is used to specify the hard and soft limits on a resource,
 structure is used to specify the hard and soft limits on a resource,
-.PP
-.nf
-.RS
-.DT
+.Bd -literal -offset indent
 struct rlimit {
        int     rlim_cur;       /* current (soft) limit */
        int     rlim_max;       /* hard limit */
 };
 struct rlimit {
        int     rlim_cur;       /* current (soft) limit */
        int     rlim_max;       /* hard limit */
 };
-.RE
-.fi
-.PP
+.Ed
+.Pp
 Only the super-user may raise the maximum limits.  Other users
 may only alter 
 Only the super-user may raise the maximum limits.  Other users
 may only alter 
-.I rlim_cur
+.Fa rlim_cur
 within the range from 0 to 
 within the range from 0 to 
-.I rlim_max
+.Fa rlim_max
 or (irreversibly) lower
 or (irreversibly) lower
-.IR rlim_max .
-.PP
-An \*(lqinfinite\*(rq value for a limit is defined as RLIM_INFINITY
+.Fa rlim_max .
+.Pp
+An
+.Dq infinite
+value for a limit is defined as
+.Dv RLIM_INFINITY
 (0x7\&f\&f\&f\&f\&f\&f\&f).
 (0x7\&f\&f\&f\&f\&f\&f\&f).
-.PP
+.Pp
 Because this information is stored in the per-process information,
 this system call must be executed directly by the shell if it
 is to affect all future processes created by the shell;
 Because this information is stored in the per-process information,
 this system call must be executed directly by the shell if it
 is to affect all future processes created by the shell;
-.I limit
+.Ic limit
 is thus a built-in command to
 is thus a built-in command to
-.IR csh (1).
-.PP
+.Xr csh 1 .
+.Pp
 The system refuses to extend the data or stack space when the limits
 would be exceeded in the normal way: a
 The system refuses to extend the data or stack space when the limits
 would be exceeded in the normal way: a
-.I break
+.Xr break
 call fails if the data space limit is reached.
 When the stack limit is reached, the process receives
 call fails if the data space limit is reached.
 When the stack limit is reached, the process receives
-a segmentation fault (SIGSEGV); if this signal is not
+a segmentation fault
+.Pq Dv SIGSEGV ;
+if this signal is not
 caught by a handler using the signal stack, this signal
 will kill the process.
 caught by a handler using the signal stack, this signal
 will kill the process.
-.PP
+.Pp
 A file I/O operation that would create a file larger that the process'
 A file I/O operation that would create a file larger that the process'
-soft limit will cause the write to fail and a signal SIGXFSZ to be
+soft limit will cause the write to fail and a signal
+.Dv SIGXFSZ
+to be
 generated; this normally terminates the process, but may be caught.  When
 generated; this normally terminates the process, but may be caught.  When
-the soft cpu time limit is exceeded, a signal SIGXCPU is sent to the
+the soft cpu time limit is exceeded, a signal
+.Dv SIGXCPU
+is sent to the
 offending process.
 offending process.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 A 0 return value indicates that the call succeeded, changing
 A 0 return value indicates that the call succeeded, changing
-or returning the resource limit.   A return value of \-1 indicates
+or returning the resource limit.   A return value of -1 indicates
 that an error occurred, and an error code is stored in the global
 that an error occurred, and an error code is stored in the global
-location \fIerrno\fP.
-.SH "ERRORS
-The possible errors are:
-.TP 15
-[EFAULT]
-The address specified for \fIrlp\fP is invalid.
-.TP 15
-[EPERM]        The limit specified to \fIsetrlimit\fP would have
+location
+.Va errno .
+.Sh ERRORS
+.Fn Getrlimit
+and
+.Fn setrlimit
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EFAULT
+The address specified for
+.Fa rlp
+is invalid.
+.It Bq Er EPERM
+The limit specified to
+.Fn setrlimit
+would have
 raised the maximum limit value, and the caller is not the super-user.
 raised the maximum limit value, and the caller is not the super-user.
-.SH SEE ALSO
-csh(1), quota(2), sigvec(2), sigstack(2)
-.SH BUGS
+.El
+.Sh SEE ALSO
+.Xr csh 1 ,
+.Xr quota 2 ,
+.Xr sigvec 2 ,
+.Xr sigstack 2
+.Sh BUGS
 There should be 
 There should be 
-.I limit
+.Ic limit
 and
 and
-.I unlimit
+.Ic unlimit
 commands in
 commands in
-.IR sh (1)
+.Xr sh 1
 as well as in
 as well as in
-.IR csh.
+.Xr csh .
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 21e9766..55abeb1 100644 (file)
-.\" Copyright (c) 1985 The Regents of the University of California.
+.\" Copyright (c) 1985, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getrusage.2 6.8 (Berkeley) %G%
+.\"     @(#)getrusage.2        6.9 (Berkeley) %G%
 .\"
 .\"
-.TH GETRUSAGE 2 ""
-.UC 4
-.SH NAME
-getrusage \- get information about resource utilization
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/time.h>
-#include <sys/resource.h>
-.PP
-.ft B
-.ta \w'#define 'u +\w'RUSAGE_CHILDREN  'u +\w'-1        'u
-#define        RUSAGE_SELF     0       /* calling process */
-#define        RUSAGE_CHILDREN -1      /* terminated child processes */
-.DT
-.PP
-.ft B
-getrusage(who, rusage)
-int who;
-struct rusage *rusage;
-.fi
-.SH DESCRIPTION
-.I Getrusage
+.Dd 
+.Dt GETRUSAGE 2
+.Os BSD 4
+.Sh NAME
+.Nm getrusage
+.Nd get information about resource utilization
+.Sh SYNOPSIS
+.Fd #include <sys/time.h>
+.Fd #include <sys/resource.h>
+.Fd #define    RUSAGE_SELF      0
+.Fd #define    RUSAGE_CHILDREN -1
+.Ft int
+.Fn getrusage "int who" "struct rusage *rusage"
+.Sh DESCRIPTION
+.Fn Getrusage
 returns information describing the resources utilized by the current
 process, or all its terminated child processes.
 The
 returns information describing the resources utilized by the current
 process, or all its terminated child processes.
 The
-.I who
-parameter is either RUSAGE_SELF or RUSAGE_CHILDREN.
+.Fa who
+parameter is either
+.Dv RUSAGE_SELF
+or
+.Dv RUSAGE_CHILDREN .
 The buffer to which
 The buffer to which
-.I rusage
+.Fa rusage
 points will be filled in with
 the following structure:
 points will be filled in with
 the following structure:
-.PP
-.RS
-.nf
+.Bd -literal
 struct rusage {
 struct rusage {
-       struct timeval ru_utime;        /* user time used */
-       struct timeval ru_stime;        /* system time used */
-       long ru_maxrss;         /* integral max resident set size */
-       long ru_ixrss;                  /* integral shared text memory size */
-       long ru_idrss;                  /* integral unshared data size */
-       long ru_isrss;                  /* integral unshared stack size */
-       long ru_minflt;         /* page reclaims */
-       long ru_majflt;         /* page faults */
-       long ru_nswap;                  /* swaps */
-       long ru_inblock;                /* block input operations */
-       long ru_oublock;                /* block output operations */
-       long ru_msgsnd;         /* messages sent */
-       long ru_msgrcv;         /* messages received */
-       long ru_nsignals;               /* signals received */
-       long ru_nvcsw;                  /* voluntary context switches */
-       long ru_nivcsw;         /* involuntary context switches */
+        struct timeval ru_utime; /* user time used */
+        struct timeval ru_stime; /* system time used */
+        long ru_maxrss;          /* integral max resident set size */
+        long ru_ixrss;           /* integral shared text memory size */
+        long ru_idrss;           /* integral unshared data size */
+        long ru_isrss;           /* integral unshared stack size */
+        long ru_minflt;          /* page reclaims */
+        long ru_majflt;          /* page faults */
+        long ru_nswap;           /* swaps */
+        long ru_inblock;         /* block input operations */
+        long ru_oublock;         /* block output operations */
+        long ru_msgsnd;          /* messages sent */
+        long ru_msgrcv;          /* messages received */
+        long ru_nsignals;        /* signals received */
+        long ru_nvcsw;           /* voluntary context switches */
+        long ru_nivcsw;          /* involuntary context switches */
 };
 };
-.fi
-.RE
-.PP
+.Ed
+.Pp
 The fields are interpreted as follows:
 The fields are interpreted as follows:
-.TP 15
-ru_utime
+.Bl -tag -width ru_minfltaa
+.It Fa ru_utime
 the total amount of time spent executing in user mode.
 the total amount of time spent executing in user mode.
-.TP 15
-ru_stime
+.It Fa ru_stime
 the total amount of time spent in the system executing on behalf
 of the process(es).
 the total amount of time spent in the system executing on behalf
 of the process(es).
-.TP 15
-ru_maxrss
+.It Fa ru_maxrss
 the maximum resident set size utilized (in kilobytes).
 the maximum resident set size utilized (in kilobytes).
-.TP 15
-ru_ixrss
+.It Fa ru_ixrss
 an \*(lqintegral\*(rq value indicating the amount of memory used
 by the text segment
 that was also shared among other processes.  This value is expressed
 in units of kilobytes * ticks-of-execution.
 an \*(lqintegral\*(rq value indicating the amount of memory used
 by the text segment
 that was also shared among other processes.  This value is expressed
 in units of kilobytes * ticks-of-execution.
-.TP 15
-ru_idrss
+.It Fa ru_idrss
 an integral value of the amount of unshared memory residing in the
 data segment of a process (expressed in units of
 kilobytes * ticks-of-execution).
 an integral value of the amount of unshared memory residing in the
 data segment of a process (expressed in units of
 kilobytes * ticks-of-execution).
-.TP 15
-ru_isrss
+.It Fa ru_isrss
 an integral value of the amount of unshared memory residing in the
 stack segment of a process (expressed in units of
 kilobytes * ticks-of-execution).
 an integral value of the amount of unshared memory residing in the
 stack segment of a process (expressed in units of
 kilobytes * ticks-of-execution).
-.TP 15
-ru_minflt
+.It Fa ru_minflt
 the number of page faults serviced without any I/O activity; here
 I/O activity is avoided by \*(lqreclaiming\*(rq a page frame from
 the list of pages awaiting reallocation.
 the number of page faults serviced without any I/O activity; here
 I/O activity is avoided by \*(lqreclaiming\*(rq a page frame from
 the list of pages awaiting reallocation.
-.TP 15
-ru_majflt
+.It Fa ru_majflt
 the number of page faults serviced that required I/O activity.
 the number of page faults serviced that required I/O activity.
-.TP 15
-ru_nswap
+.It Fa ru_nswap
 the number of times a process was \*(lqswapped\*(rq out of main
 memory.
 the number of times a process was \*(lqswapped\*(rq out of main
 memory.
-.TP 15
-ru_inblock
+.It Fa ru_inblock
 the number of times the file system had to perform input.
 the number of times the file system had to perform input.
-.TP 15
-ru_oublock
+.It Fa ru_oublock
 the number of times the file system had to perform output.
 the number of times the file system had to perform output.
-.TP 15
-ru_msgsnd
+.It Fa ru_msgsnd
 the number of IPC messages sent.
 the number of IPC messages sent.
-.TP 15
-ru_msgrcv
+.It Fa ru_msgrcv
 the number of IPC messages received.
 the number of IPC messages received.
-.TP 15
-ru_nsignals
+.It Fa ru_nsignals
 the number of signals delivered.
 the number of signals delivered.
-.TP 15
-ru_nvcsw
+.It Fa ru_nvcsw
 the number of times a context switch resulted due to a process
 voluntarily giving up the processor before its time slice was
 completed (usually to await availability of a resource).
 the number of times a context switch resulted due to a process
 voluntarily giving up the processor before its time slice was
 completed (usually to await availability of a resource).
-.TP 15
-ru_nivcsw
+.It Fa ru_nivcsw
 the number of times a context switch resulted due to a higher
 priority process becoming runnable or because the current process
 exceeded its time slice.
 the number of times a context switch resulted due to a higher
 priority process becoming runnable or because the current process
 exceeded its time slice.
-.SH NOTES
+.El
+.Sh NOTES
 The numbers 
 The numbers 
-.I ru_inblock
+.Fa ru_inblock
 and 
 and 
-.I ru_oublock
+.Fa ru_oublock
 account only for real
 I/O; data supplied by the caching mechanism is charged only
 to the first process to read or write the data.
 account only for real
 I/O; data supplied by the caching mechanism is charged only
 to the first process to read or write the data.
-.SH ERRORS
-.I Getrusage
+.Sh ERRORS
+.Fn Getrusage
 returns -1 on error.
 The possible errors are:
 returns -1 on error.
 The possible errors are:
-.TP 15
-[EINVAL]
+.Bl -tag -width Er
+.It Bq Er EINVAL
 The
 The
-.I who
+.Fa who
 parameter is not a valid value.
 parameter is not a valid value.
-.TP 15
-[EFAULT]
+.It Bq Er EFAULT
 The address specified by the
 The address specified by the
-.I rusage
+.Fa rusage
 parameter is not in a valid part of the process address space.
 parameter is not in a valid part of the process address space.
-.SH SEE ALSO
-gettimeofday(2), wait(2)
-.SH BUGS
+.El
+.Sh SEE ALSO
+.Xr gettimeofday 2 ,
+.Xr wait 2
+.Sh BUGS
 There is no way to obtain information about a child process
 that has not yet terminated.
 There is no way to obtain information about a child process
 that has not yet terminated.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 8fc5f9a..5710eec 100644 (file)
@@ -1,57 +1,61 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getsockname.2       6.3 (Berkeley) %G%
+.\"     @(#)getsockname.2      6.4 (Berkeley) %G%
 .\"
 .\"
-.TH GETSOCKNAME 2 ""
-.UC 5
-.SH NAME
-getsockname \- get socket name
-.SH SYNOPSIS
-.nf
-.PP
-.ft B
-getsockname(s, name, namelen)
-int s;
-struct sockaddr *name;
-int *namelen;
-.fi
-.SH DESCRIPTION
-.I Getsockname
+.Dd 
+.Dt GETSOCKNAME 2
+.Os BSD 4.2
+.Sh NAME
+.Nm getsockname
+.Nd get socket name
+.Sh SYNOPSIS
+.Ft int
+.Fn getsockname "int s" "struct sockaddr *name" "int *namelen"
+.Sh DESCRIPTION
+.Fn Getsockname
 returns the current 
 returns the current 
-.I name
+.Fa name
 for the specified socket.  The
 for the specified socket.  The
-.I namelen
+.Fa namelen
 parameter should be initialized to indicate
 the amount of space pointed to by
 parameter should be initialized to indicate
 the amount of space pointed to by
-.IR name .
+.Fa name .
 On return it contains the actual size of the name
 returned (in bytes).
 On return it contains the actual size of the name
 returned (in bytes).
-.SH DIAGNOSTICS
-A 0 is returned if the call succeeds, \-1 if it fails.
-.SH ERRORS
+.Sh DIAGNOSTICS
+A 0 is returned if the call succeeds, -1 if it fails.
+.Sh ERRORS
 The call succeeds unless:
 The call succeeds unless:
-.TP 15
-[EBADF]
-The argument \fIs\fP is not a valid descriptor.
-.TP 15
-[ENOTSOCK]
-The argument \fIs\fP is a file, not a socket.
-.TP 15
-[ENOBUFS]
+.Bl -tag -width ENOTSOCKAA
+.It Bq Er EBADF
+The argument
+.Fa s
+is not a valid descriptor.
+.It Bq Er ENOTSOCK
+The argument
+.Fa s
+is a file, not a socket.
+.It Bq Er ENOBUFS
 Insufficient resources were available in the system
 to perform the operation.
 Insufficient resources were available in the system
 to perform the operation.
-.TP 15
-[EFAULT]
+.It Bq Er EFAULT
 The 
 The 
-.I name
+.Fa name
 parameter points to memory not in a valid part of the
 process address space.
 parameter points to memory not in a valid part of the
 process address space.
-.SH "SEE ALSO"
-bind(2), socket(2)
-.SH BUGS
+.El
+.Sh SEE ALSO
+.Xr bind 2 ,
+.Xr socket 2
+.Sh BUGS
 Names bound to sockets in the UNIX domain are inaccessible;
 Names bound to sockets in the UNIX domain are inaccessible;
-.I getsockname
+.Xr getsockname
 returns a zero length name.
 returns a zero length name.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index f3fb069..1a16690 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)getsockopt.2        6.6 (Berkeley) %G%
+.\"     @(#)getsockopt.2       6.7 (Berkeley) %G%
 .\"
 .\"
-.TH GETSOCKOPT 2 ""
-.UC 5
-.SH NAME
-getsockopt, setsockopt \- get and set options on sockets
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/socket.h>
-.PP
-.ft B
-getsockopt(s, level, optname, optval, optlen)
-int s, level, optname;
-char *optval;
-int *optlen;
-.sp
-setsockopt(s, level, optname, optval, optlen)
-int s, level, optname;
-char *optval;
-int optlen;
-.fi
-.SH DESCRIPTION
-.I Getsockopt
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" %sccs.include.redist.man%
+.\"
+.\"     @(#)getsockopt.2       6.7 (Berkeley) %G%
+.\"
+.Dd 
+.Dt GETSOCKOPT 2
+.Os BSD 4.2
+.Sh NAME
+.Nm getsockopt ,
+.Nm setsockopt
+.Nd get and set options on sockets
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/socket.h>
+.Ft int
+.Fn getsockopt "int s" "int level" "int optname" "char *optval" "int *optlen"
+.Ft int
+.Fn setsockopt "int s" "int level" "int optname" "char *optval" "int optlen"
+.Sh DESCRIPTION
+.Fn Getsockopt
 and
 and
-.I setsockopt
-manipulate
-.I options
+.Fn setsockopt
+manipulate the
+.Em options
 associated with a socket.  Options may exist at multiple
 protocol levels; they are always present at the uppermost
 associated with a socket.  Options may exist at multiple
 protocol levels; they are always present at the uppermost
-``socket'' level.
-.PP
+.Dq socket
+level.
+.Pp
 When manipulating socket options the level at which the
 option resides and the name of the option must be specified.
 When manipulating socket options the level at which the
 option resides and the name of the option must be specified.
-To manipulate options at the ``socket'' level,
-.I level
-is specified as SOL_SOCKET.  To manipulate options at any
+To manipulate options at the socket level,
+.Fa level
+is specified as
+.Dv SOL_SOCKET .
+To manipulate options at any
 other level the protocol number of the appropriate protocol
 controlling the option is supplied.  For example,
 other level the protocol number of the appropriate protocol
 controlling the option is supplied.  For example,
-to indicate that an option is to be interpreted by the TCP protocol,
-.I level
-should be set to the protocol number of TCP; see
-.IR getprotoent (3N).
-.PP
+to indicate that an option is to be interpreted by the
+.Tn TCP
+protocol,
+.Fa level
+should be set to the protocol number of
+.Tn TCP ;
+see
+.Xr getprotoent 3 .
+.Pp
 The parameters
 The parameters
-.I optval
+.Fa optval
 and
 and
-.I optlen
+.Fa optlen
 are used to access option values for
 are used to access option values for
-.IR setsockopt .
+.Fn setsockopt .
 For
 For
-.I getsockopt
+.Fn getsockopt
 they identify a buffer in which the value for the
 requested option(s) are to be returned.  For
 they identify a buffer in which the value for the
 requested option(s) are to be returned.  For
-.IR getsockopt ,
-.I optlen
+.Fn getsockopt ,
+.Fa optlen
 is a value-result parameter, initially containing the
 size of the buffer pointed to by
 is a value-result parameter, initially containing the
 size of the buffer pointed to by
-.IR optval ,
+.Fa optval ,
 and modified on return to indicate the actual size of
 the value returned.  If no option value is
 to be supplied or returned,
 and modified on return to indicate the actual size of
 the value returned.  If no option value is
 to be supplied or returned,
-.I optval
-may be supplied as 0.
-.PP
-.I Optname
+.Fa optval
+may be NULL.
+.Pp
+.Fa Optname
 and any specified options are passed uninterpreted to the appropriate
 protocol module for interpretation.
 The include file
 and any specified options are passed uninterpreted to the appropriate
 protocol module for interpretation.
 The include file
-.RI < sys/socket.h >
-contains definitions for ``socket'' level options, described below.
+.Ao Pa sys/socket.h Ac
+contains definitions for
+socket level options, described below.
 Options at other protocol levels vary in format and
 Options at other protocol levels vary in format and
-name; consult the appropriate entries in section (4P).
-.PP
+name; consult the appropriate entries in
+section
+4 of the manual.
+.Pp
 Most socket-level options take an
 Most socket-level options take an
-.I int
+.Fa int
 parameter for
 parameter for
-.IR optval .
+.Fa optval .
 For
 For
-.IR setsockopt ,
-the parameter should non-zero to enable a boolean option,
+.Fn setsockopt ,
+the parameter should be non-zero to enable a boolean option,
 or zero if the option is to be disabled.
 or zero if the option is to be disabled.
-SO_LINGER uses a
-.I struct linger
+.Dv SO_LINGER
+uses a
+.Fa struct linger
 parameter, defined in
 parameter, defined in
-.RI < sys/socket.h >,
+.Ao Pa sys/socket.h Ac ,
 which specifies the desired state of the option and the
 linger interval (see below).
 which specifies the desired state of the option and the
 linger interval (see below).
-.PP
+.Pp
 The following options are recognized at the socket level.
 Except as noted, each may be examined with
 The following options are recognized at the socket level.
 Except as noted, each may be examined with
-.I getsockopt
+.Fn getsockopt
 and set with
 and set with
-.IR setsockopt .
-.PP
-.RS
-.ta \w'SO_BROADCAST\ \ \ \ 'u
-.nf
-SO_DEBUG       toggle recording of debugging information
-SO_REUSEADDR   toggle local address reuse
-SO_KEEPALIVE   toggle keep connections alive
-SO_DONTROUTE   toggle routing bypass for outgoing messages
-SO_LINGER      linger on close if data present
-SO_BROADCAST   toggle permission to transmit broadcast messages
-SO_OOBINLINE   toggle reception of out-of-band data in band
-SO_SNDBUF      set buffer size for output
-SO_RCVBUF      set buffer size for input
-SO_TYPE        get the type of the socket (get only)
-SO_ERROR       get and clear error on the socket (get only)
-.fi
-.RE
-.PP
-SO_DEBUG enables debugging in the underlying protocol modules.
-SO_REUSEADDR indicates that the rules used in validating addresses supplied
+.Fn setsockopt .
+.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_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
+.It Dv SO_BROADCAST Ta enables permission to transmit broadcast messages
+.It Dv SO_OOBINLINE Ta enables reception of out-of-band data in band
+.It Dv SO_SNDBUF Ta set buffer size for output
+.It Dv SO_RCVBUF Ta set buffer size for input
+.It Dv SO_TYPE Ta get the type of the socket (get only)
+.It Dv SO_ERROR Ta get and clear error on the socket (get only)
+.El
+.Pp
+.Dv SO_DEBUG
+enables debugging in the underlying protocol modules.
+.Dv SO_REUSEADDR
+indicates that the rules used in validating addresses supplied
 in a
 in a
-.IR bind (2)
-call should allow reuse of local addresses.  SO_KEEPALIVE enables the
+.Xr bind 2
+call should allow reuse of local addresses.
+.Dv SO_KEEPALIVE
+enables the
 periodic transmission of messages on a connected socket.  Should the
 connected party fail to respond to these messages, the connection is
 considered broken and processes using the socket are notified via a
 periodic transmission of messages on a connected socket.  Should the
 connected party fail to respond to these messages, the connection is
 considered broken and processes using the socket are notified via a
-SIGPIPE signal.  SO_DONTROUTE indicates that outgoing messages should
+.Dv SIGPIPE
+signal.
+.Dv SO_DONTROUTE
+indicates that outgoing messages should
 bypass the standard routing facilities.  Instead, messages are directed
 to the appropriate network interface according to the network portion
 of the destination address.
 bypass the standard routing facilities.  Instead, messages are directed
 to the appropriate network interface according to the network portion
 of the destination address.
-.PP
-SO_LINGER controls the action taken when unsent messags
+.Pp
+.Dv SO_LINGER
+controls the action taken when unsent messags
 are queued on socket and a 
 are queued on socket and a 
-.IR close (2)
+.Xr close 2
 is performed.
 is performed.
-If the socket promises reliable delivery of data and SO_LINGER is set,
+If the socket promises reliable delivery of data and
+.Dv SO_LINGER is set,
 the system will block the process on the 
 the system will block the process on the 
-.I close
+.Xr close
 attempt until it is able to transmit the data or until it decides it
 is unable to deliver the information (a timeout period, termed the
 linger interval, is specified in the
 attempt until it is able to transmit the data or until it decides it
 is unable to deliver the information (a timeout period, termed the
 linger interval, is specified in the
-.IR setsockopt 
-call when SO_LINGER is requested). 
-If SO_LINGER is disabled and a 
-.I close
+.Fn setsockopt
+call when
+.Dv SO_LINGER
+is requested). 
+If
+.Dv SO_LINGER
+is disabled and a 
+.Xr close
 is issued, the system will process the close in a manner that allows
 the process to continue as quickly as possible.
 is issued, the system will process the close in a manner that allows
 the process to continue as quickly as possible.
-.PP
-The option SO_BROADCAST requests permission to send broadcast datagrams
+.Pp
+The option
+.Dv SO_BROADCAST
+requests permission to send broadcast datagrams
 on the socket.
 Broadcast was a privileged operation in earlier versions of the system.
 on the socket.
 Broadcast was a privileged operation in earlier versions of the system.
-With protocols that support out-of-band data, the SO_OOBINLINE option
+With protocols that support out-of-band data, the
+.Dv SO_OOBINLINE
+option
 requests that out-of-band data be placed in the normal data input queue
 as received; it will then be accessible with
 requests that out-of-band data be placed in the normal data input queue
 as received; it will then be accessible with
-.I recv
+.Xr recv
 or
 or
-.I read
-calls without the MSG_OOB flag.
-SO_SNDBUF and SO_RCVBUF are options to adjust the normal
+.Xr read
+calls without the
+.Dv MSG_OOB
+flag.
+.Dv SO_SNDBUF
+and
+.Dv SO_RCVBUF
+are options to adjust the normal
 buffer sizes allocated for output and input buffers, respectively.
 The buffer size may be increased for high-volume connections,
 or may be decreased to limit the possible backlog of incoming data.
 The system places an absolute limit on these values.
 buffer sizes allocated for output and input buffers, respectively.
 The buffer size may be increased for high-volume connections,
 or may be decreased to limit the possible backlog of incoming data.
 The system places an absolute limit on these values.
-Finally, SO_TYPE and SO_ERROR are options used only with
-.IR setsockopt .
-SO_TYPE returns the type of the socket, such as SOCK_STREAM;
+Finally,
+.Dv SO_TYPE
+and
+.Dv SO_ERROR
+are options used only with
+.Fn setsockopt .
+.Dv SO_TYPE
+returns the type of the socket, such as
+.Dv SOCK_STREAM ;
 it is useful for servers that inherit sockets on startup.
 it is useful for servers that inherit sockets on startup.
-SO_ERROR returns any pending error on the socket and clears
+.Dv SO_ERROR
+returns any pending error on the socket and clears
 the error status.
 It may be used to check for asynchronous errors on connected
 datagram sockets or for other asynchronous errors.
 the error status.
 It may be used to check for asynchronous errors on connected
 datagram sockets or for other asynchronous errors.
-.SH "RETURN VALUE"
-A 0 is returned if the call succeeds, \-1 if it fails.
-.SH ERRORS
+.Sh RETURN VALUES
+A 0 is returned if the call succeeds, -1 if it fails.
+.Sh ERRORS
 The call succeeds unless:
 The call succeeds unless:
-.TP 20
-[EBADF]
-The argument \fIs\fP is not a valid descriptor.
-.TP 20
-[ENOTSOCK]
-The argument \fIs\fP is a file, not a socket.
-.TP 20
-[ENOPROTOOPT]
+.Bl -tag -width ENOPROTOOPTAA
+.It Bq Er EBADF
+The argument
+.Fa s
+is not a valid descriptor.
+.It Bq Er ENOTSOCK
+The argument
+.Fa s
+is a file, not a socket.
+.It Bq Er ENOPROTOOPT
 The option is unknown at the level indicated.
 The option is unknown at the level indicated.
-.TP 20
-[EFAULT]
+.It Bq Er EFAULT
 The address pointed to by 
 The address pointed to by 
-.I optval
+.Fa optval
 is not in a valid part of the process address space.
 For
 is not in a valid part of the process address space.
 For
-.IR getsockopt ,
+.Fn getsockopt ,
 this error may also be returned if
 this error may also be returned if
-.I optlen
+.Fa optlen
 is not in a valid part of the process address space.
 is not in a valid part of the process address space.
-.SH "SEE ALSO"
-ioctl(2), socket(2), getprotoent(3N)
-.SH BUGS
+.El
+.Sh SEE ALSO
+.Xr ioctl 2 ,
+.Xr socket 2 ,
+.Xr getprotoent 3
+.Xr protocols 5
+.Sh BUGS
 Several of the socket options should be handled at lower levels of the system.
 Several of the socket options should be handled at lower levels of the system.
+.Sh HISTORY
+The
+.Nm
+system call appeared in
+.Bx 4.2 .
index bc6d1b3..136cc11 100644 (file)
@@ -1,81 +1,93 @@
-.\" Copyright (c) 1980 The Regents of the University of California.
+.\" Copyright (c) 1980, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)gettimeofday.2      6.10 (Berkeley) %G%
+.\"     @(#)gettimeofday.2     6.11 (Berkeley) %G%
 .\"
 .\"
-.TH GETTIMEOFDAY 2 ""
-.UC 4
-.SH NAME
-gettimeofday, settimeofday \- get/set date and time
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/time.h>
-.PP
-.ft B
-gettimeofday(tp, tzp)
-struct timeval *tp;
-struct timezone *tzp;
-.PP
-.ft B
-settimeofday(tp, tzp)
-struct timeval *tp;
-struct timezone *tzp;
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt GETTIMEOFDAY 2
+.Os BSD 4
+.Sh NAME
+.Nm gettimeofday ,
+.Nm settimeofday
+.Nd get/set date and time
+.Sh SYNOPSIS
+.Fd #include <sys/time.h>
+.Ft int
+.Fn gettimeofday "struct timeval *tp" "struct timezone *tzp"
+.Ft int
+.Fn settimeofday "struct timeval *tp" "struct timezone *tzp"
+.Sh DESCRIPTION
+.Bf -symbolic
+Note: timezone is no longer used; this information is kept outside
+the kernel.
+.Ef
 The system's notion of the current Greenwich time and the current time
 The system's notion of the current Greenwich time and the current time
-zone is obtained with the \fIgettimeofday\fP call, and set with the
-\fIsettimeofday\fP call.  The time is expressed in seconds and microseconds
+zone is obtained with the
+.Fn gettimeofday
+call, and set with the
+.Fn settimeofday
+call.  The time is expressed in seconds and microseconds
 since midnight (0 hour), January 1, 1970.  The resolution of the system
 clock is hardware dependent, and the time may be updated continuously or
 since midnight (0 hour), January 1, 1970.  The resolution of the system
 clock is hardware dependent, and the time may be updated continuously or
-in ``ticks.''  If \fItp\fP or \fItzp\fP is NULL, the associated time
+in ``ticks.''  If
+.Fa tp
+or
+.Fa tzp
+is NULL, the associated time
 information will not be returned or set.
 information will not be returned or set.
-.PP
+.Pp
 The structures pointed to by
 The structures pointed to by
-.I tp
+.Fa tp
 and
 and
-.I tzp
+.Fa tzp
 are defined in 
 are defined in 
-.I <sys/time.h>
+.Ao Pa sys/time.h Ac
 as:
 as:
-.PP
-.nf
-.RS
-.DT
+.Pp
+.Bd -literal
 struct timeval {
        long    tv_sec;         /* seconds since Jan. 1, 1970 */
 struct timeval {
        long    tv_sec;         /* seconds since Jan. 1, 1970 */
-       long    tv_usec;                /* and microseconds */
+       long    tv_usec;        /* and microseconds */
 };
 };
-.sp 1
+
 struct timezone {
 struct timezone {
-       int     tz_minuteswest; /* of Greenwich */
+       int     tz_minuteswest; /* of Greenwich */
        int     tz_dsttime;     /* type of dst correction to apply */
 };
        int     tz_dsttime;     /* type of dst correction to apply */
 };
-.RE
-.fi
-.PP
+.Ed
+.Pp
 The 
 The 
-.I timezone
+.Fa timezone
 structure indicates the local time zone
 (measured in minutes of time westward from Greenwich),
 and a flag that, if nonzero, indicates that
 Daylight Saving time applies locally during
 the appropriate part of the year.
 structure indicates the local time zone
 (measured in minutes of time westward from Greenwich),
 and a flag that, if nonzero, indicates that
 Daylight Saving time applies locally during
 the appropriate part of the year.
-.PP
+.Pp
 Only the super-user may set the time of day or time zone.
 Only the super-user may set the time of day or time zone.
-.SH RETURN
+.Sh RETURN
 A 0 return value indicates that the call succeeded.
 A 0 return value indicates that the call succeeded.
-A \-1 return value indicates an error occurred, and in this
-case an error code is stored into the global variable \fIerrno\fP.
-.SH "ERRORS
-The following error codes may be set in \fIerrno\fP:
-.TP 15
-[EFAULT]
+A -1 return value indicates an error occurred, and in this
+case an error code is stored into the global variable
+.Va errno .
+.Sh ERRORS
+The following error codes may be set in
+.Va errno :
+.Bl -tag -width [EFAULT]
+.It Bq Er EFAULT
 An argument address referenced invalid memory.
 An argument address referenced invalid memory.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 A user other than the super-user attempted to set the time.
 A user other than the super-user attempted to set the time.
-.SH "SEE ALSO"
-date(1), adjtime(2), ctime(3), timed(8)
+.El
+.Sh SEE ALSO
+.Xr date 1 ,
+.Xr adjtime 2 ,
+.Xr ctime 3 ,
+.Xr timed 8
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 5a5c06f..b40df34 100644 (file)
@@ -1,38 +1,54 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)getuid.2    6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH GETUID 2 ""
-.UC 4
-.SH NAME
-getuid, geteuid \- get user identity
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-.PP
-.ft B
-.nf
-uid = getuid()
-uid_t uid;
-.PP
-.ft B
-euid = geteuid()
-uid_t euid;
-.fi
-.SH DESCRIPTION
-.I Getuid
-returns the real user ID of the current process,
-.I geteuid
-the effective user ID.
-.PP
-The real user ID identifies the person who is logged in.
-The effective user ID
+.\"     @(#)getuid.2   6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt GETUID 2
+.Os BSD 4
+.Sh NAME
+.Nm getuid ,
+.Nm geteuid
+.Nd get user identification
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Fd #include <sys/types.h>
+.Ft uid_t
+.Fn getuid void
+.Ft uid_t
+.Fn geteuid void
+.Sh DESCRIPTION
+The
+.Fn getuid
+function returns the real user ID of the calling process.
+The
+.Fn geteuid
+function
+returns the effective user ID of the calling process.
+.Pp
+The real user ID is that of the user who has invoked the program.
+As the effective user ID
 gives the process additional permissions during
 gives the process additional permissions during
-execution of \*(lqset-user-ID\*(rq mode processes, which use
-\fIgetuid\fP to determine the real-user-id of the process that
-invoked them.
-.SH "SEE ALSO"
-getgid(2), setreuid(2)
+execution of
+.Dq Em set-user-ID
+mode processes,
+.Fn getuid
+is used to determine the real-user-id of the calling process.
+.Sh ERRORS
+The
+.Fn getuid
+and
+.Fn geteuid
+functions are always successful, and no return value is reserved to
+indicate an error.
+.Sh SEE ALSO
+.Xr getgid 2 ,
+.Xr setreuid 2
+.Sh STANDARDS
+.Fn Geteuid
+and
+.Fn getuid
+conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index b2d838f..4f567c1 100644 (file)
-.\" Copyright (c) 1980,1983,1986 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980,1983,1986,1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)intro.2     6.10 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH INTRO 2 ""
-.UC 4
-.de en
-.HP
-\\$1  \\$2  \\$3
-.br
-..
-.SH NAME
-intro \- introduction to system calls and error numbers
-.SH SYNOPSIS
-.B #include <sys/errno.h>
-.SH DESCRIPTION
+.\"     @(#)intro.2    6.11 (Berkeley) %G%
+.\"
+.Dd 
+.Dt INTRO 2
+.Os BSD 4
+.Sh NAME
+.Nm intro
+.Nd introduction to system calls and error numbers
+.Sh SYNOPSIS
+.Fd #include <sys/errno.h>
+.Sh DESCRIPTION
 This section provides an overview of the system calls,
 their error returns, and other common definitions and concepts.
 This section provides an overview of the system calls,
 their error returns, and other common definitions and concepts.
-.\".LP
-.\".B "System call restart"
-.\".PP
+.\".Pp
+.\".Sy System call restart
+.\".Pp
 .\"<more later...>
 .\"<more later...>
-.SH DIAGNOSTICS
-Most of these calls have one or more error returns.
-An error condition is indicated by an otherwise impossible return
-value.  This is almost always \-1; the individual descriptions
-specify the details.
+.Sh DIAGNOSTICS
+Nearly all of the system calls provide an error number in the external
+variable
+.Va errno ,
+which is defined as:
+.Pp
+.Dl extern int errno
+.Pp
+When a system call detects an error,
+it returns an integer value
+indicating failure (usually -1)
+and sets the variable
+.Va errno
+accordingly.
+<This allows interpretation of the failure on receiving
+a -1 and to take action accordingly.>
+Successful calls never set
+.Va errno ;
+once set, it remains until another error occurs.
+It should only be examined after an error.
 Note that a number of system calls overload the meanings of these
 error numbers, and that the meanings must be interpreted according
 to the type and circumstances of the call.
 Note that a number of system calls overload the meanings of these
 error numbers, and that the meanings must be interpreted according
 to the type and circumstances of the call.
-.PP
-As with normal arguments, all return codes and values from
-functions are of type integer unless otherwise noted.
-An error number is also made available in the external
-variable \fIerrno\fP, which is not cleared
-on successful calls.
-Thus \fIerrno\fP should be tested only after an error has occurred.
-.PP
+.Pp
 The following is a complete list of the errors and their
 names as given in
 The following is a complete list of the errors and their
 names as given in
-.RI < sys/errno.h >.
-.en 0 \h'\w'EIO'u' "Error 0
-Unused.
-.en 1 EPERM "Operation not permitted
-Typically this error indicates
-an attempt to modify a file in some way forbidden
-except to its owner or super-user.
-It is also returned for attempts
-by ordinary users to do things
-allowed only to the super-user.
-.en 2 ENOENT "No such file or directory
-This error occurs when a file name is specified
-and the file should exist but doesn't, or when one
-of the directories in a path name does not exist.
-.en 3 ESRCH "No such process
-The process or process group whose number was given
-does not exist, or any such process is already dead.
-.en 4 EINTR "Interrupted system call
-An asynchronous signal (such as interrupt or quit)
-that the user has elected to catch
-occurred during a system call.
-If execution is resumed
-after processing the signal
-and the system call is not restarted,
-it will appear as if the interrupted system call
-returned this error condition.
-.en 5 EIO "Input/output error
-Some physical I/O error occurred during a
-.I read
+.Aq Pa sys/errno.h .
+.Bl -hang -width Ds
+.It Er 0 Em "Error 0" .
+Not used.
+.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.
+.It Er 2 ENOENT Em "No such file or directory" .
+A component of a specified pathname did not exist, or the 
+pathname was an empty string.
+.It Er 3 ESRCH Em "No such process" .
+No process could be found corresponding to that specified by the given
+process ID.
+.It Er 4 EINTR Em "Interrupted function call" .
+An asynchronous signal (such as
+.Dv SIGINT
 or
 or
-.IR write .
-This error may in some cases occur
-on a call following the one to which it actually applies.
-.en 6 ENXIO "Device not configured
-I/O on a special file refers to a subdevice that does not
-exist,
-or beyond the limits of the device.
-It may also occur when, for example, an illegal tape drive
-unit number is selected 
-or a disk pack is not loaded on a drive.
-.en 7 E2BIG "Argument list too long
-An argument list longer than 20480 bytes (or the current limit, NCARGS in
-.IR <sys/param.h> )
-is presented to
-.IR execve .
-.en 8 ENOEXEC "Exec format error
-A request is made to execute a file
+.Dv SIGQUIT )
+was caught by the process during the execution of an interruptible
+function. If the signal handler performs a normal return, the
+interupted 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
+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
+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.
+.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
+of 20480 bytes
+.Pf ( Dv NCARGS
+in
+.Aq Pa sys/param.h ) .
+.It Er 8 ENOEXEC Em "Exec format error" .
+A request was made to execute a file
 that, although it has the appropriate permissions,
 that, although it has the appropriate permissions,
-does not start with a valid magic number, (see
-.IR a.out (5)).
-.en 9 EBADF "Bad file descriptor
-Either a file descriptor refers to no
-open file,
-or a read (resp. write) request is made to
-a file that is open only for writing (resp. reading).
-.en 10 ECHILD "No child processes
-.I Wait
-and the process has no
-living or unwaited-for children.
-.en 11 EDEADLK "Resource deadlock avoided
+was not in the format required for an
+executable file.
+.It Er 9 EBADF Em "Bad file descriptor" .
+A file descriptor argument was out of range, referred to no open file,
+or a read (write) request was made to a file that was only open for
+writing (reading).
+.It Er 10 ECHILD Em "\&No child processes" .
+A
+.Xr wait
+or
+.Xr waitpid
+function was executed by a process that had no existing or unwaited-for
+child processes.
+.It Er 11 EDEADLK Em "Resource deadlock avoided" .
 An attempt was made to lock a system resource that
 would have resulted in a deadlock situation.
 An attempt was made to lock a system resource that
 would have resulted in a deadlock situation.
-.en 12 ENOMEM "Cannnot allocate memory
-During an
-.I execve
-or
-.I break,
-a program asks for more core or swap space than the system is
-able to supply,
-or a process size limit would be exceeded.
-A lack of swap space is normally a temporary condition; however,
-a lack of core
-is not a temporary condition; the maximum size
-of the text, data, and stack segments is a system parameter.
+.It Er 12 ENOMEM Em "Cannnot allocate memory" .
+The new process image required more memory than was allowed by the hardware
+or by system-imposed memory management constraints.
+A lack of swap space is normally temporary; however,
+a lack of core is not.
 Soft limits may be increased to their corresponding hard limits.
 Soft limits may be increased to their corresponding hard limits.
-.en 13 EACCES "Permission denied
+.It Er 13 EACCES Em "Permission denied" .
 An attempt was made to access a file in a way forbidden
 An attempt was made to access a file in a way forbidden
-by the protection system.
-.en 14 EFAULT "Bad address
-The system encountered a hardware fault in attempting to
-access the arguments of a system call.
-.en 15 ENOTBLK "Block device required
-A plain file was mentioned where a block device was required,
-e.g., in
-.IR mount .
-.en 16 EBUSY "Device busy
-An attempt to mount a device that was already mounted or
-an attempt was made to dismount a device
-on which there is an active file
-(open file, current directory, mounted-on file, or active text segment).
-A request was made to an exclusive access device that was already in use.
-.en 17 EEXIST "File exists
+by its file access permissions.
+.It Er 14 EFAULT Em "Bad address" .
+The system detected an invalid address in attempting to
+use an argument of a call.
+.It Er 15 ENOTBLK Em "Not a block device" .
+A block device operation was attempted on a non-block device or file.
+.It Er 16 EBUSY Em "Resource busy" .
+An attempt to use a system resource which was in use at the time
+in a manner which would have conflicted with the request.
+.It Er 17 EEXIST Em "File exists" .
 An existing file was mentioned in an inappropriate context,
 An existing file was mentioned in an inappropriate context,
-e.g.,
-.IR link .
-.en 18 EXDEV "Cross-device link
-A hard link to a file on another device
+for instance, as the new link name in a
+.Xr link
+function.
+.It Er 18 EXDEV Em "Improper link" .
+A hard link to a file on another file system
 was attempted.
 was attempted.
-.en 19 ENODEV "Operation not supported by device
+.It Er 19 ENODEV Em "Operation not supported by device" .
 An attempt was made to apply an inappropriate
 An attempt was made to apply an inappropriate
-system call to a device,
-e.g., to read a write-only device,
-or the device is not configured by the system.
-.en 20 ENOTDIR "Not a directory
-A non-directory was specified where a directory
-is required,
-for example, in a path name or
-as an argument to
-.IR chdir .
-.en 21 EISDIR "Is a directory
-An attempt to write on a directory.
-.en 22 EINVAL "Invalid argument
-Some invalid argument:
-dismounting a non-mounted
-device,
-mentioning an unknown signal in
-.I signal,
-or some other argument inappropriate for the call.
-Also set by math functions, (see 
-.IR math (3)).
-.en 23 ENFILE "Too many open files in system
-The system's table of open files is full,
-and temporarily no more
-.I opens
-can be accepted.
-.en 24 EMFILE "Too many open files
-As released, the limit on the number of
-open files per process is 64.
-.IR Getdtablesize (2)
+function to a device,
+for example,
+trying to read a write-only device such as a printer.
+.It Er 20 ENOTDIR Em "Not a directory" .
+A component of the specified pathname existed, but it was
+not a directory, when a directory was expected.
+.It Er 21 EISDIR Em "Is a directory" .
+An attempt was made to open a directory with write mode specified.
+.It Er 22 EINVAL Em "Invalid argument" .
+Some invalid argument was supplied. (For example,
+specifying an undefined signal to a
+.Xr signal
+or
+.Xr kill
+function).
+.It Er 23 ENFILE Em "Too many open files in system" .
+Maximum number of file descriptors allowable on the system
+has been reached and a requests for an open cannot be satisfied
+until at least one has been closed.
+.It Er 24 EMFILE Em "Too many open files" .
+<As released, the limit on the number of
+open files per process is 64.>
+.Xr Getdtablesize 2
 will obtain the current limit.
 will obtain the current limit.
-Customary configuration limit on most other UNIX systems
-is 20 per process.
-.en 25 ENOTTY "Inappropriate ioctl for device
-The file mentioned in an
-.I ioctl
-is not a terminal or one of the
-devices to which this call applies.
-.en 26 ETXTBSY "Text file busy
-An attempt to execute a pure-procedure
-program that is currently open for writing.
-Also an attempt to open for writing a pure-procedure
-program that is being executed.
-.en 27 EFBIG "File too large
+.It Er 25 ENOTTY Em "Inappropriate ioctl for device" .
+A control function (see
+.Xr ioctl 2 )
+was attempted for a file or
+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
+.Xr open
+call requested write access.
+.It Er 27 EFBIG Em "File too large" .
 The size of a file exceeded the maximum (about
 .if t 2\u\s-231\s+2\d
 .if n 2.1E9
 bytes).
 The size of a file exceeded the maximum (about
 .if t 2\u\s-231\s+2\d
 .if n 2.1E9
 bytes).
-.en 28 ENOSPC "No space left on device
+.It Er 28 ENOSPC Em "Device out of space" .
 A
 A
-.I write
+.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
 on the file system, or the allocation of an inode for a newly
 created file failed because no more inodes are available
 on the file system.
 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
 on the file system, or the allocation of an inode for a newly
 created file failed because no more inodes are available
 on the file system.
-.en 29 ESPIPE "Illegal seek
+.It Er 29 ESPIPE Em "Illegal seek" .
 An
 An
-.I lseek
-was issued to a socket or pipe.
-This error may also be issued for
-other non-seekable devices.
-.en 30 EROFS "Read-only file system
-An attempt to modify a file or directory
+.Xr lseek
+function was issued on a socket, pipe or
+.Tn FIFO .
+.It Er 30 EROFS Em "Read-only file system" .
+An attempt was made to modify a file or directory
 was made
 was made
-on a device mounted read-only.
-.en 31 EMLINK "Too many links
-An attempt to make more than 32767 hard links to a file.
-.en 32 EPIPE "Broken pipe
-A write on a pipe or socket for which there is no process
+on a file system that was read-only at the time.
+.It Er 31 EMLINK Em "Too many links" .
+Maximum allowable hard links to a single file has been exceeded (limit
+of 32767 hard links per file).
+.It Er 32 EPIPE Em "Broken pipe" .
+A write on a pipe, socket or
+.Tn FIFO
+for which there is no process
 to read the data.
 to read the data.
-This condition normally generates a signal;
-the error is returned if the signal is caught or ignored.
-.en 33 EDOM "Numerical argument out of domain
-The argument of a function in the math package (3M)
-is out of the domain of the function.
-.en 34 ERANGE "Numerical result out of range
-The value of a function in the math package (3M)
-is unrepresentable within machine precision.
-.en 35 EAGAIN "Resource temporarily unavailable
+.It Er 33 EDOM Em "Numerical argument out of domain" .
+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
+available space (perhaps exceeded precision).
+.It Er 35 EAGAIN Em "Resource temporarily unavailable" .
 This is a temporary condition and later calls to the
 same routine may complete normally.
 This is a temporary condition and later calls to the
 same routine may complete normally.
-.en 36 EINPROGRESS "Operation now in progress"
+.It Er 36 EINPROGRESS Em "Operation now in progress" .
 An operation that takes a long time to complete (such as
 An operation that takes a long time to complete (such as
-a \fIconnect\fP(2)) was attempted on a non-blocking object (see
-\fIfcntl\fP(2)).
-.en 37 EALREADY "Operation already in progress"
+a
+.Xr connect 2 )
+was attempted on a non-blocking object (see
+.Xr fcntl 2 ) .
+.It Er 37 EALREADY Em "Operation already in progress" .
 An operation was attempted on a non-blocking object that already
 had an operation in progress.
 An operation was attempted on a non-blocking object that already
 had an operation in progress.
-.en 38 ENOTSOCK "Socket operation on non-socket"
+.It Er 38 ENOTSOCK Em "Socket operation on non-socket" .
 Self-explanatory.
 Self-explanatory.
-.en 39 EDESTADDRREQ "Destination address required"
+.It Er 39 EDESTADDRREQ Em "Destination address required" .
 A required address was omitted from an operation on a socket.
 A required address was omitted from an operation on a socket.
-.en 40 EMSGSIZE "Message too long"
+.It Er 40 EMSGSIZE Em "Message too long" .
 A message sent on a socket was larger than the internal message buffer
 or some other network limit.
 A message sent on a socket was larger than the internal message buffer
 or some other network limit.
-.en 41 EPROTOTYPE "Protocol wrong type for socket"
+.It Er 41 EPROTOTYPE Em "Protocol wrong type for socket" .
 A protocol was specified that does not support the semantics of the
 A protocol was specified that does not support the semantics of the
-socket type requested. For example, you cannot use the ARPA Internet
-UDP protocol with type SOCK_STREAM.
-.en 42 ENOPROTOOPT "Protocol not available
+socket type requested. For example, you cannot use the
+.Tn ARPA
+Internet
+.Tn UDP
+protocol with type
+.Dv SOCK_STREAM .
+.It Er 42 ENOPROTOOPT Em "Protocol not available" .
 A bad option or level was specified in a
 A bad option or level was specified in a
-.IR getsockopt (2)
+.Xr getsockopt 2
 or
 or
-.IR setsockopt (2)
+.Xr setsockopt 2
 call.
 call.
-.en 43 EPROTONOSUPPORT "Protocol not supported"
+.It Er 43 EPROTONOSUPPORT Em "Protocol not supported" .
 The protocol has not been configured into the
 system or no implementation for it exists.
 The protocol has not been configured into the
 system or no implementation for it exists.
-.en 44 ESOCKTNOSUPPORT "Socket type not supported"
+.It Er 44 ESOCKTNOSUPPORT Em "Socket type not supported" .
 The support for the socket type has not been configured into the
 system or no implementation for it exists.
 The support for the socket type has not been configured into the
 system or no implementation for it exists.
-.en 45 EOPNOTSUPP "Operation not supported on socket"
-For example, trying to \fIaccept\fP a connection on a datagram socket.
-.en 46 EPFNOSUPPORT "Protocol family not supported"
+.It Er 45 EOPNOTSUPP Em "Operation not supported on socket" .
+For example, trying to
+.Em accept
+a connection on a datagram socket.
+.It Er 46 EPFNOSUPPORT Em "Protocol family not supported" .
 The protocol family has not been configured into the
 system or no implementation for it exists.
 The protocol family has not been configured into the
 system or no implementation for it exists.
-.en 47 EAFNOSUPPORT "Address family not supported by protocol family"
+.It Er 47 EAFNOSUPPORT Em "Address family not supported by protocol family" .
 An address incompatible with the requested protocol was used.
 An address incompatible with the requested protocol was used.
-For example, you shouldn't necessarily expect to be able to use NS
-addresses with ARPA Internet protocols.
-.en 48 EADDRINUSE "Address already in use"
+For example, you shouldn't necessarily expect to be able to use
+.Tn NS
+addresses with
+.Tn ARPA
+Internet protocols.
+.It Er 48 EADDRINUSE Em "Address already in use" .
 Only one usage of each address is normally permitted.
 Only one usage of each address is normally permitted.
-.en 49 EADDRNOTAVAIL "Can't assign requested address"
+.It Er 49 EADDRNOTAVAIL Em "Cannot assign requested address" .
 Normally results from an attempt to create a socket with an
 address not on this machine.
 Normally results from an attempt to create a socket with an
 address not on this machine.
-.en 50 ENETDOWN "Network is down"
+.It Er 50 ENETDOWN Em "Network is down" .
 A socket operation encountered a dead network.
 A socket operation encountered a dead network.
-.en 51 ENETUNREACH "Network is unreachable"
+.It Er 51 ENETUNREACH Em "Network is unreachable" .
 A socket operation was attempted to an unreachable network.
 A socket operation was attempted to an unreachable network.
-.en 52 ENETRESET "Network dropped connection on reset"
+.It Er 52 ENETRESET Em "Network dropped connection on reset" .
 The host you were connected to crashed and rebooted.
 The host you were connected to crashed and rebooted.
-.en 53 ECONNABORTED "Software caused connection abort"
+.It Er 53 ECONNABORTED Em "Software caused connection abort" .
 A connection abort was caused internal to your host machine.
 A connection abort was caused internal to your host machine.
-.en 54 ECONNRESET "Connection reset by peer"
+.It Er 54 ECONNRESET Em "Connection reset by peer" .
 A connection was forcibly closed by a peer.  This normally
 results from a loss of the connection on the remote socket
 due to a timeout or a reboot.
 A connection was forcibly closed by a peer.  This normally
 results from a loss of the connection on the remote socket
 due to a timeout or a reboot.
-.en 55 ENOBUFS "No buffer space available"
+.It Er 55 ENOBUFS Em "\&No buffer space available" .
 An operation on a socket or pipe was not performed because
 the system lacked sufficient buffer space or because a queue was full.
 An operation on a socket or pipe was not performed because
 the system lacked sufficient buffer space or because a queue was full.
-.en 56 EISCONN "Socket is already connected"
+.It Er 56 EISCONN Em "Socket is already connected" .
 A
 A
-.I connect
+.Xr connect
 request was made on an already connected socket; or,
 a
 request was made on an already connected socket; or,
 a
-.I sendto
+.Xr sendto
 or
 or
-.I sendmsg
+.Xr sendmsg
 request on a connected socket specified a destination
 when already connected.
 request on a connected socket specified a destination
 when already connected.
-.en 57 ENOTCONN "Socket is not 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)
 no address was supplied.
 An request to send or receive data was disallowed because
 the socket is not connected and (when sending on a  datagram socket)
 no address was supplied.
-.en 58 ESHUTDOWN "Can't send after socket shutdown"
+.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
 A request to send data was disallowed because the socket
 had already been shut down with a previous
-.IR shutdown (2)
+.Xr shutdown 2
 call.
 call.
-.en 60 ETIMEDOUT "Connection timed out"
+.It Er 60 ETIMEDOUT Em "Connection timed out" .
 A
 A
-.I connect
+.Xr connect
 or
 or
-.I send
+.Xr send
 request failed because the connected party did not
 properly respond after a period of time.  (The timeout
 period is dependent on the communication protocol.)
 request failed because the connected party did not
 properly respond after a period of time.  (The timeout
 period is dependent on the communication protocol.)
-.en 61 ECONNREFUSED "Connection refused"
+.It Er 61 ECONNREFUSED Em "Connection refused" .
 No connection could be made because the target machine actively
 refused it.  This usually results from trying to connect
 to a service that is inactive on the foreign host.
 No connection could be made because the target machine actively
 refused it.  This usually results from trying to connect
 to a service that is inactive on the foreign host.
-.en 62 ELOOP "Too many levels of symbolic links"
+.It Er 62 ELOOP Em "Too many levels of symbolic links" .
 A path name lookup involved more than 8 symbolic links.
 A path name lookup involved more than 8 symbolic links.
-.en 63 ENAMETOOLONG "File name too long"
-A component of a path name exceeded 255 (MAXNAMELEN) characters, or an entire
-path name exceeded 1023 (MAXPATHLEN-1) characters.
-.en 64 EHOSTDOWN "Host is down"
+.It Er 63 ENAMETOOLONG Em "File name too long" .
+A component of a path name exceeded 255
+.Pq Dv MAXNAMELEN
+characters, or an entire
+path name exceeded 1023
+.Pq Dv MAXPATHLEN Ns -1
+characters.
+.It Er 64 EHOSTDOWN Em "Host is down" .
 A socket operation failed because the destination host was down.
 A socket operation failed because the destination host was down.
-.en 65 EHOSTUNREACH "No route to host"
+.It Er 65 EHOSTUNREACH Em "No route to host" .
 A socket operation was attempted to an unreachable host.
 A socket operation was attempted to an unreachable host.
-.en 66 ENOTEMPTY "Directory not empty"
-A directory with entries other than \*(lq.\*(rq and \*(lq..\*(rq
+.It Er 66 ENOTEMPTY Em "Directory not empty" .
+A directory with entries other than
+.Ql \&.
+and
+.Ql \&..
 was supplied to a remove directory or rename call.
 was supplied to a remove directory or rename call.
-.en 67 EPROCLIM "Too many processes"
-.en 68 EUSERS "Too many users"
+.It Er 67 EPROCLIM Em "Too many processes" .
+.It Er 68 EUSERS Em "Too many users" .
 The quota system ran out of table entries.
 The quota system ran out of table entries.
-.en 69 EDQUOT "Disc quota exceeded"
+.It Er 69 EDQUOT Em "Disc quota exceeded" .
 A 
 A 
-.I write
+.Xr write
 to an ordinary file, the creation of a
 directory or symbolic link, or the creation of a directory
 entry failed because the user's quota of disk blocks was
 exhausted, or the allocation of an inode for a newly
 created file failed because the user's quota of inodes
 was exhausted.
 to an ordinary file, the creation of a
 directory or symbolic link, or the creation of a directory
 entry failed because the user's quota of disk blocks was
 exhausted, or the allocation of an inode for a newly
 created file failed because the user's quota of inodes
 was exhausted.
-.en 70 ESTALE "Stale NFS file handle"
-An attempt was made to access an open file (on an NFS filesystem)
+.It Er 70 ESTALE Em "Stale NFS file handle" .
+An attempt was made to access an open file (on an
+.Tn NFS
+filesystem)
 which is now unavailable as referenced by the file descriptor.  
 which is now unavailable as referenced by the file descriptor.  
-This may indicate the file was deleted on the NFS server and some 
+This may indicate the file was deleted on the
+.Tn NFS 
+server or some 
 other catastrophic event occured.
 other catastrophic event occured.
-.en 72 EBADRPC "RPC struct is bad"
-Exchange of RPC information was unsuccessful.
-.en 73 ERPCMISMATCH "RPC version wrong"
-The version of RPC on the remote peer is not compatible with
+.It Er 72 EBADRPC Em "RPC struct is bad" .
+Exchange of
+.Tn RPC
+information was unsuccessful.
+.It Er 73 ERPCMISMATCH Em "RPC version wrong" .
+The version of
+.Tn RPC
+on the remote peer is not compatible with
 the local version.
 the local version.
-.en 74 EPROGUNAVAIL "RPC prog. not avail"
+.It Er 74 EPROGUNAVAIL Em "RPC prog. not avail" .
 The requested program is not registered on the remote host.
 The requested program is not registered on the remote host.
-.en 75 EPROGMISMATCH "Program version wrong"
+.It Er 75 EPROGMISMATCH Em "Program version wrong" .
 The requested version of the program is not available 
 The requested version of the program is not available 
-on the remote host (RPC).
-.en 76 EPROCUNAVAIL "Bad procedure for program"
-An RPC call was attempted for a procedure which doesn't exist
+on the remote host
+.Pq Tn RPC .
+.It Er 76 EPROCUNAVAIL Em "Bad procedure for program" .
+An
+.Tn RPC
+call was attempted for a procedure which doesn't exist
 in the remote program.
 in the remote program.
-.en 77 ENOLCK "No locks available"
+.It Er 77 ENOLCK Em "No locks available" .
 A system-imposed limit on the number of simultaneous file 
 locks was reached.
 A system-imposed limit on the number of simultaneous file 
 locks was reached.
-.en 78 ENOSYS "Function not implemented"
+.It Er 78 ENOSYS Em "Function not implemented" .
 Attempted a system call that is not available on this 
 system.
 Attempted a system call that is not available on this 
 system.
-.SH DEFINITIONS
-.TP 5
-Process ID
-.br
-Each active process in the system is uniquely identified by a positive
+.Sh DEFINITIONS
+.Bl -tag -width Ds
+.It  Process ID .
+Each active process in the system is uniquely identified by a non-negative
 integer called a process ID.  The range of this ID is from 0 to 30000.
 integer called a process ID.  The range of this ID is from 0 to 30000.
-.TP 5
-Parent process ID
-.br
+.It  Parent process ID
 A new process is created by a currently active process; (see
 A new process is created by a currently active process; (see
-.IR fork (2)).
+.Xr fork 2 ) .
 The parent process ID of a process is the process ID of its creator.
 The parent process ID of a process is the process ID of its creator.
-.TP 5
-Process Group ID
-.br
+.It  Process Group ID
 Each active process is a member of a process group that is identified by
 Each active process is a member of a process group that is identified by
-a positive integer called the process group ID.  This is the process
+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
 ID of the group leader.  This grouping permits the signaling of related
 processes (see
-.IR killpg (2))
+.Xr killpg 2 )
 and the job control mechanisms of
 and the job control mechanisms of
-.IR csh (1).
-.TP 5
-Tty Group ID
-.br
+.Xr csh 1 .
+.It  Tty Group ID
 Each active process can be a member of a terminal group that is identified
 Each active process can be a member of a terminal group that is identified
-by a positive integer called the tty group ID.  This grouping is used
+by a non-negative integer called the tty group ID.  This grouping is used
 to arbitrate between multiple jobs contending for the same terminal;
 (see
 to arbitrate between multiple jobs contending for the same terminal;
 (see
-.IR csh (1)
+.Xr csh 1
 and
 and
-.IR tty (4)).
-.TP 5
-Real User ID and Real Group ID
-.br
+.Xr tty 4 ) .
+.It  Real User ID and Real Group ID
 Each user on the system is identified by a positive integer
 termed the real user ID.
 Each user on the system is identified by a positive integer
 termed the real user ID.
-.IP
+.Pp
 Each user is also a member of one or more groups. 
 One of these groups is distinguished from others and
 used in implementing accounting facilities.  The positive
 integer corresponding to this distinguished group is termed 
 the real group ID.
 Each user is also a member of one or more groups. 
 One of these groups is distinguished from others and
 used in implementing accounting facilities.  The positive
 integer corresponding to this distinguished group is termed 
 the real group ID.
-.IP
+.Pp
 All processes have a real user ID and real group ID.
 These are initialized from the equivalent attributes
 of the process that created it.
 All processes have a real user ID and real group ID.
 These are initialized from the equivalent attributes
 of the process that created it.
-.TP 5
-Effective User Id, Effective Group Id, and Access Groups
-.br
+.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.
 Access to system resources is governed by three values:
 the effective user ID, the effective group ID, and the
 group access list.
-.IP
+.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
 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
-.IR execve (2)).
-.IP
+.Xr execve 2 ) .
+.Pp
 The group access list is an additional set of group ID's
 used only in determining resource accessibility.  Access checks
 are performed as described below in ``File Access Permissions''.
 The group access list is an additional set of group ID's
 used only in determining resource accessibility.  Access checks
 are performed as described below in ``File Access Permissions''.
-.TP 5
-Super-user
-.br
+.It  Super-user
 A process is recognized as a
 A process is recognized as a
-.I super-user
+.Em super-user
 process and is granted special privileges if its effective user ID is 0.
 process and is granted special privileges if its effective user ID is 0.
-.TP 5
-Special Processes
-.br
+.It  Special Processes
 The processes with a process ID's of 0, 1, and 2 are special.
 Process 0 is the scheduler.  Process 1 is the initialization process
 The processes with a process ID's of 0, 1, and 2 are special.
 Process 0 is the scheduler.  Process 1 is the initialization process
-.IR init ,
+.Xr init ,
 and is the ancestor of every other process in the system.
 It is used to control the process structure.
 Process 2 is the paging daemon.
 and is the ancestor of every other process in the system.
 It is used to control the process structure.
 Process 2 is the paging daemon.
-.TP 5
-Descriptor
-.br
+.It  Descriptor
 An integer assigned by the system when a file is referenced
 by
 An integer assigned by the system when a file is referenced
 by
-.IR open (2)
+.Xr open 2
 or
 or
-.IR dup (2),
+.Xr dup 2 ,
 or when a socket is created by
 or when a socket is created by
-.IR pipe (2),
-.IR socket (2)
+.Xr pipe 2 ,
+.Xr socket 2
 or
 or
-.IR socketpair (2),
+.Xr socketpair 2 ,
 which uniquely identifies an access path to that file or socket from
 a given process or any of its children.
 which uniquely identifies an access path to that file or socket from
 a given process or any of its children.
-.TP 5
-File Name
-.br
-Names consisting of up to 255 (MAXNAMELEN) characters may be used to name
+.It  File Name
+Names consisting of up to 255
+.Pq Dv MAXNAMELEN
+characters may be used to name
 an ordinary file, special file, or directory.
 an ordinary file, special file, or directory.
-.IP
-These characters may be selected from the set of all ASCII character
-excluding 0 (null) and the ASCII code for / (slash).  (The parity bit,
-bit 8, must be 0.)
-.IP
-Note that it is generally unwise to use *, ?, [ or ] as part of
+.Pp
+These characters may be selected from the set of all
+.Tn ASCII
+character
+excluding 0 (NUL) and the
+.Tn ASCII
+code for
+.Ql \&/
+(slash).  (The parity bit,
+bit 7, must be 0.)
+.Pp
+Note that it is generally unwise to use
+.Ql \&* ,
+.Ql \&? ,
+.Ql \&[
+or
+.Ql \&]
+as part of
 file names because of the special meaning attached to these characters
 by the shell.
 file names because of the special meaning attached to these characters
 by the shell.
-.TP 5
-Path Name
-.br
-A path name is a null-terminated character string starting with an
-optional slash (/), followed by zero or more directory names separated
+.It  Path Name
+A path name is a NUL-terminated character string starting with an
+optional slash
+.Ql \&/ ,
+followed by zero or more directory names separated
 by slashes, optionally followed by a file name.
 by slashes, optionally followed by a file name.
-The total length of a path name must be less than 1024 (MAXPATHLEN) characters.
-.IP
+The total length of a path name must be less than 1024
+.Pq Dv MAXPATHLEN
+characters.
+.Pp
 If a path name begins with a slash, the path search begins at the
 If a path name begins with a slash, the path search begins at the
-.I root
+.Em root
 directory.
 Otherwise, the search begins from the current working directory.
 directory.
 Otherwise, the search begins from the current working directory.
-A slash by itself names the root directory.  A null
+A slash by itself names the root directory.  An empty
 pathname refers to the current directory.
 pathname refers to the current directory.
-.TP 5
-Directory
-.br
+.It  Directory
 A directory is a special type of file that contains entries
 that are references to other files.
 Directory entries are called links.  By convention, a directory
 A directory is a special type of file that contains entries
 that are references to other files.
 Directory entries are called links.  By convention, a directory
-contains at least two links, . and .., referred to as
-.I dot
+contains at least two links,
+.Ql \&.
 and
 and
-.I dot-dot
+.Ql \&.. ,
+referred to as
+.Em dot
+and
+.Em dot-dot
 respectively.  Dot refers to the directory itself and
 dot-dot refers to its parent directory.
 respectively.  Dot refers to the directory itself and
 dot-dot refers to its parent directory.
-.TP 5
-Root Directory and Current Working Directory
-.br
+.It  Root Directory and Current Working Directory
 Each process has associated with it a concept of a root directory
 and a current working directory for the purpose of resolving path
 name searches.  A process's root directory need not be the root
 directory of the root file system.
 Each process has associated with it a concept of a root directory
 and a current working directory for the purpose of resolving path
 name searches.  A process's root directory need not be the root
 directory of the root file system.
-.TP 5
-File Access Permissions
-.br
+.It  File Access Permissions
 Every file in the file system has a set of access permissions.
 These permissions are used in determining whether a process
 may perform a requested operation on the file (such as opening
 a file for writing).  Access permissions are established at the
 time a file is created.  They may be changed at some later time
 through the 
 Every file in the file system has a set of access permissions.
 These permissions are used in determining whether a process
 may perform a requested operation on the file (such as opening
 a file for writing).  Access permissions are established at the
 time a file is created.  They may be changed at some later time
 through the 
-.IR chmod (2)
+.Xr chmod 2
 call. 
 call. 
-.IP
+.Pp
 File access is broken down according to whether a file may be: read,
 written, or executed.  Directory files use the execute
 permission to control if the directory may be searched. 
 File access is broken down according to whether a file may be: read,
 written, or executed.  Directory files use the execute
 permission to control if the directory may be searched. 
-.IP
+.Pp
 File access permissions are interpreted by the system as
 they apply to three different classes of users: the owner
 of the file, those users in the file's group, anyone else.
 File access permissions are interpreted by the system as
 they apply to three different classes of users: the owner
 of the file, those users in the file's group, anyone else.
@@ -522,49 +531,54 @@ Every file has an independent set of access permissions for
 each of these classes.  When an access check is made, the system
 decides if permission should be granted by checking the access
 information applicable to the caller.
 each of these classes.  When an access check is made, the system
 decides if permission should be granted by checking the access
 information applicable to the caller.
-.IP
+.Pp
 Read, write, and execute/search permissions on
 a file are granted to a process if:
 Read, write, and execute/search permissions on
 a file are granted to a process if:
-.IP
-The process's effective user ID is that of the super-user.
-.IP
+.Pp
+The process's effective user ID is that of the super-user. (Note:
+even the super-user cannot execute a non-executable file.)
+.Pp
 The process's effective user ID matches the user ID of the owner
 of the file and the owner permissions allow the access.
 The process's effective user ID matches the user ID of the owner
 of the file and the owner permissions allow the access.
-.IP
+.Pp
 The process's effective user ID does not match the user ID of the
 owner of the file, and either the process's effective
 group ID matches the group ID
 of the file, or the group ID of the file is in
 the process's group access list,
 and the group permissions allow the access.
 The process's effective user ID does not match the user ID of the
 owner of the file, and either the process's effective
 group ID matches the group ID
 of the file, or the group ID of the file is in
 the process's group access list,
 and the group permissions allow the access.
-.IP
+.Pp
 Neither the effective user ID nor effective group ID
 and group access list of the process
 match the corresponding user ID and group ID of the file,
 but the permissions for ``other users'' allow access.
 Neither the effective user ID nor effective group ID
 and group access list of the process
 match the corresponding user ID and group ID of the file,
 but the permissions for ``other users'' allow access.
-.IP
+.Pp
 Otherwise, permission is denied.
 Otherwise, permission is denied.
-.TP 5
-Sockets and Address Families
-.IP
+.It  Sockets and Address Families
+.Pp
 A socket is an endpoint for communication between processes.
 Each socket has queues for sending and receiving data.
 A socket is an endpoint for communication between processes.
 Each socket has queues for sending and receiving data.
-.IP
+.Pp
 Sockets are typed according to their communications properties.
 These properties include whether messages sent and received
 at a socket require the name of the partner, whether communication
 is reliable, the format used in naming message recipients, etc.
 Sockets are typed according to their communications properties.
 These properties include whether messages sent and received
 at a socket require the name of the partner, whether communication
 is reliable, the format used in naming message recipients, etc.
-.IP
+.Pp
 Each instance of the system supports some
 collection of socket types; consult
 Each instance of the system supports some
 collection of socket types; consult
-.IR socket (2)
+.Xr socket 2
 for more information about the types available and
 their properties.
 for more information about the types available and
 their properties.
-.IP
+.Pp
 Each instance of the system supports some number of sets of
 communications protocols.  Each protocol set supports addresses
 of a certain format.  An Address Family is the set of addresses
 for a specific group of protocols.  Each socket has an address
 chosen from the address family in which the socket was created.
 Each instance of the system supports some number of sets of
 communications protocols.  Each protocol set supports addresses
 of a certain format.  An Address Family is the set of addresses
 for a specific group of protocols.  Each socket has an address
 chosen from the address family in which the socket was created.
-.SH SEE ALSO
+.Tp
+.Sh SEE ALSO
 intro(3), perror(3)
 intro(3), perror(3)
+.Sh HISTORY
+An
+.Nm
+appeared in Version 6 AT&T UNIX.
index 9fdd2dd..aca614d 100644 (file)
@@ -1,65 +1,80 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)ioctl.2     6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH IOCTL 2 ""
-.UC 4
-.SH NAME
-ioctl \- control device
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/ioctl.h>
-.PP
-.ft B
-ioctl(d, request, argp)
-int d;
-unsigned long request;
-char *argp;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Ioctl
-performs a variety of functions
-on open descriptors.  In particular, many operating
+.\"     @(#)ioctl.2    6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt IOCTL 2
+.Os BSD 4
+.Sh NAME
+.Nm ioctl
+.Nd control device
+.Sh SYNOPSIS
+.Fd #include <sys/ioctl.h>
+.Ft int
+.Fn ioctl "int d" "unsigned long request" "char *argp"
+.Sh DESCRIPTION
+The
+.Fn ioctl
+function manipulates the underlying device parameters of special files.
+In particular, many operating
 characteristics of character special files (e.g. terminals)
 may be controlled with
 characteristics of character special files (e.g. terminals)
 may be controlled with
-.I ioctl
+.Fn ioctl
 requests.
 requests.
-The writeups of various devices in section 4 discuss how
-.I ioctl
-applies to them.
-.PP
+The argument
+.Fa d
+must be an open file descriptor.
+.Pp
 An  ioctl
 An  ioctl
-.I request
-has encoded in it whether the argument is an \*(lqin\*(rq parameter
-or \*(lqout\*(rq parameter, and the size of the argument \fIargp\fP in bytes.
+.Fa request
+has encoded in it whether the argument is an
+.Dq in
+parameter
+or
+.Dq out
+parameter, and the size of the argument
+.Fa argp
+in bytes.
 Macros and defines used in specifying an ioctl
 Macros and defines used in specifying an ioctl
-.I request
+.Fa request
 are located in the file
 are located in the file
-.IR <sys/ioctl.h> .
-.SH "RETURN VALUE
-If an error has occurred, a value of \-1 is returned and
-.I errno
+.Ao Pa sys/ioctl.h Ac .
+.Sh RETURN VALUES
+If an error has occurred, a value of -1 is returned and
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Ioctl
-will fail if one or more of the following are true:
-.TP 15
-[EBADF]
-\fID\fP is not a valid descriptor.
-.TP 15
-[ENOTTY]
-\fID\fP is not associated with a character
+.Sh ERRORS
+.Fn Ioctl
+will fail:
+.Bl -tag -width [ENOTTY]
+.It Bq Er EBADF
+.Fa d
+is not a valid descriptor.
+.It Bq Er ENOTTY
+.Fa d
+is not associated with a character
 special device.
 special device.
-.TP 15
-[ENOTTY]
+.It Bq Er ENOTTY
 The specified request does not apply to the kind
 The specified request does not apply to the kind
-of object that the descriptor \fId\fP references.
-.TP 15
-[EINVAL]
-\fIRequest\fP or \fIargp\fP is not valid.
-.SH "SEE ALSO"
-execve(2), fcntl(2), mt(4), tty(4), intro(4N)
+of object that the descriptor
+.Fa d
+references.
+.It Bq Er EINVAL
+.Fa Request
+or
+.Fa argp
+is not valid.
+.El
+.Sh SEE ALSO
+.Xr mt 1 ,
+.Xr execve 2 ,
+.Xr fcntl 2 ,
+.Xr tty 4 ,
+.Xr intro 4
+.Sh HISTORY
+An
+.Nm
+function call appeared in Version 7 AT&T UNIX.
index 673910a..49541f6 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)kill.2      6.5 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH KILL 2 ""
-.UC 4
-.SH NAME
-kill \- send signal to a process
-.SH SYNOPSIS
-.ft B
-kill(pid, sig)
-.br
-int pid, sig;
-.SH DESCRIPTION
-.I Kill
-sends the signal \fIsig\fP
-to a process, specified by the process number
-.IR pid .
-.I Sig
+.\"     @(#)kill.2     6.6 (Berkeley) %G%
+.\"
+.Dd 
+.Dt KILL 2
+.Os BSD 4
+.Sh NAME
+.Nm kill
+.Nd send signal to a process
+.Sh SYNOPSIS
+.Fd #include <sys/signal.h>
+.Ft int
+.Fn kill "pid_t pid" "int sig"
+.Sh DESCRIPTION
+The
+.Fn kill
+function sends the signal given by
+.Fa sig
+to
+.Fa pid ,
+a
+process or a group of processes.
+.Fa Sig
 may be one of the signals specified in
 may be one of the signals specified in
-.IR sigvec (2),
+.Xr sigaction 2
 or it may be 0, in which case
 error checking is performed but no
 signal is actually sent. 
 This can be used to check the validity of
 or it may be 0, in which case
 error checking is performed but no
 signal is actually sent. 
 This can be used to check the validity of
-.IR pid .
-.PP
-The sending and receiving processes must
-have the same effective user ID, otherwise
-this call is restricted to the super-user.
+.Fa pid .
+.Pp
+For a process to have permission to send a signal to a process designated
+by
+.Fa pid ,
+the real or effective user ID of the receving process must match
+that of the sending process or the user must have appropriate privileges
+(such as given by a set-user-ID program or the user is the super-user).
 A single exception is the signal SIGCONT, which may always be sent
 to any descendant of the current process.
 A single exception is the signal SIGCONT, which may always be sent
 to any descendant of the current process.
-.PP
-If the process number is 0,
-the signal is sent to all processes in the
-sender's process group; this is a variant of
-.IR killpg (2).
-.PP
-If the process number is \-1
-and the user is the super-user,
-the signal is broadcast universally
-except to system processes
-and the process sending the signal.
-If the process number is \-1
-and the user is not the super-user,
-the signal is broadcast universally to
-all processes with the same uid as the user
+.Bl -tag -width Ds
+.It \&If Fa pid No \&is greater than zero :
+.Fa Sig
+is sent to the process whose ID is equal to
+.Fa pid.
+.It \&If Fa pid No \&is zero :
+.Fa Sig
+is sent to all processes whose group ID is equal
+to the process group ID of the sender, and for which the
+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,
+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.
 No error is returned if any process could be signaled.
 except the process sending the signal.
 No error is returned if any process could be signaled.
-.PP
+.El
+.Pp
 For compatibility with System V,
 For compatibility with System V,
-if the process number is negative but not \-1,
+if the process number is negative but not -1,
 the signal is sent to all processes whose process group ID
 is equal to the absolute value of the process number.
 This is a variant of
 the signal is sent to all processes whose process group ID
 is equal to the absolute value of the process number.
 This is a variant of
-.IR killpg (2).
-.PP
-Processes may send signals to themselves.
-.SH "RETURN VALUE
+.Xr killpg 2 .
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Upon successful completion, a value of 0 is returned.
-Otherwise, a value of \-1 is returned and
-.I errno
+Otherwise, a value of -1 is returned and
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH "ERRORS
-.I Kill
-will fail and no signal will be sent if any of the following
-occur:
-.TP 15
-[EINVAL]
-\fISig\fP is not a valid signal number.
-.TP 15
-[ESRCH]
-No process can be found corresponding to that specified by \fIpid\fP.
-.TP 15
-[ESRCH]
+.Sh ERRORS
+.Fn Kill
+will fail and no signal will be sent if:
+.Bl -tag -width [EINVAL]
+.It Bq Er EINVAL
+.Fa Sig
+is not a valid signal number.
+.It Bq Er ESRCH
+No process can be found corresponding to that specified by
+.Fa pid .
+.It Bq Er ESRCH
 The process id was given as 0
 but the sending process does not have a process group.
 The process id was given as 0
 but the sending process does not have a process group.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The sending process is not the super-user and its effective
 user id does not match the effective user-id of the receiving process.
 The sending process is not the super-user and its effective
 user id does not match the effective user-id of the receiving process.
-When signaling a process group, this error was returned if any members
+When signaling a process group, this error is returned if any members
 of the group could not be signaled.
 of the group could not be signaled.
-.SH "SEE ALSO"
-getpid(2), getpgrp(2), killpg(2), sigvec(2)
+.El
+.Sh SEE ALSO
+.Xr getpid 2 ,
+.Xr getpgrp 2 ,
+.Xr killpg 2 ,
+.Xr sigaction 2
+.Sh STANDARDS
+The
+.Fn kill
+function is expected to
+conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index 10dd3ce..f1fc6c4 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)link.2      6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH LINK 2 ""
-.UC 4
-.SH NAME
-link \- make a hard link to a file
-.SH SYNOPSIS
-.nf
-.ft B
-link(name1, name2)
-char *name1, *name2;
-.fi
-.ft R
-.SH DESCRIPTION
-A hard link
-to
-.I name1
-is created;
-the link has the name
-.IR name2 .
-.I Name1
-must exist.
-.PP
-With hard links,
+.\"     @(#)link.2     6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt LINK 2
+.Os BSD 4
+.Sh NAME
+.Nm link
+.Nd make a hard file link
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn link "const char *name1" "const char *name2"
+.Sh DESCRIPTION
+The
+.Fn link
+function call
+atomically creates the specified directory entry (hard link)
+.Fa name2
+with the attributes of the underlying object pointed at by
+.Fa name1
+If the link is successful: the link count of the underlying object
+is incremented;
+.Fa name1
+and
+.Fa name2
+share equal access and rights
+to the
+underlying object.
+.Pp
+If
+.Fa name1
+is removed, the file
+.Fa name2
+is not deleted and the link count of the
+underlying object is
+decremented.
+.Pp
+.Fa Name1
+must exist for the hard link to
+succeed and
 both
 both
-.I name1
+.Fa name1
 and
 and
-.I name2
+.Fa name2
 must be in the same file system.
 Unless the caller is the super-user,
 must be in the same file system.
 Unless the caller is the super-user,
-.I name1
-must not be a directory.
-Both the old and the new
-.I link
-share equal access and rights to
-the underlying object.
-.SH "RETURN VALUE
+.Fa name1
+may not be a directory.
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.  Otherwise,
 Upon successful completion, a value of 0 is returned.  Otherwise,
-a value of \-1 is returned and
-.I errno
+a value of -1 is returned and
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH "ERRORS
-.I Link
-will fail and no link will be created if one or more of the following
+.SERRORS
+.Fn Link
+will fail and no link will be created if:
 are true:
 are true:
-.TP 15
-[ENOTDIR]
+.Bl -tag -width Ar
+.It Bq Er ENOTDIR
 A component of either path prefix is not a directory.
 A component of either path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 Either pathname contains a character with the high-order bit set.
 Either pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of either pathname exceeded 255 characters,
 or entire length of either path name exceeded 1023 characters.
 A component of either pathname exceeded 255 characters,
 or entire length of either path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 A component of either path prefix does not exist.
 A component of either path prefix does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 A component of either path prefix denies search permission.
 A component of either path prefix denies search permission.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 The requested link requires writing in a directory with a mode
 that denies write permission.
 The requested link requires writing in a directory with a mode
 that denies write permission.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating one of the pathnames.
 Too many symbolic links were encountered in translating one of the pathnames.
-.TP 15
-[ENOENT]
-The file named by \fIname1\fP does not exist.
-.TP 15
-[EEXIST]
-The link named by \fIname2\fP does exist.
-.TP 15
-[EPERM]
-The file named by \fIname1\fP is a directory and the effective
+.It Bq Er ENOENT
+The file named by
+.Fa name1
+does not exist.
+.It Bq Er EEXIST
+The link named by
+.Fa name2
+does exist.
+.It Bq Er EPERM
+The file named by
+.Fa name1
+is a directory and the effective
 user ID is not super-user.
 user ID is not super-user.
-.TP 15
-[EXDEV]
-The link named by \fIname2\fP and the file named by \fIname1\fP
+.It Bq Er EXDEV
+The link named by
+.Fa name2
+and the file named by
+.Fa name1
 are on different file systems.
 are on different file systems.
-.TP 15
-[ENOSPC]
+.It Bq Er ENOSPC
 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.
 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.
-.TP 15
-[EDQUOT]
+.It Bq Er EDQUOT
 The directory in which the entry for the new link
 is being placed cannot be extended because the
 user's quota of disk blocks on the file system
 containing the directory has been exhausted.
 The directory in which the entry for the new link
 is being placed cannot be extended because the
 user's quota of disk blocks on the file system
 containing the directory has been exhausted.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to 
 the file system to make the directory entry.
 An I/O error occurred while reading from or writing to 
 the file system to make the directory entry.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The requested link requires writing in a directory on a read-only file
 system.
 The requested link requires writing in a directory on a read-only file
 system.
-.TP 15
-[EFAULT]
+.It Bq Er EFAULT
 One of the pathnames specified
 is outside the process's allocated address space.
 One of the pathnames specified
 is outside the process's allocated address space.
-.SH "SEE ALSO"
-symlink(2), unlink(2)
+.El
+.Sh SEE ALSO
+.Xr symlink 2 ,
+.Xr unlink 2
+.Sh STANDARDS
+.Fn Link
+is expected to
+conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index c17bf1e..1fa7a15 100644 (file)
@@ -1,62 +1,74 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)listen.2    6.4 (Berkeley) %G%
+.\"     @(#)listen.2   6.5 (Berkeley) %G%
 .\"
 .\"
-.TH LISTEN 2 ""
-.UC 5
-.SH NAME
-listen \- listen for connections on a socket
-.SH SYNOPSIS
-.nf
-.ft B
-listen(s, backlog)
-int s, backlog;
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt LISTEN 2
+.Os BSD 4.2
+.Sh NAME
+.Nm listen
+.Nd listen for connections on a socket
+.Sh SYNOPSIS
+.Fd #include <sys/socket.h>
+.Ft int
+.Fn listen "int s" "int backlog"
+.Sh DESCRIPTION
 To accept connections, a socket
 is first created with
 To accept connections, a socket
 is first created with
-.IR socket (2),
+.Xr socket 2 ,
 a willingness to accept incoming connections and
 a queue limit for incoming connections are specified with
 a willingness to accept incoming connections and
 a queue limit for incoming connections are specified with
-.IR listen (2),
+.Fn listen ,
 and then the connections are
 accepted with
 and then the connections are
 accepted with
-.IR accept (2).
+.Xr accept 2 .
 The
 The
-.I listen
+.Fn listen
 call applies only to sockets of type
 call applies only to sockets of type
-SOCK_STREAM
+.Dv SOCK_STREAM
 or
 or
-SOCK_SEQPACKET.
-.PP
+.Dv SOCK_SEQPACKET.
+.Pp
 The
 The
-.I backlog
+.Fa backlog
 parameter defines the maximum length the queue of
 pending connections may grow to.
 If a connection
 request arrives with the queue full the client may
 parameter defines the maximum length the queue of
 pending connections may grow to.
 If a connection
 request arrives with the queue full the client may
-receive an error with an indication of ECONNREFUSED,
+receive an error with an indication of
+.Er ECONNREFUSED ,
 or, if the underlying protocol supports retransmission,
 the request may be ignored so that retries may succeed.
 or, if the underlying protocol supports retransmission,
 the request may be ignored so that retries may succeed.
-.SH "RETURN VALUE
-A 0 return value indicates success; \-1 indicates an error.
-.SH "ERRORS
-The call fails if:
-.TP 20
-[EBADF]
-The argument \fIs\fP is not a valid descriptor.
-.TP 20
-[ENOTSOCK]
-The argument \fIs\fP is not a socket.
-.TP 20
-[EOPNOTSUPP]
-The socket is not of a type that supports the operation \fIlisten\fP.
-.SH "SEE ALSO"
-accept(2), connect(2), socket(2)
-.SH BUGS
+.Sh RETURN VALUES
+A 0 return value indicates success; -1 indicates an error.
+.Sh ERRORS
+.Fn Listen will fail if:
+.Bl -tag -width [EOPNOTSUPP]
+.It Bq Er EBADF
+The argument
+.Fa s
+is not a valid descriptor.
+.It Bq Er ENOTSOCK
+The argument
+.Fa s
+is not a socket.
+.It Bq Er EOPNOTSUPP
+The socket is not of a type that supports the operation
+.Fn listen .
+.El
+.Sh SEE ALSO
+.Xr accept 2 ,
+.Xr connect 2 ,
+.Xr socket 2
+.Sh BUGS
 The
 The
-.I backlog
+.Fa backlog
 is currently limited (silently) to 5.
 is currently limited (silently) to 5.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 962e489..2ead535 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)lseek.2     6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH LSEEK 2 ""
-.UC 4
-.SH NAME
-lseek \- move read/write pointer
-.SH SYNOPSIS
-.nf
-.ft B
-#include <unistd.h>
-
-pos = lseek(d, offset, whence)
-off_t pos;
-int d;
-off_t offset;
-int whence;
-.fi
-.ft R
-.SH DESCRIPTION
-The descriptor 
-.I d
-refers to a file or device open for reading and/or writing.
-.I Lseek
-sets the file pointer of
-.I d
+.\"     @(#)lseek.2    6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt LSEEK 2
+.Os BSD 4
+.Sh NAME
+.Nm lseek
+.Nd reposition read/write file offset
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft off_t
+.Fn lseek "int fildes" "off_t offset" "int whence"
+.Sh DESCRIPTION
+The
+.Fn lseek
+function repositions the offset of the file descriptor
+.Fa fildes
+to the
+argument
+.Fa offset
+according to the directive
+.Fa whence.
+The argument
+.Fa fildes
+must be an open
+file descriptor.
+.Fn Lseek
+repositions the file pointer
+.Fa fildes
 as follows:
 as follows:
-.IP
+.Bl -item -offset indent
+.It
 If
 If
-.I whence
-is SEEK_SET, the pointer is set to
-.I offset
+.Fa whence
+is
+.Dv SEEK_SET ,
+the offset is set to
+.Fa offset
 bytes.
 bytes.
-.IP
+.It
 If
 If
-.I whence
-is SEEK_CUR, the pointer is set to its current location plus
-.IR offset .
-.IP
+.Fa whence
+is
+.Dv SEEK_CUR ,
+the offset is set to its current location plus
+.Fa offset
+bytes.
+.It
 If
 If
-.I whence
-is SEEK_END, the pointer is set to the size of the
+.Fa whence
+is
+.Dv SEEK_END ,
+the offset is set to the size of the
 file plus
 file plus
-.IR offset .
-.PP
-Upon successful completion, the resulting pointer location
-as measured in bytes from beginning of the file is returned.
+.Fa offset
+bytes.
+.El
+.Pp
+The
+.Fn lseek
+function allows the file offset to be set beyond the end
+of the existing end-of-file of the file. If data is later written
+at this point, subsequent reads of the data in the gap return
+bytes of zeros (until data is actualy written into the gap).
+.Pp
 Some devices are incapable of seeking.  The value of the pointer
 associated with such a device is undefined.
 Some devices are incapable of seeking.  The value of the pointer
 associated with such a device is undefined.
-.SH NOTES
-Seeking far beyond the end of a file, then writing,
-creates a gap or \*(lqhole\*(rq, which occupies no
-physical space and reads as zeros.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 Upon successful completion,
 Upon successful completion,
-the current file pointer value is returned.
+.Fn lseek
+returns the resulting offset location as measured in bytes from the
+begining of the file.
 Otherwise,
 Otherwise,
-a value of \-1 is returned and \fIerrno\fP is set to indicate
+a value of -1 is returned and
+.Va errno
+is set to indicate
 the error.
 the error.
-.SH "ERRORS
-.I Lseek
+.SERRORS
+.Fn Lseek
 will fail and the file pointer will remain unchanged if:
 will fail and the file pointer will remain unchanged if:
-.TP 15
-[EBADF]
-.I Fildes
+.Bl -tag -width [EINVAL]
+.It Bq Er EBADF
+.Em Fildes
 is not an open file descriptor.
 is not an open file descriptor.
-.TP 15
-[ESPIPE]
-.I Fildes
-is associated with a pipe or a socket.
-.TP 15
-[EINVAL]
-.I Whence
+.It Bq Er ESPIPE
+.Em Fildes
+is associated with a pipe, socket, or FIFO.
+.It Bq Er EINVAL
+.Fa Whence
 is not a proper value.
 is not a proper value.
-.SH "SEE ALSO"
-dup(2), open(2)
-.SH BUGS
+.El
+.Sh SEE ALSO
+.Xr dup 2 ,
+.Xr open 2
+.Sh BUGS
 This document's use of
 This document's use of
-.I whence
+.Fa whence
 is incorrect English, but maintained for historical reasons.
 is incorrect English, but maintained for historical reasons.
+.Sh STANDARDS
+The
+.Fn lseek
+function
+conforms to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index 108a4b8..2d9f89f 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)mkdir.2     6.6 (Berkeley) %G%
+.\"     @(#)mkdir.2    6.7 (Berkeley) %G%
 .\"
 .\"
-.TH MKDIR 2 ""
-.UC 5
-.SH NAME
-mkdir \- make a directory file
-.SH SYNOPSIS
-.nf
-.ft B
-mkdir(path, mode)
-char *path;
-int mode;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Mkdir
-creates a new directory file with name
-.IR path .
-The mode of the new file
-is initialized from
-.IR mode .
-(The protection part of the mode
-is modified by the process's mode mask; see
-.IR umask (2)).
-.PP
+.Dd 
+.Dt MKDIR 2
+.Os BSD 4.2
+.Sh NAME
+.Nm mkdir
+.Nd make a directory file
+.Sh SYNOPSIS
+.Fd #include <sys/stat.h>
+.Ft int
+.Fn mkdir "const char *path" "mode_t mode"
+.Sh DESCRIPTION
+The directory
+.Fa path
+is created with the access permissions specified by
+.Fa mode
+and restricted by the the
+.Xr umask 2
+of the calling process.
+.Pp
 The directory's owner ID is set to the process's effective user ID.
 The directory's group ID is set to that of the parent directory in
 which it is created.
 The directory's owner ID is set to the process's effective user ID.
 The directory's group ID is set to that of the parent directory in
 which it is created.
-.PP
-The low-order 9 bits of mode are modified by the process's
-file mode creation mask: all bits set in the process's file mode
-creation mask are cleared.  See
-.IR umask (2).
-.SH "RETURN VALUE
-A 0 return value indicates success.  A \-1 return value
+.Sh RETURN VALUES
+A 0 return value indicates success.  A -1 return value
 indicates an error, and an error code is stored in
 indicates an error, and an error code is stored in
-.I errno.
-.SH "ERRORS
-.I Mkdir
+.Va errno .
+.SERRORS
+.Fn Mkdir
 will fail and no directory will be created if:
 will fail and no directory will be created if:
-.TP 15
-[ENOTDIR]
+.Bl -tag -width ENAMETOOLO
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 A component of the path prefix does not exist.
 A component of the path prefix does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EPERM]
-The \fIpath\fP argument contains a byte with the high-order bit set.
-.TP 15
-[EROFS]
+.It Bq Er EPERM
+The
+.Fa path
+argument contains a byte with the high-order bit set.
+.It Bq Er EROFS
 The named file resides on a read-only file system.
 The named file resides on a read-only file system.
-.TP 15
-[EEXIST]
+.It Bq Er EEXIST
 The named file exists.
 The named file exists.
-.TP 15
-[ENOSPC]
+.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.
 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.
-.TP 15
-[ENOSPC]
+.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
 there is no space left on the file
 system that will contain the directory.
-.TP 15
-[ENOSPC]
+.It Bq Er ENOSPC
 There are no free inodes on the file system on which the
 directory is being created.
 There are no free inodes on the file system on which the
 directory is being created.
-.TP 15
-[EDQUOT]
+.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.
 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.
-.TP 15
-[EDQUOT]
+.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.
 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.
-.TP 15
-[EDQUOT]
+.It Bq Er EDQUOT
 The user's quota of inodes on the file system on
 which the directory is being created has been exhausted.
 The user's quota of inodes on the file system on
 which the directory is being created has been exhausted.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while making the directory entry or allocating the inode.
 An I/O error occurred while making the directory entry or allocating the inode.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.SH "SEE ALSO"
-chmod(2), stat(2), umask(2)
+.El
+.Sh SEE ALSO
+.Xr chmod 2 ,
+.Xr stat 2 ,
+.Xr umask 2
+.Sh STANDARDS
+.Fn Mkdir
+conforms to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index 80decc3..75150d9 100644 (file)
-.\" Copyright (c) 1990 The Regents of the University of California.
+.\" Copyright (c) 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)mkfifo.2    6.2 (Berkeley) %G%
+.\"     @(#)mkfifo.2   6.3 (Berkeley) %G%
 .\"
 .\"
-.TH MKFIFO 2 ""
-.UC 7
-.SH NAME
-mkfifo \- make a fifo file
-.SH SYNOPSIS
-.nf
-.ft B
-mkfifo(path, mode)
-char *path;
-int mode;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Mkfifo
+.Dd 
+.Dt MKFIFO 2
+.Os BSD 4.4
+.Sh NAME
+.Nm mkfifo
+.Nd make a fifo file
+.Sh SYNOPSIS
+.Fd #include <sys/stat.h>
+.Ft int
+.Fn mkfifo "const char *path" "mode_t mode"
+.Sh DESCRIPTION
+.Fn Mkfifo
 creates a new fifo file with name
 creates a new fifo file with name
-.IR path .
-The mode of the new file
-is initialized from
-.IR mode .
-(The protection part of the mode
-is modified by the process's mode mask; see
-.IR umask (2)).
-.PP
+.Fa path .
+The access permissions are
+specified by
+.Fa mode
+and restricted by the
+.Xr umask 2
+of the calling process.
+.Pp
 The fifo's owner ID is set to the process's effective user ID.
 The fifo's group ID is set to that of the parent directory in
 which it is created.
 The fifo's owner ID is set to the process's effective user ID.
 The fifo's group ID is set to that of the parent directory in
 which it is created.
-.PP
-The low-order 9 bits of mode are modified by the process's
-file mode creation mask: all bits set in the process's file mode
-creation mask are cleared.  See
-.IR umask (2).
-.SH "RETURN VALUE
-A 0 return value indicates success.  A \-1 return value
+.Sh RETURN VALUES
+A 0 return value indicates success.  A -1 return value
 indicates an error, and an error code is stored in
 indicates an error, and an error code is stored in
-.I errno.
-.SH "ERRORS
-.I Mkfifo
+.Va errno .
+.SERRORS
+.Fn Mkfifo
 will fail and no fifo will be created if:
 will fail and no fifo will be created if:
-.TP 15
-[ENOTSUPP]
+.Bl -tag -width ENAMETOOLO
+.It Bq Er ENOTSUPP
 The kernel has not been configured to support fifo's.
 The kernel has not been configured to support fifo's.
-.TP 15
-[ENOTDIR]
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 A component of the path prefix does not exist.
 A component of the path prefix does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EPERM]
-The \fIpath\fP argument contains a byte with the high-order bit set.
-.TP 15
-[EROFS]
+.It Bq Er EPERM
+The
+.Fa path
+argument contains a byte with the high-order bit set.
+.It Bq Er EROFS
 The named file resides on a read-only file system.
 The named file resides on a read-only file system.
-.TP 15
-[EEXIST]
+.It Bq Er EEXIST
 The named file exists.
 The named file exists.
-.TP 15
-[ENOSPC]
+.It Bq Er ENOSPC
 The directory in which the entry for the new fifo is being placed
 cannot be extended because there is no space left on the file
 system containing the directory.
 The directory in which the entry for the new fifo is being placed
 cannot be extended because there is no space left on the file
 system containing the directory.
-.TP 15
-[ENOSPC]
+.It Bq Er ENOSPC
 There are no free inodes on the file system on which the
 fifo is being created.
 There are no free inodes on the file system on which the
 fifo is being created.
-.TP 15
-[EDQUOT]
+.It Bq Er EDQUOT
 The directory in which the entry for the new fifo
 is being placed cannot be extended because the
 user's quota of disk blocks on the file system
 containing the directory has been exhausted.
 The directory in which the entry for the new fifo
 is being placed cannot be extended because the
 user's quota of disk blocks on the file system
 containing the directory has been exhausted.
-.TP 15
-[EDQUOT]
+.It Bq Er EDQUOT
 The user's quota of inodes on the file system on
 which the fifo is being created has been exhausted.
 The user's quota of inodes on the file system on
 which the fifo is being created has been exhausted.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while making the directory entry or allocating the inode.
 An I/O error occurred while making the directory entry or allocating the inode.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.SH "SEE ALSO"
-chmod(2), stat(2), umask(2)
+.El
+.Sh SEE ALSO
+.Xr chmod 2 ,
+.Xr stat 2 ,
+.Xr umask 2
+.Sh STANDARDS
+.Fn Mkfifo
+conforms to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index 73050b3..15ae33e 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)mknod.2     6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH MKNOD 2 ""
-.UC 4
-.SH NAME
-mknod \- make a special file
-.SH SYNOPSIS
-.nf
-.ft B
-mknod(path, mode, dev)
-char *path;
-int mode, dev;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Mknod
-creates a new file
-whose name is
-.I path.
-The mode of the new file
-(including special file bits)
-is initialized from
-.IR mode .
-(The protection part of the mode
-is modified by the process's mode mask (see
-.IR umask (2))).
-The first block pointer of the i-node
-is initialized from
-.I dev 
-and is used to specify which device the special file
-refers to.
-.PP
-If mode indicates a block or character special file,
-.I dev
+.\"     @(#)mknod.2    6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt MKNOD 2
+.Os BSD 4
+.Sh NAME
+.Nm mknod
+.Nd make a special file node
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn mknod "const char *path" "mode_t mode" "dev_t dev"
+.Sh DESCRIPTION
+The device special file
+.Fa path
+is created with the major and minor
+device numbers extracted from
+.Fa mode.
+The access permissions of
+.Fa path
+are descendant from the
+.Xr umask 2
+of the parent process.
+.Pp
+If
+.Fa mode
+indicates a block or character special file,
+.Fa dev
 is a configuration dependent specification of a character or block
 is a configuration dependent specification of a character or block
-I/O device.  If
-.I mode
+I/O device and the superblock of the device.  If
+.Fa mode
 does not indicate a block special or character special device,
 does not indicate a block special or character special device,
-.I dev
+.Fa dev
 is ignored.
 is ignored.
-.PP
-.I Mknod
-may be invoked only by the super-user.
-.SH "RETURN VALUE
+.Pp
+.Fn Mknod
+requires super-user privileges.
+.Sh RETURN VALUES
 Upon successful completion a value of 0 is returned.
 Upon successful completion a value of 0 is returned.
-Otherwise, a value of \-1 is returned and \fIerrno\fP
+Otherwise, a value of -1 is returned and
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Mknod
-will fail and the file mode will be unchanged if:
-.TP 15
-[ENOTDIR]
+.Sh ERRORS
+.Fn Mknod
+will fail and the file will be not created if:
+.Bl -tag -width Er
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 A component of the path prefix does not exist.
 A component of the path prefix does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The process's effective user ID is not super-user.
 The process's effective user ID is not super-user.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while making the directory entry or allocating the inode.
 An I/O error occurred while making the directory entry or allocating the inode.
-.TP 15
-[ENOSPC]
+.It Bq Er ENOSPC
 The directory in which the entry for the new node is being placed
 cannot be extended because there is no space left on the file
 system containing the directory.
 The directory in which the entry for the new node is being placed
 cannot be extended because there is no space left on the file
 system containing the directory.
-.TP 15
-[ENOSPC]
+.It Bq Er ENOSPC
 There are no free inodes on the file system on which the
 node is being created.
 There are no free inodes on the file system on which the
 node is being created.
-.TP 15
-[EDQUOT]
+.It Bq Er EDQUOT
 The directory in which the entry for the new node
 is being placed cannot be extended because the
 user's quota of disk blocks on the file system
 containing the directory has been exhausted.
 The directory in which the entry for the new node
 is being placed cannot be extended because the
 user's quota of disk blocks on the file system
 containing the directory has been exhausted.
-.TP 15
-[EDQUOT]
+.It Bq Er EDQUOT
 The user's quota of inodes on the file system on
 which the node is being created has been exhausted.
 The user's quota of inodes on the file system on
 which the node is being created has been exhausted.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The named file resides on a read-only file system.
 The named file resides on a read-only file system.
-.TP 15
-[EEXIST]
+.It Bq Er EEXIST
 The named file exists.
 The named file exists.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.SH "SEE ALSO"
-chmod(2), stat(2), umask(2)
+.El
+.Sh SEE ALSO
+.Xr chmod 2 ,
+.Xr stat 2 ,
+.Xr umask 2
+.Sh HISTORY
+A
+.Nm
+function call appeared in Version 6 AT&T UNIX.
index 7f3090c..7a6198b 100644 (file)
@@ -3,95 +3,97 @@
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)mount.2     6.10 (Berkeley) %G%
+.\"     @(#)mount.2    6.11 (Berkeley) %G%
 .\"
 .\"
-.TH MOUNT 2 ""
-.UC 4
-.SH NAME
-mount, unmount \- mount or remove file system
-.SH SYNOPSIS
-.nf
-#include <sys/mount.h>
-.sp
-.ft B
-mount(type, dir, flags, data)
-int type;
-char *dir;
-int flags;
-caddr_t data;
-.PP
-.ft B
-unmount(dir, flags)
-char *dir;
-int flags;
-.fi
-.SH DESCRIPTION
-.I Mount
-announces to the system that a file system has
-been mounted on the directory
-.IR dir ;
-following the mount, references to directory
-.I dir
-will refer to
-the root directory on the newly mounted file system.
-.I Dir
-is a pointer to a null-terminated string
-containing the appropriate path name
-which must be a directory that already exists.
-Its old contents are inaccessible while the
-file system is mounted.
-.PP
+.Dd 
+.Dt MOUNT 2
+.Os BSD 4
+.Sh NAME
+.Nm mount ,
+.Nm unmount
+.Nd mount or dismount a filesystem
+.Sh SYNOPSIS
+.Fd #include <sys/mount.h>
+.Ft int
+.Fn mount "int type" "const char *dir" "int flags" "caddr_t data"
+.Ft int
+.Fn unmount "const char *dir" "int flags"
+.Sh DESCRIPTION
 The
 The
-.I flag
-argument determines whether certain semantics should be
-suppressed when accessing the file system:
-.IP M_RDONLY 14
+.Fn mount
+function grafts
+a filesystem object onto the system file tree
+at the point
+.Ar dir .
+The argument
+.Ar data
+describes the filesystem object to be mounted.
+The argument
+.Ar type
+tells the kernel how to interpret
+.Ar data
+(See
+.Ar type
+below).
+The contents of the filesystem
+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.
+.Pp
+The following
+.Ar flags
+may be specified to
+suppress default semantics which affect filesystem access.
+.Bl -tag -width M_SYNCHRONOUS
+.It Dv M_RDONLY
 The file system should be treated as read-only;
 The file system should be treated as read-only;
-no writing is allowed (even by the super-user).
-Physically write-protected and magnetic
-tape file systems must be mounted read-only or
-errors will occur when access times are updated,
-whether or not any
-explicit write is attempted.
-.IP M_NOEXEC 14
+Even the super-user may not write on it.
+.It Dv M_NOEXEC
 Do not allow files to be executed from the file system.
 Do not allow files to be executed from the file system.
-.IP M_NOSUID 14
+.It Dv M_NOSUID
 Do not honor setuid or setgid bits on files when executing them.
 Do not honor setuid or setgid bits on files when executing them.
-.IP M_NODEV 14
+.It Dv M_NODEV
 Do not interpret special files on the file system.
 Do not interpret special files on the file system.
-.IP M_SYNCHRONOUS 14
+.It Dv M_SYNCHRONOUS
 All I/O to the file system should be done synchronously.
 All I/O to the file system should be done synchronously.
-.PP
-The flag M_UPDATE indicates that the mount command is being applied 
+.El
+.Pp
+The flag
+.Dv M_UPDATE
+indicates that the mount command is being applied 
 to an already mounted file system.
 This allows the mount flags to be changed without requiring
 that the file system be unmounted and remounted.
 Some file systems may not allow all flags to be changed.
 For example,
 most file systems will not allow a change from read-write to read-only.
 to an already mounted file system.
 This allows the mount flags to be changed without requiring
 that the file system be unmounted and remounted.
 Some file systems may not allow all flags to be changed.
 For example,
 most file systems will not allow a change from read-write to read-only.
-.PP
+.Pp
 The
 The
-.I type
+.Fa type
 argument defines the type of the file system.
 The types of file systems known to the system are defined in
 argument defines the type of the file system.
 The types of file systems known to the system are defined in
-.IR mount.h .
-.I Data
+.Aq Pa sys/mount.h .
+.Fa Data
 is a pointer to a structure that contains the type
 specific arguments to mount.
 The currently supported types of file systems and
 their type specific data are:
 is a pointer to a structure that contains the type
 specific arguments to mount.
 The currently supported types of file systems and
 their type specific data are:
-.IP MOUNT_UFS 6
-.nf
-.ta \w'struct  'u +\w'nfsv2fh_t  'u +\w'sockaddr_in *addr  'u
+.Pp
+.Dv MOUNT_UFS
+.Bd -literal -compact -offset indent
 struct ufs_args {
        char    *fspec; /* Block special file to mount */
        int     exflags;        /* export related flags */
        uid_t   exroot; /* mapping for root uid */
 };
 struct ufs_args {
        char    *fspec; /* Block special file to mount */
        int     exflags;        /* export related flags */
        uid_t   exroot; /* mapping for root uid */
 };
-.fi
-.sp
-.IP MOUNT_NFS 6
-.nf
+.Ed
+.Pp
+.Dv MOUNT_NFS
+.Bd -literal -compact -offset indent
 struct nfs_args {
        struct  sockaddr_in *addr;      /* file server address */
        nfsv2fh_t       *fh;    /* File handle to be mounted */
 struct nfs_args {
        struct  sockaddr_in *addr;      /* file server address */
        nfsv2fh_t       *fh;    /* File handle to be mounted */
@@ -102,191 +104,188 @@ struct nfs_args {
        int     retrans;        /* times to retry send */
        char    *hostname;      /* server's name */
 };
        int     retrans;        /* times to retry send */
        char    *hostname;      /* server's name */
 };
-.fi
-.IP MOUNT_MFS 6
-.nf
+.Ed
+.Pp
+.Dv MOUNT_MFS
+.Bd -literal -compact -offset indent
 struct mfs_args {
        char    *name;  /* name of backing process */
        caddr_t base;   /* base address of the file system */
        u_long  size;   /* size of the file system */
 };
 struct mfs_args {
        char    *name;  /* name of backing process */
        caddr_t base;   /* base address of the file system */
        u_long  size;   /* size of the file system */
 };
-.fi
-.sp
-.PP
-.I Umount
-announces to the system that the file system mounted at
-.I dir
-is no longer to contain that file system.
-The associated directory reverts to its ordinary interpretation.
-.PP
+.Ed
+.Pp
 The
 The
-.I flags
-argument may have the following values:
-.IP MNT_NOFORCE 12
+.Fn umount
+function call disassociates the filesystem from the specified
+mount point
+.Fa dir .
+.Pp
+The
+.Fa flags
+argument may have one of the following values:
+.Bl -tag -width  M_SYNCHRONOUS
+.It Dv MNT_NOFORCE
 The unmount should fail if any files are active on the file system.
 The unmount should fail if any files are active on the file system.
-.IP MNT_FORCE 12
+.It Dv MNT_FORCE
 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.
 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.
-.SH "RETURN VALUE
-.I Mount
-returns 0 if the action occurred, \-1 if an error occurred.
-The mount can fail if
-.I dir
-does not exist or is not a directory.
-For a
-.I ufs
-file system, the mount can fail if the special device
-specified in the ufs_args structure is
-inaccessible, is not an appropriate file, or is already mounted.
-A
-.I ufs
-or
-.I mfs
-mount can also fail if there are already too many
-file systems mounted.
-.PP
-.I Umount
-returns 0 if the action occurred; \-1 if an error occurred.
-The unmount will fail
-if there are active files in the mounted file system.
-.SH ERRORS
-.I Mount
+.El
+.Sh RETURN VALUES
+The
+.Fn mount
+returns the value 0 if the mount was successful, otherwise -1 is returned
+and the variable
+.Va errno
+is set to indicate the error.
+.Pp
+.Nm Umount
+returns the value 0 if the umount succeeded; otherwise -1 is returned
+and the variable
+.Va errno
+is set to indicate the error.
+.Sh ERRORS
+.Fn Mount
 will fail when one of the following occurs:
 will fail when one of the following occurs:
-.TP 15
-[EPERM]
+.Bl -tag -width [ENOTBLK]
+.It Bq Er EPERM
 The caller is not the super-user.
 The caller is not the super-user.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or the entire length of a path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or the entire length of a path name exceeded 1023 characters.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating a pathname.
 Too many symbolic links were encountered in translating a pathname.
-.TP 15
-[ENOENT]
-A component of \fIdir\fP does not exist.
-.TP 15
-[ENOTDIR]
-A component of \fIname\fP is not a directory,
-or a path prefix of \fIspecial\fP is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er ENOENT
+A component of
+.Fa dir
+does not exist.
+.It Bq Er ENOTDIR
+A component of
+.Ar name
+is not a directory,
+or a path prefix of
+.Ar special
+is not a directory.
+.It Bq Er EINVAL
 A pathname contains a character with the high-order bit set.
 A pathname contains a character with the high-order bit set.
-.TP 15
-[EBUSY]
+.It Bq Er EBUSY
 Another process currently holds a reference to
 Another process currently holds a reference to
-.IR dir .
-.TP 15
-[EFAULT]
-\fIDir\fP points outside the process's allocated address space.
-.PP
+.Fa dir .
+.It Bq Er EFAULT
+.Fa Dir
+points outside the process's allocated address space.
+.El
+.Pp
 The following errors can occur for a
 The following errors can occur for a
-.I ufs
+.Em ufs
 file system mount:
 file system mount:
-.TP 15
-[ENODEV]
-A component of ufs_args \fIfspec\fP does not exist.
-.TP 15
-[ENOTBLK]
-.I Fspec
+.Bl -tag -width [ENOTBLK]
+.It Bq Er ENODEV
+A component of ufs_args
+.Ar fspec
+does not exist.
+.It Bq Er ENOTBLK
+.Ar Fspec
 is not a block device.
 is not a block device.
-.TP 15
-[ENXIO]
+.It Bq Er ENXIO
 The major device number of 
 The major device number of 
-.I fspec
+.Ar fspec
 is out of range (this indicates no device driver exists
 for the associated hardware).
 is out of range (this indicates no device driver exists
 for the associated hardware).
-.TP 15
-[EBUSY]
-\fIFspec\fP is already mounted.
-.TP 15
-[EMFILE]
+.It Bq Er EBUSY
+.Ar Fspec
+is already mounted.
+.It Bq Er EMFILE
 No space remains in the mount table.
 No space remains in the mount table.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The super block for the file system had a bad magic
 number or an out of range block size.
 The super block for the file system had a bad magic
 number or an out of range block size.
-.TP 15
-[ENOMEM]
+.It Bq Er ENOMEM
 Not enough memory was available to read the cylinder
 group information for the file system.
 Not enough memory was available to read the cylinder
 group information for the file system.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading the super block or
 cylinder group information.
 An I/O error occurred while reading the super block or
 cylinder group information.
-.TP 15
-[EFAULT]
-\fIFspec\fP points outside the process's allocated address space.
-.PP
+.It Bq Er EFAULT
+.Ar Fspec
+points outside the process's allocated address space.
+.El
+.Pp
 The following errors can occur for a
 The following errors can occur for a
-.I nfs
+.Em nfs
 file system mount:
 file system mount:
-.TP 15
-[ETIMEDOUT]
-.I Nfs
+.Bl -tag -width [ENOTBLK]
+.It Bq Er ETIMEDOUT
+.Em Nfs
 timed out trying to contact the server.
 timed out trying to contact the server.
-.TP 15
-[EFAULT]
+.It Bq Er EFAULT
 Some part of the information described by nfs_args
 points outside the process's allocated address space.
 Some part of the information described by nfs_args
 points outside the process's allocated address space.
-.PP
+.El
+.Pp
 The following errors can occur for a
 The following errors can occur for a
-.I mfs
+.Em mfs
 file system mount:
 file system mount:
-.TP 15
-[EMFILE]
+.Bl -tag -width [ENOTBLK]
+.It Bq Er EMFILE
 No space remains in the mount table.
 No space remains in the mount table.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The super block for the file system had a bad magic
 number or an out of range block size.
 The super block for the file system had a bad magic
 number or an out of range block size.
-.TP 15
-[ENOMEM]
+.It Bq Er ENOMEM
 Not enough memory was available to read the cylinder
 group information for the file system.
 Not enough memory was available to read the cylinder
 group information for the file system.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An paging error occurred while reading the super block or
 cylinder group information.
 An paging error occurred while reading the super block or
 cylinder group information.
-.TP 15
-[EFAULT]
-\fIName\fP points outside the process's allocated address space.
-.PP
-.I Umount
+.It Bq Er EFAULT
+.Em Name
+points outside the process's allocated address space.
+.El
+.Pp
+.Em Umount
 may fail with one of the following errors:
 may fail with one of the following errors:
-.TP 15
-[EPERM]
+.Bl -tag -width [ENOTBLK]
+.It Bq Er EPERM
 The caller is not the super-user.
 The caller is not the super-user.
-.TP 15
-[ENOTDIR]
+.It Bq Er ENOTDIR
 A component of the path is not a directory.
 A component of the path is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The requested directory is not in the mount table.
 The requested directory is not in the mount table.
-.TP 15
-[EBUSY]
+.It Bq Er EBUSY
 A process is holding a reference to a file located
 on the file system.
 A process is holding a reference to a file located
 on the file system.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while writing cached file system information.
 An I/O error occurred while writing cached file system information.
-.TP 15
-[EFAULT]
-\fIDir\fP points outside the process's allocated address space.
-.SH "SEE ALSO"
-mount(8), umount(8), mfs(8)
-.SH BUGS
+.It Bq Er EFAULT
+.Fa Dir
+points outside the process's allocated address space.
+.El
+.Pp
+A
+.Em ufs
+or
+.Em mfs
+mount can also fail if the maximum number of filesystems are currently
+mounted.
+.Sh SEE ALSO
+.Xr mount 8 ,
+.Xr umount 8 ,
+.Xr mfs 8
+.Sh BUGS
 Some of the error codes need translation to more obvious messages.
 Some of the error codes need translation to more obvious messages.
+.Sh HISTORY
+.Fn Mount
+and
+.Fn umount
+function calls appeared in Version 6 AT&T UNIX.
index e318ae2..75441ac 100644 (file)
@@ -1,47 +1,53 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)nfssvc.2    6.4 (Berkeley) %G%
+.\"     @(#)nfssvc.2   6.5 (Berkeley) %G%
 .\"
 .\"
-.TH NFSSVC 2 ""
-.UC 7
-.SH NAME
-nfssvc \- create a remote NFS server
-.SH SYNOPSIS
-.nf
-.ft B
-.LP
-nfssvc(sock)
-int sock;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Nfssvc
+.Dd 
+.Dt NFSSVC 2
+.Os BSD 4.4
+.Sh NAME
+.Nm nfssvc
+.Nd create a remote NFS server
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn nfssvc "int sock"
+.Sh DESCRIPTION
+.Bf -symbolic
+The calling sequence of this function is expected to change
+.Ef
+.Fn Nfssvc
 starts an
 starts an
-.SM NFS
+.Tn NFS
 daemon listening on socket
 daemon listening on socket
-.IR sock .
+.Fa sock .
 The socket must be in the
 The socket must be in the
-.SM AF_INET
-family and of type
-.SM SOCK_DGRAM .
-.SH RETURN VALUE
-Normally this system calls does not return unless the server
+.Dv AF_INET
+family.
+.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 at which time a value of 0 is returned.
-Otherwise, \-1 is returned and the global variable
-.I errno
+Otherwise, -1 is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Nfssvc
-fails if one or more of the following are true:
-.TP 15
-EBADF
-.I fd
+.Sh ERRORS
+.Fn Nfssvc
+fails if:
+.Bl -tag -width [EPERM]
+.It Bq Er EBADF
+.Fa Fd
 is not a valid open file descriptor.
 is not a valid open file descriptor.
-.TP 15
-EPERM
+.It Bq Er EPERM
 The caller is not the super-user.
 The caller is not the super-user.
-.SH SEE ALSO
-.IR nfsd (8)
+.El
+.Sh SEE ALSO
+.Xr nfsd 8
+.Sh HISTORY
+The
+.Nm
+function call is currently under development.
index 5c0cd5a..4dc01df 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)open.2      6.5 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH OPEN 2 ""
-.UC 4
-.SH NAME
-open \- open a file for reading or writing, or create a new file
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/file.h>
-.PP
-.ft B
-open(path, flags, mode)
-char *path;
-int flags, mode;
-.fi
-.SH DESCRIPTION
-.I Open
-opens the file
-.I path
-for reading and/or writing, as specified by the
-.I flags
-argument and returns a descriptor for that file.
+.\"     @(#)open.2     6.6 (Berkeley) %G%
+.\"
+.Dd 
+.Dt OPEN 2
+.Os BSD 4
+.Sh NAME
+.Nm open
+.Nd open or create a file for reading or writing
+.Sh SYNOPSIS
+.Fd #include <sys/file.h>
+.Ft int
+.Fn open "const char *path" "int flags" "mode_t mode"
+.Sh DESCRIPTION
+The file name specified by
+.Fa path
+is opened
+for reading and/or writing as specified by the
+argument
+.Fa flags
+and the file descriptor returned to the calling process.
 The
 The
-.I flags
+.Fa flags
 argument may indicate the file is to be
 argument may indicate the file is to be
-created if it does not already exist (by specifying the
-O_CREAT flag), in which case the file is created with mode
-.I mode
+created if it does not exist (by specifying the
+.Dv O_CREAT
+flag), in which case the file is created with mode
+.Fa mode
 as described in
 as described in
-.IR chmod (2)
+.Xr chmod 2
 and modified by the process' umask value (see
 and modified by the process' umask value (see
-.IR umask (2)).
-.PP
-.I Path
-is the address of a string of ASCII characters representing
-a path name, terminated by a null character.
+.Xr umask 2 ) .
+.Pp
 The flags specified are formed by
 The flags specified are formed by
-.IR or 'ing
+.Em or Ap ing
 the following values
 the following values
-.PP
-.RS
- O_RDONLY      open for reading only
- O_WRONLY      open for writing only
- O_RDWR        open for reading and writing
- O_NDELAY      do not block on open
- O_APPEND      append on each write
- O_CREAT       create file if it does not exist
- O_TRUNC       truncate size to 0
- O_EXCL        error if create and file exists
-.RE
-.PP
-Opening a file with O_APPEND set causes each write on the file
-to be appended to the end.  If O_TRUNC is specified and the
+.Pp
+.Bd -literal -offset indent -compact
+O_RDONLY       open for reading only
+O_WRONLY       open for writing only
+O_RDWR         open for reading and writing
+O_NDELAY       do not block on open
+O_APPEND       append on each write
+O_CREAT                create file if it does not exist
+O_TRUNC                truncate size to 0
+O_EXCL         error if create and file exists
+.Ed
+.Pp
+Opening a file with
+.Dv O_APPEND
+set causes each write on the file
+to be appended to the end.  If
+.Dv O_TRUNC
+is specified and the
 file exists, the file is truncated to zero length.
 file exists, the file is truncated to zero length.
-If O_EXCL is set with O_CREAT, then if the file already
-exists, the open returns an error.  This can be used to
+If
+.Dv O_EXCL
+is set with
+.Dv O_CREAT
+and the file already
+exists,
+.Fn open
+returns an error.  This may be used to
 implement a simple exclusive access locking mechanism.
 implement a simple exclusive access locking mechanism.
-If O_EXCL is set and the last component of the pathname is
-a symbolic link, the open will fail even if the symbolic
+If
+.Dv O_EXCL
+is set and the last component of the pathname is
+a symbolic link,
+.Fn open
+will fail even if the symbolic
 link points to a non-existent name.
 link points to a non-existent name.
-If the O_NDELAY flag is specified and the open call would result
-in the process being blocked for some reason (e.g. waiting for
-carrier on a dialup line), the open returns immediately. 
-The first time the process attempts to perform i/o on the open
+If the
+.Dv O_NDELAY
+flag is specified and the
+.Fn open
+call would result
+in the process being blocked for some reason (e.g., waiting for
+carrier on a dialup line),
+.Fn open
+returns immediately.
+The first time the process attempts to perform I/O on the open
 file it will block (not currently implemented).
 file it will block (not currently implemented).
-.PP
-If successful, \fIopen\fP returns a non-negative integer, termed a
+.Pp
+If successful,
+.Fn open
+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.
 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
+.Pp
 The new descriptor is set to remain open across
 The new descriptor is set to remain open across
-.IR execve
+.Xr execve
 system calls; see
 system calls; see
-.IR close (2).
-.PP
+.Xr close 2
+and
+.Xr fcntl 2 .
+.Pp
 The system imposes a limit on the number of file descriptors
 open simultaneously by one process.
 The system imposes a limit on the number of file descriptors
 open simultaneously by one process.
-.IR Getdtablesize (2)
+.Xr Getdtablesize 2
 returns the current system limit.
 returns the current system limit.
-.SH "ERRORS
-The named file is opened unless one or more of the
-following are true:
-.TP 15
-[ENOTDIR]
+.Sh ERRORS
+The named file is opened unless:
+.Bl -tag -width Er
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
-O_CREAT is not set and the named file does not exist.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
+.Dv O_CREAT
+is not set and the named file does not exist.
+.It Bq Er ENOENT
 A component of the path name that must exist does not exist.
 A component of the path name that must exist does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 The required permissions (for reading and/or writing)
 The required permissions (for reading and/or writing)
-are denied for the named flag.
-.TP 15
-[EACCES]
-O_CREAT is specified,
+are denied for the given flags.
+.It Bq Er EACCES
+.Dv O_CREAT
+is specified,
 the file does not exist,
 and the directory in which it is to be created
 does not permit writing.
 the file does not exist,
 and the directory in which it is to be created
 does not permit writing.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EISDIR]
+.It Bq Er EISDIR
 The named file is a directory, and the arguments specify
 The named file is a directory, and the arguments specify
-it is to be opened for writting.
-.TP 15
-[EROFS]
+it is to be opened for writing.
+.It Bq Er EROFS
 The named file resides on a read-only file system,
 and the file is to be modified.
 The named file resides on a read-only file system,
 and the file is to be modified.
-.TP 15
-[EMFILE]
-The system limit for open file descriptors per process has already been reached.
-.TP 15
-[ENFILE]
+.It Bq Er EMFILE
+The process has already reached its limit for open file descriptors.
+.It Bq Er ENFILE
 The system file table is full.
 The system file table is full.
-.TP 15
-[ENXIO]
+.It Bq Er ENXIO
 The named file is a character special or block
 special file, and the device associated with this special file
 does not exist.
 The named file is a character special or block
 special file, and the device associated with this special file
 does not exist.
-.TP 15
-[ENOSPC]
-O_CREAT is specified,
+.It Bq Er ENOSPC
+.Dv O_CREAT
+is specified,
 the file does not exist,
 and the directory in which the entry for the new file is being placed
 cannot be extended because there is no space left on the file
 system containing the directory.
 the file does not exist,
 and the directory in which the entry for the new file is being placed
 cannot be extended because there is no space left on the file
 system containing the directory.
-.TP 15
-[ENOSPC]
-O_CREAT is specified,
+.It Bq Er ENOSPC
+.Dv O_CREAT
+is specified,
 the file does not exist,
 and there are no free inodes on the file system on which the
 file is being created.
 the file does not exist,
 and there are no free inodes on the file system on which the
 file is being created.
-.TP 15
-[EDQUOT]
-O_CREAT is specified,
+.It Bq Er EDQUOT
+.Dv O_CREAT
+is specified,
 the file does not exist,
 and the directory in which the entry for the new fie
 is being placed cannot be extended because the
 user's quota of disk blocks on the file system
 containing the directory has been exhausted.
 the file does not exist,
 and the directory in which the entry for the new fie
 is being placed cannot be extended because the
 user's quota of disk blocks on the file system
 containing the directory has been exhausted.
-.TP 15
-[EDQUOT]
-O_CREAT is specified,
+.It Bq Er EDQUOT
+.Dv O_CREAT
+is specified,
 the file does not exist,
 and the user's quota of inodes on the file system on
 which the file is being created has been exhausted.
 the file does not exist,
 and the user's quota of inodes on the file system on
 which the file is being created has been exhausted.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while making the directory entry or
 An I/O error occurred while making the directory entry or
-allocating the inode for O_CREAT.
-.TP 15
-[ETXTBSY]
+allocating the inode for
+.Dv O_CREAT .
+.It Bq Er ETXTBSY
 The file is a pure procedure (shared text) file that is being
 The file is a pure procedure (shared text) file that is being
-executed and the \fIopen\fP call requests write access.
-.TP 15
-[EFAULT]
-.I Path
+executed and the
+.Fn open
+call requests write access.
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.TP 15
-[EEXIST]
-O_CREAT and O_EXCL were specified and the file exists.
-.TP 15
-[EOPNOTSUPP]
+.It Bq Er EEXIST
+.Dv O_CREAT
+and
+.Dv O_EXCL
+were specified and the file exists.
+.It Bq Er EOPNOTSUPP
 An attempt was made to open a socket (not currently implemented).
 An attempt was made to open a socket (not currently implemented).
-.SH "SEE ALSO"
-chmod(2), close(2), dup(2), getdtablesize(2),
-lseek(2), read(2), write(2), umask(2)
+.El
+.Sh SEE ALSO
+.Xr chmod 2 ,
+.Xr close 2 ,
+.Xr dup 2 ,
+.Xr getdtablesize 2 ,
+.Xr lseek 2 ,
+.Xr read 2 ,
+.Xr write 2 ,
+.Xr umask 2
+.Sh HISTORY
+An
+.Nm
+function call appeared in Version 6 AT&T UNIX.
index a6906a8..b042055 100644 (file)
@@ -1,80 +1,89 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)pipe.2      6.3 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH PIPE 2 ""
-.UC 4
-.SH NAME
-pipe \- create an interprocess communication channel
-.SH SYNOPSIS
-.nf
-.ft B
-pipe(fildes)
-int fildes[2];
-.fi
-.ft R
-.SH DESCRIPTION
+.\"     @(#)pipe.2     6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt PIPE 2
+.Os BSD 4
+.Sh NAME
+.Nm pipe
+.Nd create descriptor pair for interprocess communication
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn pipe "int *fildes"
+.Sh DESCRIPTION
 The
 The
-.I pipe
-system call
-creates an I/O mechanism called a pipe.
-The file descriptors returned can
-be used in read and write operations.
-When the pipe is written using the descriptor
-.IR fildes [1]
-up to 4096 bytes of data are buffered
-before the writing process is suspended.
-A read using the descriptor
-.IR fildes [0]
-will pick up the data.
-.PP
-It is assumed that after the
-pipe has been set up,
-two (or more)
-cooperating processes
-(created by subsequent
-.I fork
-calls)
-will pass data through the
-pipe with
-.I read
-and
-.I write
-calls.
-.PP
-The shell has a syntax
-to set up a linear array of processes
-connected by pipes.
-.PP
-Read calls on an empty
-pipe (no buffered data) with only one end
-(all write file descriptors closed)
-returns an end-of-file.
-.PP
+.Fn pipe
+function
+creates a
+.Em pipe ,
+which is an object allowing
+unidirectional data flow,
+and allocates a pair of file descriptors.
+The first descriptor connects to the
+.Em read end
+of the pipe,
+and the second connects to the
+.Em write end  ,
+so that data written to
+.Fa fildes[1]
+appears on (i.e., can be read from)
+.Fa fildes[0] .
+This allows the output of one program to be
+sent
+to another program:
+the source's standard output is set up to be
+the write end of the pipe,
+and the sink's standard input is set up to be
+the read end of the pipe.
+The pipe itself persists until all its associated descriptors are
+closed.
+.Pp
+A pipe whose read or write end has been closed is considered
+.Em widowed .
+Writing on such a pipe causes the writing process to receive
+a
+.Dv SIGPIPE
+signal.
+Widowing a pipe is the only way to deliver end-of-file to a reader:
+after the reader consumes any buffered data, reading a widowed pipe
+returns a zero count.
+.Pp
 Pipes are really a special case of the 
 Pipes are really a special case of the 
-.IR socketpair (2)
+.Xr socketpair 2
 call and, in fact, are implemented as such in the system.
 call and, in fact, are implemented as such in the system.
-.PP
-A signal is generated if a write on a pipe with only one end is attempted.
-.SH "RETURN VALUE
-The function value zero is returned if the
-pipe was created; \-1 if an error occurred.
-.SH ERRORS
-The \fIpipe\fP call will fail if:
-.TP 15
-[EMFILE]
+.Sh RETURN VALUES
+On successful creation of the pipe, zero is returned. Otherwise, 
+a value of -1 is returned and the variable
+.Va errno
+set to indicate the
+error.
+.Sh ERRORS
+The
+.Fn pipe
+call will fail if:
+.Bl -tag -width [EMFILE]
+.It Bq Er EMFILE
 Too many descriptors are active.
 Too many descriptors are active.
-.TP 15
-[ENFILE]
+.It Bq Er ENFILE
 The system file table is full.
 The system file table is full.
-.TP 15
-[EFAULT]
-The \fIfildes\fP buffer is in an invalid area of the process's address
+.It Bq Er EFAULT
+The
+.Fa fildes
+buffer is in an invalid area of the process's address
 space.
 space.
-.SH "SEE ALSO"
-sh(1), read(2), write(2), fork(2), socketpair(2)
-.SH BUGS
-Should more than 4096 bytes be necessary in any
-pipe among a loop of processes, deadlock will occur.
+.El
+.Sh SEE ALSO
+.Xr sh 1 ,
+.Xr read 2 ,
+.Xr write 2 ,
+.Xr fork 2 ,
+.Xr socketpair 2
+.Sh HISTORY
+A
+.Nm
+function call appeared in Version 6 AT&T UNIX.
index 25bd791..a7e0003 100644 (file)
-.\" Copyright (c) 1983, 1990 Regents of the University of California.
+.\" Copyright (c) 1983, 1990, 1991 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.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Robert Elz at The University of Melbourne.
-.\"
 .\" %sccs.include.redist.man%
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)quotactl.2  6.11 (Berkeley) %G%
+.\"     @(#)quotactl.2 6.12 (Berkeley) %G%
 .\"
 .\"
-.TH QUOTACTL 2 ""
-.UC 7
-.SH NAME
-quotactl \- manipulate disk quotas
-.SH SYNOPSIS
-.BI "#include <ufs/quota.h>" " /* for ``ufs'' quotas */"
-.PP
-.nf
-.B quotactl(path, cmd, id, addr)
-.B char *path;
-.B int cmd, id;
-.B char *addr;
-.fi
-.SH DESCRIPTION
-The
-.I quotactl
-call is used to enable and disable quotas and
-to manipulate disk quotas for filesystems on
-which quotas have been enabled.
-.I Path
-is the path name of any file within the mounted filesystem
-to which the quota control command is to be applied.
+.Dd 
+.Dt QUOTACTL 2
+.Os BSD 4.4
+.Sh NAME
+.Nm quotactl
+.Nd manipulate filesystem quotas
+.Sh SYNOPSIS
+.Ft #include <ufs/quota.h>     /* for ufs quotas */
+.Ft int
+.Fn quotactl "const char *path" "int cmd" "int id" "char *addr"
+.Sh DESCRIPTION
 The
 The
-.I cmd
-parameter indicates a command to be applied to the
-.IR id .
-.I Addr
-is the address of an optional, command specific, data structure
-that is copied in or out of the system.  The interpretation of
-.I addr
-is given with each command.
-.PP
+.Fn quotactl
+call enables, disables and
+manipulates filesystem quotas.
+A quota control command
+given by
+.Fa cmd
+operates on the given filename
+.Fa path
+for the given user
+.Fa id .
+The address of an optional command specific data structure,
+.Fa addr ,
+may be given; its interpretation
+is discussed below with each command.
+.Pp
 Currently quotas are supported only for the ``ufs'' filesystem.
 For ``ufs'',
 a command is composed of a primary command (see below)
 Currently quotas are supported only for the ``ufs'' filesystem.
 For ``ufs'',
 a command is composed of a primary command (see below)
-and a command type that is used to interpret the
-.IR id .
+and a command type used to interpret the
+.Fa id .
 Types are supported for interpretation of user identifiers
 and group identifiers.
 The ``ufs'' specific commands are:
 Types are supported for interpretation of user identifiers
 and group identifiers.
 The ``ufs'' specific commands are:
-.TP
-Q_QUOTAON
+.Bl -tag -width Q_QUOTAON
+.It Dv Q_QUOTAON
 Enable disk quotas for the filesystem specified by
 Enable disk quotas for the filesystem specified by
-.IR path .
+.Fa path .
 The command type specifies the type of the quotas being enabled.
 The
 The command type specifies the type of the quotas being enabled.
 The
-.I addr
+.Fa addr
 argument specifies a file from which to take the quotas.
 The quota file must exist;
 it is normally created with the 
 argument specifies a file from which to take the quotas.
 The quota file must exist;
 it is normally created with the 
-.IR quotacheck (8)
+.Xr quotacheck 8
 program.
 The
 program.
 The
-.I id
+.Fa id
 argument is unused.
 Only the super-user may turn quotas on.
 argument is unused.
 Only the super-user may turn quotas on.
-.TP
-Q_QUOTAOFF
+.It Dv Q_QUOTAOFF
 Disable disk quotas for the filesystem specified by
 Disable disk quotas for the filesystem specified by
-.I path .
+.Fa path .
 The command type specifies the type of the quotas being disabled.
 The
 The command type specifies the type of the quotas being disabled.
 The
-.I addr
+.Fa addr
 and
 and
-.I id
+.Fa id
 arguments are unused.
 Only the super-user may turn quotas off.
 arguments are unused.
 Only the super-user may turn quotas off.
-.TP
-Q_GETQUOTA
+.It Dv Q_GETQUOTA
 Get disk quota limits and current usage for the user or group
 (as determined by the command type) with identifier
 Get disk quota limits and current usage for the user or group
 (as determined by the command type) with identifier
-.IR id .
-.I Addr
-is a pointer to a struct dqblk structure (defined in 
-.RI < ufs/quota.h >).
-.TP
-Q_SETQUOTA
+.Fa id .
+.Fa Addr
+is a pointer to a
+.Fa struct dqblk
+structure (defined in 
+.Ao Pa ufs/quota.h Ac ) .
+.It Dv Q_SETQUOTA
 Set disk quota limits for the user or group
 (as determined by the command type) with identifier
 Set disk quota limits for the user or group
 (as determined by the command type) with identifier
-.IR id .
-.I Addr
-is a pointer to a struct dqblk structure (defined in 
-.RI < ufs/quota.h >).
-The usage fields of the dqblk structure are ignored.
+.Fa id .
+.Fa Addr
+is a pointer to a
+.Fa struct dqblk
+structure (defined in 
+.Ao Pa ufs/quota.h Ac ) .
+The usage fields of the
+.Fa dqblk
+structure are ignored.
 This call is restricted to the super-user.
 This call is restricted to the super-user.
-.TP
-Q_SETUSE
+.It Dv Q_SETUSE
 Set disk usage limits for the user or group
 (as determined by the command type) with identifier
 Set disk usage limits for the user or group
 (as determined by the command type) with identifier
-.IR id .
-.I Addr
-is a pointer to a struct dqblk structure (defined in
-.RI < ufs/quota.h >).
+.Fa id .
+.Fa Addr
+is a pointer to a
+.Fa struct dqblk
+structure (defined in
+.Ao Pa ufs/quota.h Ac ) .
 Only the usage fields are used.
 This call is restricted to the super-user.
 Only the usage fields are used.
 This call is restricted to the super-user.
-.TP
-Q_SYNC
+.It Dv Q_SYNC
 Update the on-disk copy of quota usages.
 The command type specifies which type of quotas are to be updated.
 Update the on-disk copy of quota usages.
 The command type specifies which type of quotas are to be updated.
-The \fIid\fP and \fIaddr\fP parameters are ignored.
-.SH "RETURN VALUE"
+The
+.Fa id
+and
+.Fa addr
+parameters are ignored.
+.El
+.Sh RETURN VALUES
 A successful call returns 0,
 A successful call returns 0,
-otherwise the value \-1 is returned and the global variable
-.I errno
+otherwise the value -1 is returned and the global variable
+.Va errno
 indicates the reason for the failure.
 indicates the reason for the failure.
-.SH ERRORS
-A \fIquotactl\fP call will fail when one of the following occurs:
-.TP 15
-[EOPNOTSUPP]
-The kernel has not been compiled with the QUOTA option.
-.TP 15
-[EUSERS]
+.Sh ERRORS
+A
+.Fn quotactl
+call will fail if:
+.Bl -tag -width ENAMETOOLONGAA
+.It Bq Er EOPNOTSUPP
+The kernel has not been compiled with the
+.Dv QUOTA
+option.
+.It Bq Er EUSERS
 The quota table cannot be expanded.
 The quota table cannot be expanded.
-.TP 15
-[EINVAL]
-.I Cmd
+.It Bq Er EINVAL
+.Fa Cmd
 or the command type is invalid.
 or the command type is invalid.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 A pathname contains a character with the high-order bit set.
 A pathname contains a character with the high-order bit set.
-.TP 15
-[EACCES]
-In Q_QUOTAON, the quota file is not a plain file.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
+In
+.Dv Q_QUOTAON ,
+the quota file is not a plain file.
+.It Bq Er EACCES
 Search permission is denied for a component of a path prefix.
 Search permission is denied for a component of a path prefix.
-.TP 15
-[ENOTDIR]
-A component of a path prefix is not a directory.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENOTDIR
+A component of a path prefix was not a directory.
+.It Bq Er ENAMETOOLONG
 A component of either pathname exceeded 255 characters,
 or the entire length of either path name exceeded 1023 characters.
 A component of either pathname exceeded 255 characters,
 or the entire length of either path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 A filename does not exist.
 A filename does not exist.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating a pathname.
 Too many symbolic links were encountered in translating a pathname.
-.TP 15
-[EROFS]
-In Q_QUOTAON, the quota file resides on a read-only filesystem.
-.TP 15
-[EIO]
+.It Bq Er EROFS
+In
+.Dv Q_QUOTAON ,
+the quota file resides on a read-only filesystem.
+.It Bq Er EIO
 An I/O error occurred while reading from or writing
 to a file containing quotas.
 An I/O error occurred while reading from or writing
 to a file containing quotas.
-.TP 15
-[EFAULT]
+.It Bq Er EFAULT
 An invalid
 An invalid
-.I addr
-is supplied; the associated structure could not be copied in or out
+.Fa addr
+was supplied; the associated structure could not be copied in or out
 of the kernel.
 of the kernel.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.TP 15
-[EPERM]
-The call is privileged and the caller was not the super-user.
-.SH "SEE ALSO"
-quota(1),
-fstab(5),
-edquota(8), quotacheck(8), quotaon(8), repquota(8)
-.SH BUGS
+.It Bq Er EPERM
+The call was privileged and the caller was not the super-user.
+.El
+.Sh SEE ALSO
+.Xr quota 1 ,
+.Xr fstab 5 ,
+.Xr edquota 8 ,
+.Xr quotacheck 8 ,
+.Xr quotaon 8 ,
+.Xr repquota 8
+.Sh BUGS
 There should be some way to integrate this call with the resource
 limit interface provided by
 There should be some way to integrate this call with the resource
 limit interface provided by
-.IR setrlimit (2)
+.Xr setrlimit 2
 and
 and
-.IR getrlimit (2).
+.Xr getrlimit 2 .
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.3 Reno .
index 35dee7f..f0a0af9 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)read.2      6.6 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH READ 2 ""
-.UC 4
-.SH NAME
-read, readv \- read input
-.SH SYNOPSIS
-.nf
-.ft B
-cc = read(d, buf, nbytes)
-int cc, d;
-char *buf;
-int nbytes;
-.PP
-.ft B
-#include <sys/types.h>
-#include <sys/uio.h>
-.PP
-.ft B
-cc = readv(d, iov, iovcnt)
-int cc, d;
-struct iovec *iov;
-int iovcnt;
-.fi
-.SH DESCRIPTION
-.I Read
+.\"     @(#)read.2     6.7 (Berkeley) %G%
+.\"
+.Dd 
+.Dt READ 2
+.Os BSD 4
+.Sh NAME
+.Nm read ,
+.Nm readv
+.Nd read input
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Fd #include <sys/types.h>
+.Fd #include <sys/uio.h>
+.Ft ssize_t
+.Fn read "int d" "char *buf" "size_t nbytes"
+.Ft int
+.Fn readv "int d" "struct iovec *iov" "int iovcnt"
+.Sh DESCRIPTION
+.Fn Read
 attempts to read
 attempts to read
-.I nbytes
+.Fa nbytes
 of data from the object referenced by the descriptor
 of data from the object referenced by the descriptor
-.I d
+.Fa d
 into the buffer pointed to by
 into the buffer pointed to by
-.IR buf .
-.I Readv
+.Fa buf .
+.Fn Readv
 performs the same action, but scatters the input data
 into the 
 performs the same action, but scatters the input data
 into the 
-.I iovcnt
+.Fa iovcnt
 buffers specified by the members of the
 buffers specified by the members of the
-.I iov
+.Fa iov
 array: iov[0], iov[1], ..., iov[iovcnt\|\-\|1].
 array: iov[0], iov[1], ..., iov[iovcnt\|\-\|1].
-.PP
+.Pp
 For 
 For 
-.IR readv ,
+.Fn readv ,
 the 
 the 
-.I iovec
+.Fa iovec
 structure is defined as
 structure is defined as
-.PP
-.nf
-.RS
-.DT
+.Bd -literal -offset indent -compact
 struct iovec {
        caddr_t iov_base;
        int     iov_len;
 };
 struct iovec {
        caddr_t iov_base;
        int     iov_len;
 };
-.RE
-.fi
-.PP
+.Ed
+.Pp
 Each 
 Each 
-.I iovec
+.Fa iovec
 entry specifies the base address and length of an area
 in memory where data should be placed. 
 entry specifies the base address and length of an area
 in memory where data should be placed. 
-.I Readv
+.Fn Readv
 will always fill an area completely before proceeding
 to the next.
 will always fill an area completely before proceeding
 to the next.
-.PP
+.Pp
 On objects capable of seeking, the
 On objects capable of seeking, the
-.I read
+.Fn read
 starts at a position
 given by the pointer associated with
 starts at a position
 given by the pointer associated with
-.IR d 
+.Fa d
 (see
 (see
-.IR lseek (2)).
+.Xr lseek 2 ) .
 Upon return from
 Upon return from
-.IR read ,
+.Fn read ,
 the pointer is incremented by the number of bytes actually read.
 the pointer is incremented by the number of bytes actually read.
-.PP
+.Pp
 Objects that are not capable of seeking always read from the current
 position.  The value of the pointer associated with such an
 object is undefined.
 Objects that are not capable of seeking always read from the current
 position.  The value of the pointer associated with such an
 object is undefined.
-.PP
+.Pp
 Upon successful completion,
 Upon successful completion,
-.I read
+.Fn read
 and
 and
-.I readv
+.Fn readv
 return the number of bytes actually read and placed in the buffer.
 The system guarantees to read the number of bytes requested if
 the descriptor references a normal file that has that many bytes left
 before the end-of-file, but in no other case.
 return the number of bytes actually read and placed in the buffer.
 The system guarantees to read the number of bytes requested if
 the descriptor references a normal file that has that many bytes left
 before the end-of-file, but in no other case.
-.PP
-If the returned value is 0, then
-end-of-file has been reached.
-.SH "RETURN VALUE
+.Pp
+.Sh RETURN VALUES
 If successful, the
 If successful, the
-number of bytes actually read is returned.
-Otherwise, a \-1 is returned and the global variable
-.I errno
+number of bytes actually read is returned. Upon reading end-of-file,
+zero is returned.
+Otherwise, a -1 is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH "ERRORS
-.I Read
+.SERRORS
+.Fn Read
 and
 and
-.I readv
-will fail if one or more of the following are true:
-.TP 15
-[EBADF]
-\fID\fP is not a valid file or socket descriptor open for reading.
-.TP 15
-[EFAULT]
-\fIBuf\fP points outside the allocated address space.
-.TP 15
-[EIO]
+.Fn readv
+will succeed unless:
+.Bl -tag -width Er
+.It Bq Er EBADF
+.Fa D
+is not a valid file or socket descriptor open for reading.
+.It Bq Er EFAULT
+.Fa Buf
+points outside the allocated address space.
+.It Bq Er EIO
 An I/O error occurred while reading from the file system.
 An I/O error occurred while reading from the file system.
-.TP 15
-[EINTR]
+.It Bq Er EINTR
 A read from a slow device was interrupted before
 any data arrived by the delivery of a signal.
 A read from a slow device was interrupted before
 any data arrived by the delivery of a signal.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pointer associated with
 The pointer associated with
-.I d
+.Fa d
 was negative.
 was negative.
-.TP 15
-[EWOULDBLOCK]
+.It Bq Er EWOULDBLOCK
 The file was marked for non-blocking I/O,
 and no data were ready to be read.
 The file was marked for non-blocking I/O,
 and no data were ready to be read.
-.PP
+.El
+.Pp
 In addition, 
 In addition, 
-.I readv
+.Fn readv
 may return one of the following errors:
 may return one of the following errors:
-.TP 15
-[EINVAL]
-.I Iovcnt
+.Bl -tag -width Er
+.It Bq Er EINVAL
+.Fa Iovcnt
 was less than or equal to 0, or greater than 16.
 was less than or equal to 0, or greater than 16.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 One of the
 One of the
-.I iov_len
+.Fa iov_len
 values in the
 values in the
-.I iov
+.Fa iov
 array was negative.
 array was negative.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The sum of the
 The sum of the
-.I iov_len
+.Fa iov_len
 values in the
 values in the
-.I iov
+.Fa iov
 array overflowed a 32-bit integer.
 array overflowed a 32-bit integer.
-.TP 15
-[EFAULT]
-Part of the \fIiov\fP points outside the process's allocated address space.
-.SH "SEE ALSO"
-dup(2), fcntl(2), open(2), pipe(2), select(2), socket(2), socketpair(2)
+.It Bq Er EFAULT
+Part of the
+.Fa iov
+points outside the process's allocated address space.
+.El
+.Sh SEE ALSO
+.Xr dup 2 ,
+.Xr fcntl 2 ,
+.Xr open 2 ,
+.Xr pipe 2 ,
+.Xr select 2 ,
+.Xr socket 2 ,
+.Xr socketpair 2
+.Sh STANDARDS
+.Fn Read
+is expected to conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
+.Sh HISTORY
+The
+.Fn readv
+function call
+appeared in
+.Bx 4.2 .
+A
+.Nm read
+function call
+appeared in
+Version 6 AT&T UNIX.
index 6b95e1b..2bcf2ec 100644 (file)
@@ -1,67 +1,69 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)readlink.2  6.7 (Berkeley) %G%
+.\"     @(#)readlink.2 6.8 (Berkeley) %G%
 .\"
 .\"
-.TH READLINK 2 ""
-.UC 5
-.SH NAME
-readlink \- read value of a symbolic link
-.SH SYNOPSIS
-.nf
-.ft B
-cc = readlink(path, buf, bufsiz)
-int cc;
-char *path, *buf;
-int bufsiz;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Readlink
+.Dd 
+.Dt READLINK 2
+.Os BSD 4.2
+.Sh NAME
+.Nm readlink
+.Nd read value of a symbolic link
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn readlink "const char *path" "char *buf" "int bufsiz"
+.Sh DESCRIPTION
+.Fn Readlink
 places the contents of the symbolic link
 places the contents of the symbolic link
-.I name
+.Fa path
 in the buffer
 in the buffer
-.I buf,
+.Fa buf ,
 which has size
 which has size
-.IR bufsiz . 
-The contents of the link are not null terminated when returned.
-.SH "RETURN VALUE
+.Fa bufsiz .
+.Nm Readlink
+does not append a
+.Dv NUL
+character to
+.Fa buf .
+.Sh RETURN VALUES
 The call returns the count of characters placed in the buffer
 The call returns the count of characters placed in the buffer
-if it succeeds, or a \-1 if an error occurs, placing the error
-code in the global variable \fIerrno\fP.
-.SH "ERRORS
-.I Readlink
+if it succeeds, or a -1 if an error occurs, placing the error
+code in the global variable
+.Va errno .
+.Sh ERRORS
+.Fn Readlink
 will fail if:
 will fail if:
-.TP 15
-[ENOTDIR]
+.Bl -tag -width ENAMETOOLONG
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named file does not exist.
 The named file does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The named file is not a symbolic link.
 The named file is not a symbolic link.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from the file system.
 An I/O error occurred while reading from the file system.
-.TP 15
-[EFAULT]
-.I Buf
+.It Bq Er EFAULT
+.Fa Buf
 extends outside the process's allocated address space.
 extends outside the process's allocated address space.
-.SH SEE ALSO
-stat(2), lstat(2), symlink(2)
+.El
+.Sh SEE ALSO
+.Xr stat 2 ,
+.Xr lstat 2 ,
+.Xr symlink 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 761d4e5..793bfd6 100644 (file)
-.\" Copyright (c) 1980 The Regents of the University of California.
+.\" Copyright (c) 1980, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)reboot.2    6.4 (Berkeley) %G%
+.\"     @(#)reboot.2   6.5 (Berkeley) %G%
 .\"
 .\"
-.TH REBOOT 2 ""
-.UC 4
-.SH NAME
-reboot \- reboot system or halt processor
-.SH SYNOPSIS
-.nf
-.B #include <sys/reboot.h>
-.PP
-.B reboot(howto)
-.B int howto;
-.fi
-.SH DESCRIPTION
-.I Reboot
+.Dd 
+.Dt REBOOT 2
+.Os BSD 4
+.Sh NAME
+.Nm reboot
+.Nd reboot system or halt processor
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Fd #include <sys/reboot.h>
+.Ft int
+.Fn reboot "int howto"
+.Sh DESCRIPTION
+.Fn Reboot
 reboots the system.
 Only the super-user may reboot a machine on demand.
 However, a reboot is invoked
 automatically in the event of unrecoverable system failures.
 reboots the system.
 Only the super-user may reboot a machine on demand.
 However, a reboot is invoked
 automatically in the event of unrecoverable system failures.
-.PP
-.I Howto
-is a mask of options; the system call interface passes the following
-options, defined in the include file ``<sys/reboot.h>'', to be passed
+.Pp
+.Fa Howto
+is a mask of options; the system call interface allows the following
+options, defined in the include file
+.Aq Pa sys/reboot.h ,
+to be passed
 to the new kernel or the new bootstrap and init programs.
 to the new kernel or the new bootstrap and init programs.
-.TP
-RB_AUTOBOOT
+.Bl -tag -width RB_INITNAMEA
+.It Dv RB_AUTOBOOT
 The default, causing the system to reboot in its usual fashion.
 The default, causing the system to reboot in its usual fashion.
-.TP
-RB_ASKNAME
+.It Dv RB_ASKNAME
 Interpreted by the bootstrap program itself, causing it to
 prompt on the console as to what file should be booted.
 Interpreted by the bootstrap program itself, causing it to
 prompt on the console as to what file should be booted.
-Normally, the system is booted from the file ``\fIxx\fP(0,0)vmunix'',
-where \fIxx\fP is the default disk name,
+Normally, the system is booted from the file
+.Dq Em xx Ns No (0,0)vmunix ,
+where
+.Em xx
+is the default disk name,
 without prompting for the file name.
 without prompting for the file name.
-.TP
-RB_DFLTROOT
+.It Dv RB_DFLTROOT
 Use the compiled in root device.
 Normally, the system uses the device from which it was booted
 as the root device if possible.
 (The default behavior is dependent on the ability of the bootstrap program
 to determine the drive from which it was loaded, which is not possible
 on all systems.)
 Use the compiled in root device.
 Normally, the system uses the device from which it was booted
 as the root device if possible.
 (The default behavior is dependent on the ability of the bootstrap program
 to determine the drive from which it was loaded, which is not possible
 on all systems.)
-.TP
-RB_DUMP
+.It Dv RB_DUMP
 Dump kernel memory before rebooting; see
 Dump kernel memory before rebooting; see
-.IR savecore (8)
+.Xr savecore 8
 for more information.
 for more information.
-.TP
-RB_HALT
+.It Dv RB_HALT
 the processor is simply halted; no reboot takes place.
 This option should be used with caution.
 the processor is simply halted; no reboot takes place.
 This option should be used with caution.
-.TP
-RB_INITNAME
+.It Dv RB_INITNAME
 An option allowing the specification of an init program (see
 An option allowing the specification of an init program (see
-.IR init (8)
-other than ``/sbin/init'' to be run when the system reboots.
+.Xr init 8 )
+other than
+.Pa /sbin/init
+to be run when the system reboots.
 This switch is not currently available.
 This switch is not currently available.
-.TP
-RB_KDB
+.It Dv RB_KDB
 Load the symbol table and enable a built-in debugger in the system.
 This option will have no useful function if the kernel is not configured
 for debugging.
 Several other options have different meaning if combined
 with this option, although their use may not be possible
 via the
 Load the symbol table and enable a built-in debugger in the system.
 This option will have no useful function if the kernel is not configured
 for debugging.
 Several other options have different meaning if combined
 with this option, although their use may not be possible
 via the
-.I reboot 
+.Fn reboot
 call.
 See
 call.
 See
-.IR kadb (4)
+.Xr kadb 4
 for more information.
 for more information.
-.TP
-RB_NOSYNC
+.It Dv RB_NOSYNC
 Normally, the disks are sync'd (see
 Normally, the disks are sync'd (see
-.IR sync (8))
+.Xr sync 8 )
 before the processor is halted or rebooted.
 This option may be useful if file system changes have been made manually
 or if the processor is on fire.
 before the processor is halted or rebooted.
 This option may be useful if file system changes have been made manually
 or if the processor is on fire.
-.TP
-RB_RDONLY
+.It Dv RB_RDONLY
 Initially mount the root file system read-only.
 Initially mount the root file system read-only.
-This is currently the default, and this option has been deprecated as
-a no-op.
-.TP
-RB_SINGLE
+This is currently the default, and this option has been deprecated.
+.It Dv RB_SINGLE
 Normally, the reboot procedure involves an automatic disk consistency
 check and then multi-user operations.
 Normally, the reboot procedure involves an automatic disk consistency
 check and then multi-user operations.
-RB_SINGLE prevents this, booting the system with a single-user shell
+.Dv RB_SINGLE
+prevents this, booting the system with a single-user shell
 on the console.
 on the console.
-RB_SINGLE is actually interpreted by the
-.IR init (8)
+.Dv RB_SINGLE
+is actually interpreted by the
+.Xr init 8
 program in the newly booted system.
 program in the newly booted system.
-.PP
-When no options are given (i.e., RB_AUTOBOOT is used), the system is
+.Pp
+When no options are given (i.e.,
+.Dv RB_AUTOBOOT
+is used), the system is
 rebooted from file ``vmunix'' in the root file system of unit 0
 of a disk chosen in a processor specific way.
 rebooted from file ``vmunix'' in the root file system of unit 0
 of a disk chosen in a processor specific way.
-An automatic consistency check of the disks is then normally performed
+An automatic consistency check of the disks is normally performed
 (see
 (see
-.IR fsck (8)).
-.SH "RETURN VALUES"
+.Xr fsck 8 ) .
+.El
+.Sh RETURN VALUES
 If successful, this call never returns.
 If successful, this call never returns.
-Otherwise, a \-1 is returned and an error is returned in the global
+Otherwise, a -1 is returned and an error is returned in the global
 variable
 variable
-.IR errno .
-.SH ERRORS
-.TP 15
-[EPERM]
+.Va errno .
+.Sh ERRORS
+.Bl -tag -width Er
+.It Bq Er EPERM
 The caller is not the super-user.
 The caller is not the super-user.
-.SH "SEE ALSO"
-kadb(4), crash(8), halt(8), init(8), reboot(8), savecore(8)
-.SH BUGS
-The HP300 implementation supports neither RB_DFLTROOT or RB_KDB.
+.El
+.Sh SEE ALSO
+.Xr kadb 4 ,
+.Xr crash 8 ,
+.Xr halt 8 ,
+.Xr init 8 ,
+.Xr reboot 8 ,
+.Xr savecore 8
+.Sh BUGS
+The HP300 implementation supports neither
+.Dv RB_DFLTROOT
+nor
+.Dv RB_KDB .
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.0 .
index a95dcb8..7e26fcb 100644 (file)
-.\" Copyright (c) 1983, 1990 The Regents of the University of California.
+.\" Copyright (c) 1983, 1990, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)recv.2      6.8 (Berkeley) %G%
+.\"     @(#)recv.2     6.9 (Berkeley) %G%
 .\"
 .\"
-.TH RECV 2 ""
-.UC 5
-.SH NAME
-recv, recvfrom, recvmsg \- receive a message from a socket
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/socket.h>
-.PP
-.ft B
-cc = recv(s, buf, len, flags)
-int cc, s;
-char *buf;
-int len, flags;
-.PP
-.ft B
-cc = recvfrom(s, buf, len, flags, from, fromlen)
-int cc, s;
-char *buf;
-int len, flags;
-struct sockaddr *from;
-int *fromlen;
-.PP
-.ft B
-cc = recvmsg(s, msg, flags)
-int cc, s;
-struct msghdr *msg;
-int flags;
-.ft R
-.SH DESCRIPTION
-.IR Recvfrom ,
+.Dd 
+.Dt RECV 2
+.Os BSD 4.2
+.Sh NAME
+.Nm recv ,
+.Nm recvfrom ,
+.Nm recvmsg
+.Nd receive a message from a socket
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/socket.h>
+.Ft int
+.Fn recv "int s" "char *buf" "int len" "int flags"
+.Ft int
+.Fn recvfrom "int s" "char *buf" "int len" "int flags" "struct sockaddr *from" "int *fromlen"
+.Ft int
+.Fn recvmsg "int s" "struct msghdr *msg" "int flags"
+.Sh DESCRIPTION
+.Fn Recvfrom
 and
 and
-.IR recvmsg
+.Fn recvmsg
 are used to receive messages from a socket,
 and may be used to receive data on a socket whether
 it is in a connected state or not.
 are used to receive messages from a socket,
 and may be used to receive data on a socket whether
 it is in a connected state or not.
-.PP
+.Pp
 If
 If
-.I from
-is non-zero, the source address of the message is filled in.
-.I Fromlen
+.Fa from
+is non-nil, the source address of the message is filled in.
+.Fa Fromlen
 is a value-result parameter, initialized to the size of
 the buffer associated with
 is a value-result parameter, initialized to the size of
 the buffer associated with
-.IR from ,
+.Fa from ,
 and modified on return to indicate the actual size of the
 address stored there.
 and modified on return to indicate the actual size of the
 address stored there.
-.PP
+.Pp
 The 
 The 
-.I recv
+.Fn recv
 call is normally used only on a 
 call is normally used only on a 
-.I connected
+.Em connected
 socket (see
 socket (see
-.IR connect (2))
-and is identitical to
-.I recfrom
-with a zero-valued
-.I fromlen
+.Xr connect 2 )
+and is identical to
+.Fn recvfrom
+with a nil
+.Fa from
 parameter.
 As it is redundant, it may not be supported in future releases.
 parameter.
 As it is redundant, it may not be supported in future releases.
-.PP
-The length of the message is returned in
-.IR cc .
+.Pp
+All three routines return the length of the message on successful
+completion.
 If a message is too long to fit in the supplied buffer,
 excess bytes may be discarded depending on the type of socket
 the message is received from (see
 If a message is too long to fit in the supplied buffer,
 excess bytes may be discarded depending on the type of socket
 the message is received from (see
-.IR socket (2)).
-.PP
+.Xr socket 2 ) .
+.Pp
 If no messages are available at the socket, the
 receive call waits for a message to arrive, unless
 the socket is nonblocking (see
 If no messages are available at the socket, the
 receive call waits for a message to arrive, unless
 the socket is nonblocking (see
-.IR ioctl (2))
-in which case a
-.I cc
-of \-1 is returned with the external variable errno
-set to EWOULDBLOCK.
-.PP
+.Xr ioctl 2 )
+in which case the value
+-1 is returned and the external variable
+.Va errno
+set to
+.Er EWOULDBLOCK.
+.Pp
 The
 The
-.IR select (2)
+.Xr select 2
 call may be used to determine when more data arrives.
 call may be used to determine when more data arrives.
-.PP
+.Pp
 The
 The
-.I flags
+.Fa flags
 argument to a recv call is formed by 
 argument to a recv call is formed by 
-.IR or 'ing
-one or more of the values,
-.PP
-.nf
-.RS
-.ta \w'#define\ \ 'u +\w'MSG_DONTROUTE\ \ \ 'u +\w'0x\0\0\0\ \ 'u
-#define        MSG_OOB 0x1     /* process out-of-band data */
+.Em or Ap ing
+one or more of the values:
+.Bd -literal
+#define        MSG_OOB         0x1     /* process out-of-band data */
 #define        MSG_PEEK        0x2     /* peek at incoming message */
 #define        MSG_DONTROUTE   0x4     /* send without using routing tables */
 #define        MSG_PEEK        0x2     /* peek at incoming message */
 #define        MSG_DONTROUTE   0x4     /* send without using routing tables */
-#define        MSG_EOR 0x8     /* data completes record */
+#define        MSG_EOR         0x8     /* data completes record */
 #define        MSG_TRUNC       0x10    /* data discarded before delivery */
 #define        MSG_CTRUNC      0x20    /* control data lost before delivery */
 #define        MSG_TRUNC       0x10    /* data discarded before delivery */
 #define        MSG_CTRUNC      0x20    /* control data lost before delivery */
-.RE
-.fi
-.PP
+.Ed
+.Pp
 The
 The
-.I recvmsg
+.Fn recvmsg
 call uses a 
 call uses a 
-.I msghdr
+.Fa msghdr
 structure to minimize the number of directly supplied parameters.
 This structure has the following form, as defined in
 structure to minimize the number of directly supplied parameters.
 This structure has the following form, as defined in
-.IR <sys/socket.h> :
-.PP
-.nf
-.ta \w'struct  'u +\w'caddr_t   'u +\w'msg_controllen    'u
+.Ao Pa sys/socket.h Ac :
+.Pp
+.Bd -literal
 struct msghdr {
        caddr_t msg_name;       /* optional address */
        u_int   msg_namelen;    /* size of address */
        struct  iovec *msg_iov; /* scatter/gather array */
        u_int   msg_iovlen;     /* # elements in msg_iov */
        caddr_t msg_control;    /* ancillary data, see below */
 struct msghdr {
        caddr_t msg_name;       /* optional address */
        u_int   msg_namelen;    /* size of address */
        struct  iovec *msg_iov; /* scatter/gather array */
        u_int   msg_iovlen;     /* # elements in msg_iov */
        caddr_t msg_control;    /* ancillary data, see below */
-       u_int   msg_controllen; /* ancillary data buffer len */
-       int     msg_flags;              /* flags on received message */
+       u_int   msg_controllen; /* ancillary data buffer len */
+       int     msg_flags;      /* flags on received message */
 };
 };
-.fi
-.PP
+.Ed
+.Pp
 Here
 Here
-.I msg_name
+.Fa msg_name
 and
 and
-.I msg_namelen
+.Fa msg_namelen
 specify the destination address if the socket is unconnected;
 specify the destination address if the socket is unconnected;
-.I msg_name
+.Fa msg_name
 may be given as a null pointer if no names are desired or required.
 may be given as a null pointer if no names are desired or required.
-The
-.I msg_iov
+.Fa Msg_iov
 and
 and
-.I msg_iovlen
-describe the scatter gather locations, as described in
-.IR read (2).
-.IR msg_control ,
+.Fa msg_iovlen
+describe scatter gather locations, as discussed in
+.Xr read 2 .
+.Fa Msg_control ,
 which has length
 which has length
-.IR msg_controllen .
-This is a buffer for other protocol control related messages
+.Fa msg_controllen ,
+points to a buffer for other protocol control related messages
 or other miscellaneous ancillary data.
 The messages are of the form:
 or other miscellaneous ancillary data.
 The messages are of the form:
-.PP
-.nf
-.ta \w'struct  'u +\w'u_char   'u +\w'msg_controllen    'u
+.Bd -literal
 struct cmsghdr {
        u_int   cmsg_len;       /* data byte count, including hdr */
        int     cmsg_level;     /* originating protocol */
 struct cmsghdr {
        u_int   cmsg_len;       /* data byte count, including hdr */
        int     cmsg_level;     /* originating protocol */
@@ -154,49 +134,71 @@ struct cmsghdr {
 /* followed by
        u_char  cmsg_data[]; */
 };
 /* followed by
        u_char  cmsg_data[]; */
 };
-.fi
-.RE
+.Ed
 As an example, one could use this to learn of changes in the data-stream
 in XNS/SPP, or in ISO, to obtain user-connection-request data by requesting
 a recvmsg with no uio provided immediately after an
 As an example, one could use this to learn of changes in the data-stream
 in XNS/SPP, or in ISO, to obtain user-connection-request data by requesting
 a recvmsg with no uio provided immediately after an
-.IR accept (),
+.Fn accept ,
 thought of here in the sense of get-next-connection-request without
 an implicit connection confirmation.
 thought of here in the sense of get-next-connection-request without
 an implicit connection confirmation.
-.PP
-Open file descriptors are now passed as ancillary data for AF_UNIX
-domain sockets, with cmsg_level being SOL_SOCKET and  cmsg_type being
-SCM_RIGHTS.
-.PP
-.I msg_flags
-is set on return in a way that may include some of the same values specified
-for the flags parameter to a recv system call.
-The returned values MSG_EOR indicates end-of-record, MSG_TRUNC indicates that
-some trailing datagram data was discarded, MSG_CTRUNC indicates that some
-control data was discarded due to lack of space.
-MSG_OOB is returned to indicate that expedited data was received.
-.PP
-.SH "RETURN VALUE"
-These calls return the number of bytes received, or \-1
+.Pp
+Open file descriptors are now passed as ancillary data for
+.Dv AF_UNIX
+domain sockets, with
+.Fa cmsg_level
+being
+.Dv SOL_SOCKET
+and
+.Fa cmsg_type
+being
+.Dv SCM_RIGHTS .
+.Pp
+.Fa Msg_flags
+is set on return according to the message received.
+.Dv MSG_EOR
+indicates end-of-record,
+.Dv MSG_TRUNC
+indicates that
+some trailing datagram data was discarded,
+.Dv MSG_CTRUNC
+indicates that some
+control data was discarded due to lack of space,
+.Dv MSG_OOB
+is returned to indicate that expedited data was received.
+.Pp
+.Sh RETURN VALUES
+These calls return the number of bytes received, or -1
 if an error occurred.
 if an error occurred.
-.SH ERRORS
+.Sh ERRORS
 The calls fail if:
 The calls fail if:
-.TP 20
-[EBADF]
-The argument \fIs\fP is an invalid descriptor.
-.TP 20
-[ENOTSOCK]
-The argument \fIs\fP is not a socket.
-.TP 20
-[EWOULDBLOCK]
+.Bl -tag -width EWOULDBLOCKAA
+.It Bq Er EBADF
+The argument
+.Fa s
+is an invalid descriptor.
+.It Bq Er ENOTSOCK
+The argument
+.Fa s
+is not a socket.
+.It Bq Er EWOULDBLOCK
 The socket is marked non-blocking and the receive operation
 would block.
 The socket is marked non-blocking and the receive operation
 would block.
-.TP 20
-[EINTR]
+.It Bq Er EINTR
 The receive was interrupted by delivery of a signal before
 The receive was interrupted by delivery of a signal before
-any data was available for the receive.
-.TP 20
-[EFAULT]
-The data was specified to be received into a non-existent
-or protected part of the process address space.
-.SH SEE ALSO
-fcntl(2), read(2), send(2), select(2), getsockopt(2), socket(2)
+any data was available.
+.It Bq Er EFAULT
+The receive buffer pointer(s) point outside the process's
+address space.
+.El
+.Sh SEE ALSO
+.Xr fcntl 2 ,
+.Xr read 2 ,
+.Xr send 2 ,
+.Xr select 2 ,
+.Xr getsockopt 2 ,
+.Xr socket 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index ecf9d75..b857f4d 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)rename.2    6.6 (Berkeley) %G%
+.\"     @(#)rename.2   6.7 (Berkeley) %G%
 .\"
 .\"
-.TH RENAME 2 ""
-.UC 5
-.SH NAME
-rename \- change the name of a file
-.SH SYNOPSIS
-.ft B
-.nf
-rename(from, to)
-char *from, *to;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Rename
+.Dd 
+.Dt RENAME 2
+.Os BSD 4.2
+.Sh NAME
+.Nm rename
+.Nd change the name of a file
+.Sh SYNOPSIS
+.Fd #include <stdio.h>
+.Ft int
+.Fn rename "const char *from" "const char *to"
+.Sh DESCRIPTION
+.Fn Rename
 causes the link named
 causes the link named
-.I from
+.Fa from
 to be renamed as
 to be renamed as
-.IR to .
+.Fa to .
 If 
 If 
-.I to
-exists, then it is first removed.
+.Fa to
+exists, it is first removed.
 Both 
 Both 
-.I from
+.Fa from
 and
 and
-.I to
+.Fa to
 must be of the same type (that is, both directories or both
 non-directories), and must reside on the same file system.
 must be of the same type (that is, both directories or both
 non-directories), and must reside on the same file system.
-.PP
-.I Rename
+.Pp
+.Fn Rename
 guarantees that an instance of
 guarantees that an instance of
-.I to
+.Fa to
 will always exist, even if the system should crash in
 the middle of the operation.
 will always exist, even if the system should crash in
 the middle of the operation.
-.PP
+.Pp
 If the final component of
 If the final component of
-.I from
+.Fa from
 is a symbolic link,
 the symbolic link is renamed,
 not the file or directory to which it points.
 is a symbolic link,
 the symbolic link is renamed,
 not the file or directory to which it points.
-.SH CAVEAT
+.Sh CAVEAT
 The system can deadlock if a loop in the file system graph is present.
 The system can deadlock if a loop in the file system graph is present.
-This loop takes the form of an entry in directory \*(lqa\*(rq,
-say \*(lqa/foo\*(rq,
-being a hard link to directory \*(lqb\*(rq, and an entry in
-directory \*(lqb\*(rq, say \*(lqb/bar\*(rq, being a hard link
-to directory \*(lqa\*(rq.
+This loop takes the form of an entry in directory
+.Ql Pa a ,
+say
+.Ql Pa a/foo ,
+being a hard link to directory
+.Ql Pa b ,
+and an entry in
+directory
+.Ql Pa b ,
+say
+.Ql Pa b/bar ,
+being a hard link
+to directory
+.Ql Pa a .
 When such a loop exists and two separate processes attempt to
 When such a loop exists and two separate processes attempt to
-perform \*(lqrename a/foo b/bar\*(rq and \*(lqrename b/bar a/foo\*(rq,
+perform
+.Ql rename a/foo b/bar
+and
+.Ql rename b/bar a/foo ,
 respectively, 
 the system may deadlock attempting to lock
 both directories for modification.
 Hard links to directories should be
 replaced by symbolic links by the system administrator.
 respectively, 
 the system may deadlock attempting to lock
 both directories for modification.
 Hard links to directories should be
 replaced by symbolic links by the system administrator.
-.SH "RETURN VALUE"
+.Sh RETURN VALUES
 A 0 value is returned if the operation succeeds, otherwise
 A 0 value is returned if the operation succeeds, otherwise
-.I rename
-returns \-1 and the global variable 
-.I errno
+.Fn rename
+returns -1 and the global variable 
+.Va errno
 indicates the reason for the failure.
 indicates the reason for the failure.
-.SH "ERRORS
-.I Rename
+.SERRORS
+.Fn Rename
 will fail and neither of the argument files will be
 will fail and neither of the argument files will be
-affected if any of the following are true:
-.TP 15
-[EINVAL]
+affected if:
+.Bl -tag -width ENAMETOOLONG
+.It Bq Er EINVAL
 Either pathname contains a character with the high-order bit set.
 Either pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of either pathname exceeded 255 characters,
 or the entire length of either path name exceeded 1023 characters.
 A component of either pathname exceeded 255 characters,
 or the entire length of either path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
-A component of the \fIfrom\fP path does not exist,
-or a path prefix of \fIto\fP does not exist.
-.TP 15
-[EACCES]
+.It Bq Er ENOENT
+A component of the
+.Fa from
+path does not exist,
+or a path prefix of
+.Fa to
+does not exist.
+.It Bq Er EACCES
 A component of either path prefix denies search permission.
 A component of either path prefix denies search permission.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 The requested link requires writing in a directory with a mode
 that denies write permission.
 The requested link requires writing in a directory with a mode
 that denies write permission.
-.TP 15
-[EPERM]
-The directory containing \fIfrom\fP is marked sticky,
-and neither the containing directory nor \fIfrom\fP
+.It Bq Er EPERM
+The directory containing
+.Fa from
+is marked sticky,
+and neither the containing directory nor
+.Fa from
 are owned by the effective user ID.
 are owned by the effective user ID.
-.TP 15
-[EPERM]
-The \fIto\fP file exists,
-the directory containing \fIto\fP is marked sticky,
-and neither the containing directory nor \fIto\fP
+.It Bq Er EPERM
+The
+.Fa to
+file exists,
+the directory containing
+.Fa to
+is marked sticky,
+and neither the containing directory nor
+.Fa to
 are owned by the effective user ID.
 are owned by the effective user ID.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating either pathname.
 Too many symbolic links were encountered in translating either pathname.
-.TP 15
-[ENOTDIR]
+.It Bq Er ENOTDIR
 A component of either path prefix is not a directory.
 A component of either path prefix is not a directory.
-.TP 15
-[ENOTDIR]
-.I From
-is a directory, but \fIto\fP is not a directory.
-.TP 15
-[EISDIR]
-.I To
-is a directory, but \fIfrom\fP is not a directory.
-.TP 15
-[EXDEV]
-The link named by \fIto\fP and the file named by \fIfrom\fP
+.It Bq Er ENOTDIR
+.Fa from
+is a directory, but
+.Fa to
+is not a directory.
+.It Bq Er EISDIR
+.Fa to
+is a directory, but
+.Fa from
+is not a directory.
+.It Bq Er EXDEV
+The link named by
+.Fa to
+and the file named by
+.Fa from
 are on different logical devices (file systems).  Note that this error
 code will not be returned if the implementation permits cross-device
 links.
 are on different logical devices (file systems).  Note that this error
 code will not be returned if the implementation permits cross-device
 links.
-.TP 15
-[ENOSPC]
+.It Bq Er ENOSPC
 The directory in which the entry for the new name is being placed
 cannot be extended because there is no space left on the file
 system containing the directory.
 The directory in which the entry for the new name is being placed
 cannot be extended because there is no space left on the file
 system containing the directory.
-.TP 15
-[EDQUOT]
+.It Bq Er EDQUOT
 The directory in which the entry for the new name
 is being placed cannot be extended because the
 user's quota of disk blocks on the file system
 containing the directory has been exhausted.
 The directory in which the entry for the new name
 is being placed cannot be extended because the
 user's quota of disk blocks on the file system
 containing the directory has been exhausted.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while making or updating a directory entry.
 An I/O error occurred while making or updating a directory entry.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The requested link requires writing in a directory on a read-only file
 system.
 The requested link requires writing in a directory on a read-only file
 system.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Em Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.TP 15
-[EINVAL]
-.I From
+.It Bq Er EINVAL
+.Fa From
 is a parent directory of
 is a parent directory of
-.IR to ,
-or an attempt is made to rename ``.'' or ``..''.
-.TP 15
-[ENOTEMPTY]
-.I To
+.Fa to ,
+or an attempt is made to rename
+.Ql \&.
+or
+.Ql \&.. .
+.It Bq Er ENOTEMPTY
+.Fa To
 is a directory and is not empty.
 is a directory and is not empty.
-.SH "SEE ALSO"
-open(2)
+.El
+.Sh SEE ALSO
+.Xr open 2
+.Sh STANDARDS
+.Fn Rename
+conforms to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index de04a05..0ae757e 100644 (file)
@@ -1,79 +1,80 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)rmdir.2     6.5 (Berkeley) %G%
+.\"     @(#)rmdir.2    6.6 (Berkeley) %G%
 .\"
 .\"
-.TH RMDIR 2 ""
-.UC 5
-.SH NAME
-rmdir \- remove a directory file
-.SH SYNOPSIS
-.nf
-.ft B
-rmdir(path)
-char *path;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Rmdir
+.Dd 
+.Dt RMDIR 2
+.Os BSD 4.2
+.Sh NAME
+.Nm rmdir
+.Nd remove a directory file
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn rmdir "const char *path"
+.Sh DESCRIPTION
+.Fn Rmdir
 removes a directory file
 whose name is given by
 removes a directory file
 whose name is given by
-.I path.
+.Fa path .
 The directory must not have any entries other
 The directory must not have any entries other
-than \*(lq.\*(rq and \*(lq..\*(rq.
-.SH "RETURN VALUE
-A 0 is returned if the remove succeeds; otherwise a \-1 is
-returned and an error code is stored in the global location \fIerrno\fP\|.
-.SH ERRORS
-The named file is removed unless one or more of the
-following are true:
-.TP 15
-[ENOTDIR]
+than
+.Ql \&.
+and
+.Ql \&.. .
+.Sh RETURN VALUES
+A 0 is returned if the remove succeeds; otherwise a -1 is
+returned and an error code is stored in the global location
+.Va errno .
+.Sh ERRORS
+The named file is removed unless:
+.Bl -tag -width [ENAMETOOLONG]
+.It Bq Er ENOTDIR
 A component of the path is not a directory.
 A component of the path is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named directory does not exist.
 The named directory does not exist.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[ENOTEMPTY]
-The named directory contains files other than ``.'' and ``..'' in it.
-.TP 15
-[EACCES]
+.It Bq Er ENOTEMPTY
+The named directory contains files other than
+.Ql \&.
+and
+.Ql \&..
+in it.
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Write permission is denied on the directory containing the link
 to be removed.
 Write permission is denied on the directory containing the link
 to be removed.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The directory containing the directory to be removed is marked sticky,
 and neither the containing directory nor the directory to be removed
 are owned by the effective user ID.
 The directory containing the directory to be removed is marked sticky,
 and neither the containing directory nor the directory to be removed
 are owned by the effective user ID.
-.TP 15
-[EBUSY]
+.It Bq Er EBUSY
 The directory to be removed is the mount point
 for a mounted file system.
 The directory to be removed is the mount point
 for a mounted file system.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while deleting the directory entry
 or deallocating the inode.
 An I/O error occurred while deleting the directory entry
 or deallocating the inode.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The directory entry to be removed resides on a read-only file system.
 The directory entry to be removed resides on a read-only file system.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.SH "SEE ALSO"
-mkdir(2), unlink(2)
+.El
+.Sh SEE ALSO
+.Xr mkdir 2 ,
+.Xr unlink 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index c5ac279..12462a6 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)select.2    6.7 (Berkeley) %G%
+.\"     @(#)select.2   6.8 (Berkeley) %G%
 .\"
 .\"
-.TH SELECT 2 ""
-.UC 5
-.SH NAME
-select \- synchronous I/O multiplexing
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/time.h>
-.PP
-.ft B
-nfound = select(nfds, readfds, writefds, exceptfds, timeout)
-int nfound, nfds;
-fd_set *readfds, *writefds, *exceptfds;
-struct timeval *timeout;
-.PP
-.ft B
-FD_SET(fd, &fdset)     
-FD_CLR(fd, &fdset)     
-FD_ISSET(fd, &fdset)   
-FD_ZERO(&fdset)        
-int fd;
-fd_set fdset;
-.fi
-.SH DESCRIPTION
-.I Select
+.Dd 
+.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>
+.Ft int
+.Fn select "int nfds" "fd_set *readfds" "fd_set *writefds" "fd_set *exceptfds" "struct timeval *timeout"
+.Fn FD_SET fd &fdset
+.Fn FD_CLR fd &fdset
+.Fn FD_ISSET fd &fdset
+.Fn FD_ZERO &fdset
+.Sh DESCRIPTION
+.Fn Select
 examines the I/O descriptor sets whose addresses are passed in
 examines the I/O descriptor sets whose addresses are passed in
-.IR readfds ,
-.IR writefds ,
+.Fa readfds ,
+.Fa writefds ,
 and
 and
-.I exceptfds
+.Fa exceptfds
 to see if some of their descriptors
 are ready for reading, are ready for writing, or have an exceptional
 condition pending, respectively.
 The first
 to see if some of their descriptors
 are ready for reading, are ready for writing, or have an exceptional
 condition pending, respectively.
 The first
-.I nfds
+.Fa nfds
 descriptors are checked in each set;
 descriptors are checked in each set;
-i.e. the descriptors from 0 through
-.IR nfds -1
+i.e., the descriptors from 0 through
+.Fa nfds Ns No -1
 in the descriptor sets are examined.
 On return,
 in the descriptor sets are examined.
 On return,
-.I select
+.Fn select
 replaces the given descriptor sets
 with subsets consisting of those descriptors that are ready
 for the requested operation.
 replaces the given descriptor sets
 with subsets consisting of those descriptors that are ready
 for the requested operation.
-The total number of ready descriptors in all the sets is returned in
-.IR nfound .
-.PP
+.Fn Select
+returns the total number of ready descriptors in all the sets.
+.Pp
 The descriptor sets are stored as bit fields in arrays of integers.
 The following macros are provided for manipulating such descriptor sets:
 The descriptor sets are stored as bit fields in arrays of integers.
 The following macros are provided for manipulating such descriptor sets:
-.I "FD_ZERO(&fdset)"
+.Fn FD_ZERO &fdsetx
 initializes a descriptor set
 initializes a descriptor set
-.I fdset
+.Fa fdset
 to the null set.
 to the null set.
-.I "FD_SET(fd, &fdset)"
+.Fn FD_SET fd &fdset
 includes a particular descriptor
 includes a particular descriptor
-.I fd
+.Fa fd
 in
 in
-.IR fdset .
-.I "FD_CLR(fd, &fdset)"
+.Fa fdset .
+.Fn FD_CLR fd &fdset
 removes
 removes
-.I fd
+.Fa fd
 from
 from
-.IR fdset .
-.I "FD_ISSET(fd, &fdset)"
-is nonzero if
-.I fd
+.Fa fdset .
+.Fn FD_ISSET fd &fdset
+is non-zero if
+.Fa fd
 is a member of
 is a member of
-.IR fdset ,
+.Fa fdset ,
 zero otherwise.
 The behavior of these macros is undefined if
 a descriptor value is less than zero or greater than or equal to
 zero otherwise.
 The behavior of these macros is undefined if
 a descriptor value is less than zero or greater than or equal to
-.IR FD_SETSIZE ,
+.Dv FD_SETSIZE ,
 which is normally at least equal
 to the maximum number of descriptors supported by the system.
 which is normally at least equal
 to the maximum number of descriptors supported by the system.
-.PP
+.Pp
 If
 If
-.I timeout
-is a non-zero pointer, it specifies a maximum interval to wait for the
+.Fa timeout
+is a non-nil pointer, it specifies a maximum interval to wait for the
 selection to complete.  If 
 selection to complete.  If 
-.I timeout
-is a zero pointer, the select blocks indefinitely.  To affect a poll, the
-.I timeout
-argument should be non-zero, pointing to a zero-valued timeval structure.
-.PP
+.Fa timeout
+is a nil pointer, the select blocks indefinitely.  To affect a poll, the
+.Fa timeout
+argument should be non-nil, pointing to a zero-valued timeval structure.
+.Pp
 Any of
 Any of
-.IR readfds ,
-.IR writefds ,
+.Fa readfds ,
+.Fa writefds ,
 and
 and
-.I exceptfds
-may be given as zero pointers if no descriptors are of interest.
-.SH "RETURN VALUE
-.I Select
+.Fa exceptfds
+may be given as nil pointers if no descriptors are of interest.
+.Sh RETURN VALUES
+.Fn Select
 returns the number of ready descriptors that are contained in
 the descriptor sets,
 returns the number of ready descriptors that are contained in
 the descriptor sets,
-or \-1 if an error occurred.
-If the time limit expires then
-.I select
+or -1 if an error occurred.
+If the time limit expires,
+.Fn select
 returns 0.
 If
 returns 0.
 If
-.I select
+.Fn select
 returns with an error,
 including one due to an interrupted call,
 the descriptor sets will be unmodified.
 returns with an error,
 including one due to an interrupted call,
 the descriptor sets will be unmodified.
-.SH "ERRORS
-An error return from \fIselect\fP indicates:
-.TP 15
-[EBADF]
+.Sh ERRORS
+An error return from
+.Fn select
+indicates:
+.Bl -tag -width Er
+.It Bq Er EBADF
 One of the descriptor sets specified an invalid descriptor.
 One of the descriptor sets specified an invalid descriptor.
-.TP 15
-[EINTR]
+.It Bq Er EINTR
 A signal was delivered before the time limit expired and
 before any of the selected events occurred.
 A signal was delivered before the time limit expired and
 before any of the selected events occurred.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The specified time limit is invalid.  One of its components is
 negative or too large.
 The specified time limit is invalid.  One of its components is
 negative or too large.
-.SH SEE ALSO
-accept(2), connect(2), read(2), write(2), recv(2), send(2), getdtablesize(2)
-.SH BUGS
+.El
+.Sh SEE ALSO
+.Xr accept 2 ,
+.Xr connect 2 ,
+.Xr read 2 ,
+.Xr write 2 ,
+.Xr recv 2 ,
+.Xr send 2 ,
+.Xr getdtablesize 2
+.Sh BUGS
 Although the provision of
 Although the provision of
-.IR getdtablesize (2)
+.Xr getdtablesize 2
 was intended to allow user programs to be written independent
 of the kernel limit on the number of open files, the dimension
 of a sufficiently large bit field for select remains a problem.
 was intended to allow user programs to be written independent
 of the kernel limit on the number of open files, the dimension
 of a sufficiently large bit field for select remains a problem.
-The default size FD_SETSIZE (currently 256) is somewhat larger than
+The default size
+.Dv FD_SETSIZE
+(currently 256) is somewhat larger than
 the current kernel limit to the number of open files.
 However, in order to accommodate programs which might potentially
 use a larger number of open files with select, it is possible
 to increase this size within a program by providing
 the current kernel limit to the number of open files.
 However, in order to accommodate programs which might potentially
 use a larger number of open files with select, it is possible
 to increase this size within a program by providing
-a larger definition of FD_SETSIZE before the inclusion of <sys/types.h>.
-.PP
-.I Select
+a larger definition of
+.Dv FD_SETSIZE
+before the inclusion of
+.Aq Pa sys/types.h .
+.Pp
+.Fn Select
 should probably return the time remaining from the original timeout,
 if any, by modifying the time value in place.
 This may be implemented in future versions of the system.
 Thus, it is unwise to assume that the timeout value will be unmodified
 by the
 should probably return the time remaining from the original timeout,
 if any, by modifying the time value in place.
 This may be implemented in future versions of the system.
 Thus, it is unwise to assume that the timeout value will be unmodified
 by the
-.I select
+.Fn select
 call.
 call.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index bdf0043..8300b46 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)send.2      6.6 (Berkeley) %G%
+.\"     @(#)send.2     6.7 (Berkeley) %G%
 .\"
 .\"
-.TH SEND 2 ""
-.UC 5
-.SH NAME
-send, sendto, sendmsg \- send a message from a socket
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/socket.h>
-.PP
-.ft B
-cc = send(s, msg, len, flags)
-int cc, s;
-char *msg;
-int len, flags;
-.PP
-.ft B
-cc = sendto(s, msg, len, flags, to, tolen)
-int cc, s;
-char *msg;
-int len, flags;
-struct sockaddr *to;
-int tolen;
-.PP
-.ft B
-cc = sendmsg(s, msg, flags)
-int cc, s;
-struct msghdr *msg;
-int flags;
-.fi
-.SH DESCRIPTION
-.IR Send ,
-.IR sendto ,
+.Dd 
+.Dt SEND 2
+.Os BSD 4.2
+.Sh NAME
+.Nm send ,
+.Nm sendto ,
+.Nm sendmsg
+.Nd send a message from a socket
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/socket.h>
+.Ft int
+.Fn send "int s" "const char *msg" "int len" "int flags"
+.Ft int
+.Fn sendto "int s" "const char *msg" "int len" "int flags" "const struct sockaddr *to" "int tolen"
+.Ft int
+.Fn sendmsg "int s" "const struct msghdr *msg" "int flags"
+.Sh DESCRIPTION
+.Fn Send ,
+.Fn sendto ,
 and
 and
-.I sendmsg
+.Fn sendmsg
 are used to transmit a message to another socket.
 are used to transmit a message to another socket.
-.I Send
+.Fn Send
 may be used only when the socket is in a 
 may be used only when the socket is in a 
-.I connected
+.Em connected
 state, while 
 state, while 
-.I sendto
+.Fn sendto
 and
 and
-.I sendmsg
+.Fn sendmsg
 may be used at any time.
 may be used at any time.
-.PP
+.Pp
 The address of the target is given by
 The address of the target is given by
-.I to
+.Fa to
 with 
 with 
-.I tolen
+.Fa tolen
 specifying its size.
 The length of the message is given by
 specifying its size.
 The length of the message is given by
-.IR len .
+.Fa len .
 If the message is too long to pass atomically through the
 If the message is too long to pass atomically through the
-underlying protocol, then the error EMSGSIZE is returned, and
+underlying protocol, the error
+.Er EMSGSIZE
+is returned, and
 the message is not transmitted.
 the message is not transmitted.
-.PP
+.Pp
 No indication of failure to deliver is implicit in a
 No indication of failure to deliver is implicit in a
-.IR send .
-Return values of \-1 indicate some locally detected errors.
-.PP
+.Fn send .
+Locally detected errors are indicated by a return value of -1.
+.Pp
 If no messages space is available at the socket to hold
 the message to be transmitted, then
 If no messages space is available at the socket to hold
 the message to be transmitted, then
-.I send
+.Fn send
 normally blocks, unless the socket has been placed in
 non-blocking I/O mode.
 The
 normally blocks, unless the socket has been placed in
 non-blocking I/O mode.
 The
-.IR select (2)
+.Xr select 2
 call may be used to determine when it is possible to
 send more data.
 call may be used to determine when it is possible to
 send more data.
-.PP
+.Pp
 The
 The
-.I flags
+.Fa flags
 parameter may include one or more of the following:
 parameter may include one or more of the following:
-.PP
-.nf
-.RS
-.ta \w'#define\ \ 'u +\w'MSG_DONTROUTE\ \ \ 'u +\w'0x\0\0\0\ \ 'u
-#define        MSG_OOB 0x1     /* process out-of-band data */
+.Pp
+.Bd -literal
+#define        MSG_OOB         0x1     /* process out-of-band data */
 #define        MSG_DONTROUTE   0x4     /* bypass routing, use direct interface */
 #define        MSG_DONTROUTE   0x4     /* bypass routing, use direct interface */
-.RE
-.fi
-The flag MSG_OOB is used to send \*(lqout-of-band\*(rq
-data on sockets that support this notion (e.g. SOCK_STREAM);
-the underlying protocol must also support \*(lqout-of-band\*(rq data.
-MSG_DONTROUTE is usually used only by diagnostic or routing programs.
-.PP
+.Ed
+.Pp
+The flag
+.Dv MSG_OOB
+is used to send
+.Dq out-of-band
+data on sockets that support this notion (e.g.
+.Dv SOCK_STREAM ) ;
+the underlying protocol must also support
+.Dq out-of-band
+data.
+.Dv MSG_DONTROUTE
+is usually used only by diagnostic or routing programs.
+.Pp
 See 
 See 
-.IR recv (2)
+.Xr recv 2
 for a description of the
 for a description of the
-.I msghdr
+.Fa msghdr
 structure.
 structure.
-.SH "RETURN VALUE
-The call returns the number of characters sent, or \-1
+.Sh RETURN VALUES
+The call returns the number of characters sent, or -1
 if an error occurred.
 if an error occurred.
-.SH "ERRORS
-.TP 20
-[EBADF]
+.Sh ERRORS
+.Fn Send ,
+.Fn sendto ,
+and
+.Fn sendmsg
+fail if:
+.Bl -tag -width [EWOULDBLOCK]
+.It Bq Er EBADF
 An invalid descriptor was specified.
 An invalid descriptor was specified.
-.TP 20
-[ENOTSOCK]
-The argument \fIs\fP is not a socket.
-.TP 20
-[EFAULT]
+.It Bq Er ENOTSOCK
+The argument
+.Fa s
+is not a socket.
+.It Bq Er EFAULT
 An invalid user space address was specified for a parameter.
 An invalid user space address was specified for a parameter.
-.TP 20
-[EMSGSIZE]
+.It Bq Er EMSGSIZE
 The socket requires that message be sent atomically,
 and the size of the message to be sent made this impossible.
 The socket requires that message be sent atomically,
 and the size of the message to be sent made this impossible.
-.TP 20
-[EWOULDBLOCK]
+.It Bq Er EWOULDBLOCK
 The socket is marked non-blocking and the requested operation
 would block.
 The socket is marked non-blocking and the requested operation
 would block.
-.TP 20
-[ENOBUFS]
+.It Bq Er ENOBUFS
 The system was unable to allocate an internal buffer.
 The operation may succeed when buffers become available.
 The system was unable to allocate an internal buffer.
 The operation may succeed when buffers become available.
-.TP 20
-[ENOBUFS]
+.It Bq Er ENOBUFS
 The output queue for a network interface was full.
 This generally indicates that the interface has stopped sending,
 but may be caused by transient congestion.
 The output queue for a network interface was full.
 This generally indicates that the interface has stopped sending,
 but may be caused by transient congestion.
-.SH SEE ALSO
-fcntl(2), recv(2), select(2), getsockopt(2), socket(2), write(2)
+.El
+.Sh SEE ALSO
+.Xr fcntl 2 ,
+.Xr recv 2 ,
+.Xr select 2 ,
+.Xr getsockopt 2 ,
+.Xr socket 2 ,
+.Xr write 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 666a356..2211d64 100644 (file)
@@ -1,52 +1,63 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)setgroups.2 6.6 (Berkeley) %G%
+.\"     @(#)setgroups.2        6.7 (Berkeley) %G%
 .\"
 .\"
-.TH SETGROUPS 2 ""
-.UC 5
-.SH NAME
-setgroups \- set group access list
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/param.h>
-.PP
-.ft B
-setgroups(ngroups, gidset)
-int ngroups, *gidset;
-.fi
-.SH DESCRIPTION
-.I Setgroups
+.Dd 
+.Dt SETGROUPS 2
+.Os BSD 4.2
+.Sh NAME
+.Nm setgroups
+.Nd set group access list
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Fd #include <sys/param.h>
+.Ft int
+.Fn setgroups "int ngroups" "const int *gidset"
+.Sh DESCRIPTION
+.Fn Setgroups
 sets the group access list of the current user process
 according to the array 
 sets the group access list of the current user process
 according to the array 
-.IR gidset .
+.Fa gidset .
 The parameter
 The parameter
-.I ngroups
+.Fa ngroups
 indicates the number of entries in the array and must be no
 indicates the number of entries in the array and must be no
-more than NGROUPS, as defined in
-.RI < sys/param.h >.
-.PP
+more than
+.Dv NGROUPS ,
+as defined in
+.Ao Pa sys/param.h Ac .
+.Pp
 Only the super-user may set new groups.
 Only the super-user may set new groups.
-.SH "RETURN VALUE
-A 0 value is returned on success, \-1 on error, with
-a error code stored in \fIerrno\fP.
-.SH "ERRORS
-The \fIsetgroups\fP call will fail if:
-.TP 15
-[EPERM]
+.Sh RETURN VALUES
+A 0 value is returned on success, -1 on error, with
+an error code stored in
+.Va errno .
+.Sh ERRORS
+The
+.Fn setgroups
+call will fail if:
+.Bl -tag -width Er
+.It Bq Er EPERM
 The caller is not the super-user.
 The caller is not the super-user.
-.TP 15
-[EFAULT]
-The address specified for \fIgidset\fP is outside the process
+.It Bq Er EFAULT
+The address specified for
+.Fa gidset
+is outside the process
 address space.
 address space.
-.SH "SEE ALSO
-getgroups(2), initgroups(3)
-.SH BUGS
+.El
+.Sh SEE ALSO
+.Xr getgroups 2 ,
+.Xr initgroups 3
+.Sh BUGS
 The
 The
-.I gidset
+.Fa gidset
 array should be of type
 array should be of type
-.BR gid_t ,
+.Em gid_t ,
 but remains integer for compatibility with earlier systems.
 but remains integer for compatibility with earlier systems.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 4b1d682..46c3d5a 100644 (file)
@@ -1,58 +1,63 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)setpgid.2   6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH SETPGRP 2 ""
-.UC 4
-.SH NAME
-setpgid, setpgrp \- set process group
-.SH SYNOPSIS
-.ft B
-setpgid(pid_t pid, pid_t pgrp);
-.br
-setpgrp(pid_t pid, pid_t pgrp);
-.ft R
-.SH DESCRIPTION
-.I Setpgid
+.\"     @(#)setpgid.2  6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt SETPGID 2
+.Os BSD 4
+.Sh NAME
+.Nm setpgid ,
+.Nm setpgrp
+.Nd set process group
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn setpgid pid_tpid pid_tpgrp
+.Ft int
+.Fn setpgrp pid_tpid pid_tpgrp
+.Sh DESCRIPTION
+.Fn Setpgid
 sets the process group of the specified process
 sets the process group of the specified process
-.I pid
+.Ar pid
 to the specified
 to the specified
-.IR pgrp .
+.Ar pgrp .
 If
 If
-.I pid
+.Ar pid
 is zero, then the call applies to the current process.
 is zero, then the call applies to the current process.
-.PP
+.Pp
 If the invoker is not the super-user, then the affected process
 must have the same effective user-id as the invoker or be a descendant
 of the invoking process.
 If the invoker is not the super-user, then the affected process
 must have the same effective user-id as the invoker or be a descendant
 of the invoking process.
-.SH "RETURN VALUE
-.I Setpgid
+.Sh RETURN VALUES
+.Fn Setpgid
 returns 0 when the operation was successful.
 returns 0 when the operation was successful.
-If the request failed, \-1 is returned and the global variable
-.I errno
+If the request failed, -1 is returned and the global variable
+.Va errno
 indicates the reason.
 indicates the reason.
-.SH ERRORS
-.I Setpgid
-will fail and the process group will not be altered if
-one of the following occur:
-.TP 15
-[ESRCH]
+.Sh ERRORS
+.Fn Setpgid
+will fail and the process group will not be altered if:
+.Bl -tag -width indent
+.It Bq Er ESRCH
 The requested process does not exist.
 The requested process does not exist.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The effective user ID of the requested process is different
 from that of the caller and the process is not a descendent
 of the calling process.
 The effective user ID of the requested process is different
 from that of the caller and the process is not a descendent
 of the calling process.
-.SH "SEE ALSO"
-getpgrp(2)
-.SH STANDARDS
-.I Setpgid
-conforms to IEEE Std 1003.1-1988 (``POSIX'').
-.SH COMPATIBILITY
-.I Setpgrp
+.El
+.Sh SEE ALSO
+.Xr getpgrp 2
+.Sh STANDARDS
+.Fn Setpgid
+conforms to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
+.Sh COMPATIBILITY
+.Fn Setpgrp
 is identical to
 is identical to
-.IR setpgid ,
+.Fn setpgid ,
 and is retained for calling convention compatibility with historical
 and is retained for calling convention compatibility with historical
-versions of BSD.
+versions of
+.Bx .
index e52c83d..7c821ec 100644 (file)
@@ -1,44 +1,55 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)shutdown.2  6.3 (Berkeley) %G%
+.\"     @(#)shutdown.2 6.4 (Berkeley) %G%
 .\"
 .\"
-.TH SHUTDOWN 2 ""
-.UC 5
-.SH NAME
-shutdown \- shut down part of a full-duplex connection
-.SH SYNOPSIS
-.nf
-.ft B
-shutdown(s, how)
-int s, how;
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt SHUTDOWN 2
+.Os BSD 4.2
+.Sh NAME
+.Nm shutdown
+.Nd shut down part of a full-duplex connection
+.Sh SYNOPSIS
+.Fd #include <sys/socket.h>
+.Ft int
+.Fn shutdown "int s" "int how"
+.Sh DESCRIPTION
 The
 The
-.I shutdown
+.Fn shutdown
 call causes all or part of a full-duplex connection on
 the socket associated with
 call causes all or part of a full-duplex connection on
 the socket associated with
-.I s
+.Fa s
 to be shut down.
 to be shut down.
-If \fIhow\fP is 0, then further receives will be disallowed.
-If \fIhow\fP is 1, then further sends will be disallowed.
-If \fIhow\fP is 2, then further sends and receives will be disallowed.
-.SH DIAGNOSTICS
-A 0 is returned if the call succeeds, \-1 if it fails.
-.SH ERRORS
+If
+.Fa how
+is 0, further receives will be disallowed.
+If
+.Fa how
+is 1, further sends will be disallowed.
+If
+.Fa how
+is 2, further sends and receives will be disallowed.
+.Sh DIAGNOSTICS
+A 0 is returned if the call succeeds, -1 if it fails.
+.Sh ERRORS
 The call succeeds unless:
 The call succeeds unless:
-.TP 15
-[EBADF]
-.I S
+.Bl -tag -width ENOTCONNAA
+.It Bq Er EBADF
+.Fa S
 is not a valid descriptor.
 is not a valid descriptor.
-.TP 15
-[ENOTSOCK]
-.I S
+.It Bq Er ENOTSOCK
+.Fa S
 is a file, not a socket.
 is a file, not a socket.
-.TP 15
-[ENOTCONN]
+.It Bq Er ENOTCONN
 The specified socket is not connected.
 The specified socket is not connected.
-.SH "SEE ALSO"
-connect(2), socket(2)
+.El
+.Sh SEE ALSO
+.Xr connect 2 ,
+.Xr socket 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 3751ffb..3b2196b 100644 (file)
@@ -1,76 +1,94 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)sigprocmask.2       6.2 (Berkeley) %G%
+.\"     @(#)sigprocmask.2      6.3 (Berkeley) %G%
 .\"
 .\"
-.TH SIGPROCMASK 2 ""
-.UC 7
-.SH NAME
-sigprocmask \- manipulate current signal mask
-.SH SYNOPSIS
-.nf
-.B #include <signal.h>
-
-.B sigprocmask(how, set, oset);
-.B int how;
-.B sigset_t *set, *oset;
-
-.B mask = sigmask(signum)
-.SH DESCRIPTION
+.Dd 
+.Dt SIGPROCMASK 2
+.Os BSD 4.4
+.Sh NAME
+.Nm sigprocmask
+.Nd manipulate current signal mask
+.Sh SYNOPSIS
+.Fd #include <signal.h>
+.Ft int
+.Fn sigprocmask "int how" "const sigset_t *set" "sigset_t *oset"
+.Fn sigmask signum
+.Sh DESCRIPTION
 The
 The
-.I sigprocmask
-function examines and/or the current signal mask (those signals
+.Fn sigprocmask
+function examines and/or changes the current signal mask (those signals
 that are blocked from delivery).
 Signals are blocked if they are members of the current signal mask set.
 that are blocked from delivery).
 Signals are blocked if they are members of the current signal mask set.
-.PP
+.Pp
 If
 If
-.I set
+.Fa set
 is not null, the action of
 is not null, the action of
-.I sigprocmask
+.Fn sigprocmask
 depends on the value of the parameter
 depends on the value of the parameter
-.IR how .
+.Fa how .
 The signal mask is changed as a function of the specified
 The signal mask is changed as a function of the specified
-.I set
+.Fa set
 and the current mask.
 The function is specified by
 and the current mask.
 The function is specified by
-.I how
-using one of the following values from <signal.h>:
-.IP SIG_BLOCK \w'SIG_SETMASK\0\0'u
+.Fa how
+using one of the following values from
+.Aq Pa signal.h :
+.Bl -tag -width SIG_UNBLOCK
+.It Dv SIG_BLOCK
 The new mask is the union of the current mask and the specified
 The new mask is the union of the current mask and the specified
-.IR set .
-.IP SIG_UNBLOCK \w'SIG_SETMASK\0\0'u
+.Fa set .
+.It Dv SIG_UNBLOCK
 The new mask is the intersection of the current mask
 and the complement of the specified
 The new mask is the intersection of the current mask
 and the complement of the specified
-.IR set .
-.IP SIG_SETMASK \w'SIG_SETMASK\0\0'u
+.Fa set .
+.It Dv SIG_SETMASK
 The current mask is replaced by the specified
 The current mask is replaced by the specified
-.IR set .
-.PP
+.Fa set .
+.El
+.Pp
 If
 If
-.I oset
-is not null,
+.Fa oset
+is not null, it is set to
 the previous value of the signal mask.
 When
 the previous value of the signal mask.
 When
-.I set
-is null, this provides a way to examine the signal mask without changing it.
-.PP
+.Fa set
+is null,
+the value of
+.Ar how
+is insignificant and the mask remains unset
+providing a way to examine the signal mask without modification.
+.Pp
 The system
 The system
-quietly disallows SIGKILL or SIGSTOP to be blocked.
-.SH "RETURN VALUE
-A 0 value indicated that the call succeeded.  A \-1 return value
+quietly disallows
+.Dv SIGKILL
+or
+.Dv SIGSTOP
+to be blocked.
+.Sh RETURN VALUES
+A 0 value indicated that the call succeeded.  A -1 return value
 indicates an error occurred and
 indicates an error occurred and
-.I errno
+.Va errno
 is set to indicated the reason.
 is set to indicated the reason.
-.SH ERRORS
+.Sh ERRORS
 The
 The
-.I sigprocmask
+.Fn sigprocmask
 call will fail and the signal mask will be unchanged if one
 of the following occurs:
 call will fail and the signal mask will be unchanged if one
 of the following occurs:
-.TP 15
-[EINVAL]
-.I how
+.Bl -tag -width Bq Er EINVAL
+.It Bq Er EINVAL
+.Fa how
 has a value other than those listed here.
 has a value other than those listed here.
-.SH "SEE ALSO"
-kill(2), sigaction(2), sigsetops(2), sigsuspend(2)
+.Sh SEE ALSO
+.Xr kill 2 ,
+.Xr sigaction 2 ,
+.Xr sigsetops 3 ,
+.Xr sigsuspend 2
+.Sh STANDARDS
+The
+.Fn sigprocmask
+function call is expected to
+conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index 7fe3e1e..09219b5 100644 (file)
@@ -1,32 +1,33 @@
-.\" Copyright (c) 1985 The Regents of the University of California.
+.\" Copyright (c) 1985, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)sigreturn.2 6.4 (Berkeley) %G%
+.\"     @(#)sigreturn.2        6.5 (Berkeley) %G%
 .\"
 .\"
-.TH SIGRETURN 2 ""
-.UC 6
-.SH NAME
-sigreturn \- return from signal
-.SH SYNOPSIS
-.nf
-.B #include <signal.h>
-.PP
-.B struct      sigcontext {
-.B     int     sc_onstack;
-.B     int     sc_mask;
-.B     int     sc_sp;
-.B     int     sc_fp;
-.B     int     sc_ap;
-.B     int     sc_pc;
-.B     int     sc_ps;
-.B };
-.PP
-.B sigreturn(scp);
-.B struct sigcontext *scp;
-.SH DESCRIPTION
-.I Sigreturn
+.Dd 
+.Dt SIGRETURN 2
+.Os BSD 4.3
+.Sh NAME
+.Nm sigreturn
+.Nd return from signal
+.Sh SYNOPSIS
+.Fd #include <sys/signal.h>
+.Bd -literal
+struct sigcontext {
+       int sc_onstack;
+       int sc_mask;
+       int sc_sp;
+       int sc_fp;
+       int sc_ap;
+       int sc_pc;
+       int sc_ps;
+};
+.Ed
+.Ft int
+.Fn sigreturn "struct sigcontext *scp"
+.Sh DESCRIPTION
+.Fn Sigreturn
 allows users to atomically unmask, switch stacks,
 and return from a signal context.
 The processes signal mask and stack status are
 allows users to atomically unmask, switch stacks,
 and return from a signal context.
 The processes signal mask and stack status are
@@ -35,29 +36,36 @@ The system call does not return;
 the users stack pointer, frame pointer, argument pointer,
 and processor status longword are restored from the context.
 Execution resumes at the specified pc.
 the users stack pointer, frame pointer, argument pointer,
 and processor status longword are restored from the context.
 Execution resumes at the specified pc.
-This system call is used by the trampoline code, and
-.IR longjmp (3)
+This system call is used by the trampoline code and
+.Xr longjmp 3
 when returning from a signal to the previously executing program.
 when returning from a signal to the previously executing program.
-.SH NOTES
-This system call is not available in 4.2BSD,
+.Sh NOTES
+This system call is not available in 4.2
+.Tn BSD
 hence it should not be used if backward compatibility is needed.
 hence it should not be used if backward compatibility is needed.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 If successful, the system call does not return.
 If successful, the system call does not return.
-Otherwise, a value of \-1 is returned and 
-.I errno
+Otherwise, a value of -1 is returned and 
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Sigreturn
+.Sh ERRORS
+.Fn Sigreturn
 will fail and the process context will remain unchanged
 if one of the following occurs.
 will fail and the process context will remain unchanged
 if one of the following occurs.
-.TP 15
-[EFAULT]
-.I Scp
+.Bl -tag -width [EINVAL]
+.It Bq Er EFAULT
+.Fa Scp
 points to memory that is not a valid part of the process
 address space.
 points to memory that is not a valid part of the process
 address space.
-.TP
-[EINVAL]
+.It Bq Er EINVAL
 The process status longword is invalid or would improperly
 raise the privilege level of the process.
 The process status longword is invalid or would improperly
 raise the privilege level of the process.
-.SH "SEE ALSO"
-sigvec(2), setjmp(3)
+.El
+.Sh SEE ALSO
+.Xr sigvec 2 ,
+.Xr setjmp 3
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.3 .
index 41ec79f..6a2fa8f 100644 (file)
@@ -1,66 +1,74 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)sigstack.2  6.4 (Berkeley) %G%
+.\"     @(#)sigstack.2 6.5 (Berkeley) %G%
 .\"
 .\"
-.TH SIGSTACK 2 ""
-.UC 5
-.SH NAME
-sigstack \- set and/or get signal stack context
-.SH SYNOPSIS
-.nf
-.B #include <signal.h>
-.PP
-.B struct sigstack {
-.B     caddr_t ss_sp;
-.B     int     ss_onstack;
-.B };
-.PP
-.B sigstack(ss, oss);
-.B struct sigstack *ss, *oss;
-.SH DESCRIPTION
-.I Sigstack
+.Dd 
+.Dt SIGSTACK 2
+.Os BSD 4.2
+.Sh NAME
+.Nm sigstack
+.Nd set and/or get signal stack context
+.Sh SYNOPSIS
+.Fd #include <sys/signal.h>
+.Bd -literal
+struct sigstack {
+       caddr_t ss_sp;
+       int     ss_onstack;
+};
+.Ed
+.Ft int
+.Fn sigstack "const struct sigstack *ss" "struct sigstack *oss"
+.Sh DESCRIPTION
+.Fn Sigstack
 allows users to define an alternate stack on which signals
 are to be processed.  If
 allows users to define an alternate stack on which signals
 are to be processed.  If
-.I ss
+.Fa ss
 is non-zero,
 it specifies a
 is non-zero,
 it specifies a
-.I "signal stack"
+.Em "signal stack"
 on which to deliver signals
 and tells the system if the process is currently executing
 on that stack.  When a signal's action indicates its handler
 should execute on the signal stack (specified with a
 on which to deliver signals
 and tells the system if the process is currently executing
 on that stack.  When a signal's action indicates its handler
 should execute on the signal stack (specified with a
-.IR sigvec (2)
+.Xr sigvec 2
 call), the system checks to see
 if the process is currently executing on that stack.  If the
 process is not currently executing on the signal stack,
 the system arranges a switch to the signal stack for the
 duration of the signal handler's execution. 
 If
 call), the system checks to see
 if the process is currently executing on that stack.  If the
 process is not currently executing on the signal stack,
 the system arranges a switch to the signal stack for the
 duration of the signal handler's execution. 
 If
-.I oss
+.Fa oss
 is non-zero, the current signal stack state is returned.
 is non-zero, the current signal stack state is returned.
-.SH NOTES
+.Sh NOTES
 Signal stacks are not ``grown'' automatically, as is
 done for the normal stack.  If the stack overflows
 unpredictable results may occur.
 Signal stacks are not ``grown'' automatically, as is
 done for the normal stack.  If the stack overflows
 unpredictable results may occur.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Upon successful completion, a value of 0 is returned.
-Otherwise, a value of \-1 is returned and 
-.I errno
+Otherwise, a value of -1 is returned and 
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Sigstack
+.Sh ERRORS
+.Fn Sigstack
 will fail and the signal stack context will remain unchanged
 if one of the following occurs.
 will fail and the signal stack context will remain unchanged
 if one of the following occurs.
-.TP 15
-[EFAULT]
+.Bl -tag -width [EFAULT]
+.It Bq Er EFAULT
 Either
 Either
-.I ss
+.Fa ss
 or
 or
-.I oss
+.Fa oss
 points to memory that is not a valid part of the process
 address space.
 points to memory that is not a valid part of the process
 address space.
-.SH "SEE ALSO"
-sigvec(2), setjmp(3)
+.El
+.Sh SEE ALSO
+.Xr sigvec 2 ,
+.Xr setjmp 3
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 33ab61a..50974ba 100644 (file)
@@ -1,45 +1,54 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)sigsuspend.2        6.1 (Berkeley) %G%
+.\"     @(#)sigsuspend.2       6.2 (Berkeley) %G%
 .\"
 .\"
-.TH SIGSUSPEND 2 ""
-.UC 7
-.SH NAME
-sigsuspend \- atomically release blocked signals and wait for interrupt
-.SH SYNOPSIS
-.B #include <signal.h>
-.ft B
-sigsuspend(sigmask)
-.br
-sigset_t *sigmask;
-.ft R
-.SH DESCRIPTION
-.I Sigsuspend
+.Dd 
+.Dt SIGSUSPEND 2
+.Os BSD 4.4
+.Sh NAME
+.Nm sigsuspend
+.Nd atomically release blocked signals and wait for interrupt
+.Sh SYNOPSIS
+.Fd #include <sys/signal.h>
+.Ft int
+.Fn sigsuspend "const sigset_t *sigmask"
+.Sh DESCRIPTION
+.Fn Sigsuspend
 temporarily changes the blocked signal mask to the set to which
 temporarily changes the blocked signal mask to the set to which
-.I sigmask
+.Fa sigmask
 points,
 and then waits for a signal to arrive;
 on return the previous set of masked signals is restored.
 The signal mask set
 is usually empty to indicate that all
 signals are to be unblocked for the duration of the call.
 points,
 and then waits for a signal to arrive;
 on return the previous set of masked signals is restored.
 The signal mask set
 is usually empty to indicate that all
 signals are to be unblocked for the duration of the call.
-The
-.I sigsuspend
-function
-always terminates by being interrupted, returning \-1 with
-.I errno
-set to EINTR.
-.PP
+.Pp
 In normal usage, a signal is blocked using
 In normal usage, a signal is blocked using
-.IR sigprocmask (2),
+.Xr sigprocmask 2
 to begin a critical section, variables modified on the occurrence
 of the signal are examined to determine that there is no work
 to be done, and the process pauses awaiting work by using
 to begin a critical section, variables modified on the occurrence
 of the signal are examined to determine that there is no work
 to be done, and the process pauses awaiting work by using
-.I sigsuspend
+.Fn sigsuspend
 with the previous mask returned by
 with the previous mask returned by
-.IR sigprocmask .
-.SH SEE ALSO
-sigprocmask(2), sigaction(2), sigsetops(3)
+.Xr sigprocmask .
+.Sh RETURN VALUES
+The
+.Fn sigsuspend
+function
+always terminates by being interrupted, returning -1 with
+.Va errno
+set to
+.Dv EINTR .
+.Sh SEE ALSO
+.Xr sigprocmask 2 ,
+.Xr sigaction 2 ,
+.Xr sigsetops 3
+.Sh STANDARDS
+The
+.Fn sigsupend
+function call
+conforms to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index a6c73bf..b9afe46 100644 (file)
@@ -1,84 +1,85 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)socket.2    6.7 (Berkeley) %G%
+.\"     @(#)socket.2   6.8 (Berkeley) %G%
 .\"
 .\"
-.TH SOCKET 2 ""
-.UC 5
-.SH NAME
-socket \- create an endpoint for communication
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/socket.h>
-.PP
-.ft B
-s = socket(domain, type, protocol)
-int s, domain, type, protocol;
-.fi
-.SH DESCRIPTION
-.I Socket
+.Dd 
+.Dt SOCKET 2
+.Os BSD 4.2
+.Sh NAME
+.Nm socket
+.Nd create an endpoint for communication
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/socket.h>
+.Ft int
+.Fn socket "int domain" "int type" "int protocol"
+.Sh DESCRIPTION
+.Fn Socket
 creates an endpoint for communication and returns a descriptor.
 creates an endpoint for communication and returns a descriptor.
-.PP
+.Pp
 The
 The
-.I domain
+.Fa domain
 parameter specifies a communications domain within which
 communication will take place; this selects the protocol family
 which should be used.
 parameter specifies a communications domain within which
 communication will take place; this selects the protocol family
 which should be used.
-The protocol family generally is the same as the address family
-for the addresses supplied in later operations on the socket.
 These families are defined in the include file
 These families are defined in the include file
-.IR <sys/socket.h> .
+.Ao Pa sys/socket.h Ac .
 The currently understood formats are
 The currently understood formats are
-.PP
-.RS
-.nf
-.ta 1.25i 1.75i
-PF_UNIX        (UNIX internal protocols),
-PF_INET        (ARPA Internet protocols),
-PF_NS  (Xerox Network Systems protocols), and
-PF_IMPLINK     (IMP \*(lqhost at IMP\*(rq link layer).
-.fi
-.RE
-.PP
+.Pp
+.Bd -literal -offset indent -compact
+AF_UNIX                (UNIX internal protocols),
+AF_INET                (ARPA Internet protocols),
+AF_ISO         (ISO protocols),
+AF_NS          (Xerox Network Systems protocols), and
+AF_IMPLINK     (IMP \*(lqhost at IMP\*(rq link layer).
+.Ed
+.Pp
 The socket has the indicated
 The socket has the indicated
-.I type,
+.Fa type ,
 which specifies the semantics of communication.  Currently
 defined types are:
 which specifies the semantics of communication.  Currently
 defined types are:
-.PP
-.RS
-.nf
+.Pp
+.Bd -literal -offset indent -compact
 SOCK_STREAM
 SOCK_DGRAM
 SOCK_RAW
 SOCK_SEQPACKET
 SOCK_RDM
 SOCK_STREAM
 SOCK_DGRAM
 SOCK_RAW
 SOCK_SEQPACKET
 SOCK_RDM
-.fi
-.RE
-.PP
-A SOCK_STREAM type provides sequenced, reliable,
+.Ed
+.Pp
+A
+.Dv SOCK_STREAM
+type provides sequenced, reliable,
 two-way connection based byte streams.
 An out-of-band data transmission mechanism may be supported.
 two-way connection based byte streams.
 An out-of-band data transmission mechanism may be supported.
-A SOCK_DGRAM socket supports
+A
+.Dv SOCK_DGRAM
+socket supports
 datagrams (connectionless, unreliable messages of
 a fixed (typically small) maximum length).
 datagrams (connectionless, unreliable messages of
 a fixed (typically small) maximum length).
-A SOCK_SEQPACKET socket may provide a sequenced, reliable,
+A
+.Dv SOCK_SEQPACKET
+socket may provide a sequenced, reliable,
 two-way connection-based data transmission path for datagrams
 of fixed maximum length; a consumer may be required to read
 an entire packet with each read system call.
 This facility is protocol specific, and presently implemented
 two-way connection-based data transmission path for datagrams
 of fixed maximum length; a consumer may be required to read
 an entire packet with each read system call.
 This facility is protocol specific, and presently implemented
-only for PF_NS.
-SOCK_RAW sockets provide access to internal network protocols and interfaces.
-The types SOCK_RAW,
+only for
+.Dv PF_NS .
+.Dv SOCK_RAW
+sockets provide access to internal network protocols and interfaces.
+The types
+.Dv SOCK_RAW ,
 which is available only to the super-user, and
 which is available only to the super-user, and
-SOCK_RDM, which is planned,
+.Dv SOCK_RDM ,
+which is planned,
 but not yet implemented, are not described here.
 but not yet implemented, are not described here.
-.PP
+.Pp
 The
 The
-.I protocol
+.Fa protocol
 specifies a particular protocol to be used with the socket.
 Normally only a single protocol exists to support a particular
 socket type within a given protocol family.  However, it is possible
 specifies a particular protocol to be used with the socket.
 Normally only a single protocol exists to support a particular
 socket type within a given protocol family.  However, it is possible
@@ -86,110 +87,145 @@ that many protocols may exist, in which case a particular protocol
 must be specified in this manner.  The protocol number to use is
 particular to the \*(lqcommunication domain\*(rq in which communication
 is to take place; see
 must be specified in this manner.  The protocol number to use is
 particular to the \*(lqcommunication domain\*(rq in which communication
 is to take place; see
-.IR protocols (3N).
-.PP
-Sockets of type SOCK_STREAM
+.Xr protocols 5 .
+.Pp
+Sockets of type
+.Dv SOCK_STREAM
 are full-duplex byte streams, similar
 to pipes.  A stream socket must be in a
 are full-duplex byte streams, similar
 to pipes.  A stream socket must be in a
-.I connected
+.Em connected
 state before any data may be sent or received
 on it.  A connection to another socket is created with a
 state before any data may be sent or received
 on it.  A connection to another socket is created with a
-.IR connect (2)
+.Xr connect 2
 call.  Once connected, data may be transferred using
 call.  Once connected, data may be transferred using
-.IR read (2)
+.Xr read 2
 and
 and
-.IR write (2)
+.Xr write 2
 calls or some variant of the 
 calls or some variant of the 
-.IR send (2)
+.Xr send 2
 and
 and
-.IR recv (2)
+.Xr recv 2
 calls.  When a session has been completed a
 calls.  When a session has been completed a
-.IR close (2)
+.Xr close 2
 may be performed.
 Out-of-band data may also be transmitted as described in
 may be performed.
 Out-of-band data may also be transmitted as described in
-.IR send (2)
+.Xr send 2
 and received as described in
 and received as described in
-.IR recv (2).
-.PP
+.Xr recv 2 .
+.Pp
 The communications protocols used to implement a
 The communications protocols used to implement a
-SOCK_STREAM insure that data
+.Dv SOCK_STREAM
+insure that data
 is not lost or duplicated.  If a piece of data for which the
 peer protocol has buffer space cannot be successfully transmitted
 within a reasonable length of time, then
 the connection is considered broken and calls
 will indicate an error with
 is not lost or duplicated.  If a piece of data for which the
 peer protocol has buffer space cannot be successfully transmitted
 within a reasonable length of time, then
 the connection is considered broken and calls
 will indicate an error with
-\-1 returns and with ETIMEDOUT as the specific code
-in the global variable errno.
-The protocols optionally keep sockets \*(lqwarm\*(rq by
-forcing transmissions
+-1 returns and with
+.Dv ETIMEDOUT
+as the specific code
+in the global variable
+.Va errno .
+The protocols optionally keep sockets
+.Dq warm
+by forcing transmissions
 roughly every minute in the absence of other activity.
 An error is then indicated if no response can be
 elicited on an otherwise
 idle connection for a extended period (e.g. 5 minutes).
 roughly every minute in the absence of other activity.
 An error is then indicated if no response can be
 elicited on an otherwise
 idle connection for a extended period (e.g. 5 minutes).
-A SIGPIPE signal is raised if a process sends
+A
+.Dv SIGPIPE
+signal is raised if a process sends
 on a broken stream; this causes naive processes,
 which do not handle the signal, to exit.
 on a broken stream; this causes naive processes,
 which do not handle the signal, to exit.
-.PP
-SOCK_SEQPACKET sockets employ the same system calls
-as SOCK_STREAM sockets.  The only difference
+.Pp
+.Dv SOCK_SEQPACKET
+sockets employ the same system calls
+as
+.Dv SOCK_STREAM
+sockets.  The only difference
 is that 
 is that 
-.IR read (2)
+.Xr read 2
 calls will return only the amount of data requested,
 and any remaining in the arriving packet will be discarded.
 calls will return only the amount of data requested,
 and any remaining in the arriving packet will be discarded.
-.PP
-SOCK_DGRAM and SOCK_RAW
+.Pp
+.Dv SOCK_DGRAM
+and
+.Dv SOCK_RAW
 sockets allow sending of datagrams to correspondents
 named in
 sockets allow sending of datagrams to correspondents
 named in
-.IR send (2)
+.Xr send 2
 calls.  Datagrams are generally received with
 calls.  Datagrams are generally received with
-.IR recvfrom (2),
+.Xr recvfrom 2 ,
 which returns the next datagram with its return address.
 which returns the next datagram with its return address.
-.PP
+.Pp
 An 
 An 
-.IR fcntl (2)
+.Xr fcntl 2
 call can be used to specify a process group to receive
 call can be used to specify a process group to receive
-a SIGURG signal when the out-of-band data arrives.
+a
+.Dv SIGURG
+signal when the out-of-band data arrives.
 It may also enable non-blocking I/O
 and asynchronous notification of I/O events
 It may also enable non-blocking I/O
 and asynchronous notification of I/O events
-via SIGIO.
-.PP
+via
+.Dv SIGIO .
+.Pp
 The operation of sockets is controlled by socket level
 The operation of sockets is controlled by socket level
-.IR options .
+.Em options .
 These options are defined in the file
 These options are defined in the file
-.RI < sys/socket.h >.
-.IR Setsockopt (2)
+.Ao Pa sys/socket.h Ac .
+.Xr Setsockopt 2
 and
 and
-.IR getsockopt (2)
+.Xr getsockopt 2
 are used to set and get options, respectively.
 are used to set and get options, respectively.
-.SH "RETURN VALUE
-A \-1 is returned if an error occurs, otherwise the return
+.Sh RETURN VALUES
+A -1 is returned if an error occurs, otherwise the return
 value is a descriptor referencing the socket.
 value is a descriptor referencing the socket.
-.SH "ERRORS
-The \fIsocket\fP call fails if:
-.TP 20
-[EPROTONOSUPPORT]
+.Sh ERRORS
+The
+.Fn socket
+call fails if:
+.Bl -tag -width EPROTONOPSUPPORTA
+.It Bq Er EPROTONOSUPPORT
 The protocol type or the specified protocol is not supported
 within this domain.
 The protocol type or the specified protocol is not supported
 within this domain.
-.TP 20
-[EMFILE]
+.It Bq Er EMFILE
 The per-process descriptor table is full.
 The per-process descriptor table is full.
-.TP 20
-[ENFILE]
+.It Bq Er ENFILE
 The system file table is full.
 The system file table is full.
-.TP 20
-[EACCESS]
+.It Bq Er EACCESS
 Permission to create a socket of the specified type and/or protocol
 is denied.
 Permission to create a socket of the specified type and/or protocol
 is denied.
-.TP 20
-[ENOBUFS]
+.It Bq Er ENOBUFS
 Insufficient buffer space is available.
 The socket cannot be created until sufficient resources are freed.
 Insufficient buffer space is available.
 The socket cannot be created until sufficient resources are freed.
-.SH SEE ALSO
-accept(2), bind(2), connect(2), getsockname(2), getsockopt(2),
-ioctl(2), listen(2), read(2), recv(2),
-select(2), send(2), shutdown(2), socketpair(2), write(2)
-.br
-``An Introductory 4.3BSD Interprocess Communication Tutorial.''
-(reprinted in UNIX Programmer's Supplementary Documents Volume 1, PS1:7)
-``An Advanced 4.3BSD Interprocess Communication Tutorial.''
-(reprinted in UNIX Programmer's Supplementary Documents Volume 1, PS1:8)
+.El
+.Sh SEE ALSO
+.Xr accept 2 ,
+.Xr bind 2 ,
+.Xr connect 2 ,
+.Xr getprotoent 3 ,
+.Xr getsockname 2 ,
+.Xr getsockopt 2 ,
+.Xr ioctl 2 ,
+.Xr listen 2 ,
+.Xr read 2 ,
+.Xr recv 2 ,
+.Xr select 2 ,
+.Xr send 2 ,
+.Xr shutdown 2 ,
+.Xr socketpair 2 ,
+.Xr write 2
+.Rs
+.%T "An Introductory 4.3 BSD Interprocess Communication Tutorial"
+.%O "reprinted in UNIX Programmer's Supplementary Documents Volume 1"
+.Re
+.Rs
+.%T "BSD Interprocess Communication Tutorial"
+.%O "reprinted in UNIX Programmer's Supplementary Documents Volume 1"
+.Re
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index d47af44..4eb0111 100644 (file)
@@ -1,62 +1,65 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)socketpair.2        6.3 (Berkeley) %G%
+.\"     @(#)socketpair.2       6.4 (Berkeley) %G%
 .\"
 .\"
-.TH SOCKETPAIR 2 ""
-.UC 5
-.SH NAME
-socketpair \- create a pair of connected sockets
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/socket.h>
-.PP
-.ft B
-socketpair(d, type, protocol, sv)
-int d, type, protocol;
-int sv[2];
-.fi
-.SH DESCRIPTION
+.Dd 
+.Dt SOCKETPAIR 2
+.Os BSD 4.2
+.Sh NAME
+.Nm socketpair
+.Nd create a pair of connected sockets
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/socket.h>
+.Ft int
+.Fn socketpair "int d" "int type" "int protocol" "int *sv"
+.Sh DESCRIPTION
 The
 The
-.I socketpair
+.Fn socketpair
 call creates an unnamed pair of connected sockets in
 the specified domain
 call creates an unnamed pair of connected sockets in
 the specified domain
-.IR d ,
+.Fa d ,
 of the specified
 of the specified
-.IR type ,
+.Fa type ,
 and using the optionally specified
 and using the optionally specified
-.IR protocol .
+.Fa protocol .
 The descriptors used in referencing the new sockets
 are returned in
 The descriptors used in referencing the new sockets
 are returned in
-.IR sv [0]
+.Fa sv Ns [0]
 and
 and
-.IR sv [1].
+.Fa sv Ns [1] .
 The two sockets are indistinguishable.
 The two sockets are indistinguishable.
-.SH DIAGNOSTICS
-A 0 is returned if the call succeeds, \-1 if it fails.
-.SH ERRORS
+.Sh DIAGNOSTICS
+A 0 is returned if the call succeeds, -1 if it fails.
+.Sh ERRORS
 The call succeeds unless:
 The call succeeds unless:
-.TP 20
-[EMFILE]
+.Bl -tag -width EPROTONOSUPPORTA
+.It Bq Er EMFILE
 Too many descriptors are in use by this process.
 Too many descriptors are in use by this process.
-.TP 20
-[EAFNOSUPPORT]
+.It Bq Er EAFNOSUPPORT
 The specified address family is not supported on this machine.
 The specified address family is not supported on this machine.
-.TP 20
-[EPROTONOSUPPORT]
+.It Bq Er EPROTONOSUPPORT
 The specified protocol is not supported on this machine.
 The specified protocol is not supported on this machine.
-.TP 20
-[EOPNOSUPPORT]
+.It Bq Er EOPNOSUPPORT
 The specified protocol does not support creation of socket pairs.
 The specified protocol does not support creation of socket pairs.
-.TP 20
-[EFAULT]
-The address \fIsv\fP does not specify a valid part of the
+.It Bq Er EFAULT
+The address
+.Fa sv
+does not specify a valid part of the
 process address space.
 process address space.
-.SH "SEE ALSO"
-read(2), write(2), pipe(2)
-.SH BUGS
-This call is currently implemented only for the UNIX domain.
+.Sh SEE ALSO
+.Xr read 2 ,
+.Xr write 2 ,
+.Xr pipe 2
+.Sh BUGS
+This call is currently implemented only for the
+.Tn UNIX
+domain.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 1e2e591..5b360e5 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)stat.2      6.8 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH STAT 2 ""
-.UC 4
-.SH NAME
-stat, lstat, fstat \- get file status
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/stat.h>
-.PP
-.ft B
-stat(path, buf)
-char *path;
-struct stat *buf;
-.PP
-.ft B
-lstat(path, buf)
-char *path;
-struct stat *buf;
-.PP
-.ft B
-fstat(fd, buf)
-int fd;
-struct stat *buf;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Stat
-obtains information about the file
-.IR path .
+.\"     @(#)stat.2     6.9 (Berkeley) %G%
+.\"
+.Dd 
+.Dt STAT 2
+.Os BSD 4
+.Sh NAME
+.Nm stat ,
+.Nm lstat ,
+.Nm fstat
+.Nd get file status
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/stat.h>
+.Ft int
+.Fn stat "const char *path" "struct stat *buf"
+.Ft int
+.Fn lstat "const char *path" "struct stat *buf"
+.Ft int
+.Fn fstat "int fd" "struct stat *buf"
+.Sh DESCRIPTION
+The
+.Fn stat
+function obtains information about the file pointed to by
+.Fa path .
 Read, write or execute
 permission of the named file is not required, but all directories
 Read, write or execute
 permission of the named file is not required, but all directories
-listed in the path name leading to the file must be reachable.
-.PP
-.I Lstat
-is like \fIstat\fP except in the case where the named file is a symbolic link,
+listed in the path name leading to the file must be seachable.
+.Pp
+.Fn Lstat
+is like
+.Fn stat
+except in the case where the named file is a symbolic link,
 in which case
 in which case
-.I lstat
+.Fn lstat
 returns information about the link,
 while
 returns information about the link,
 while
-.I stat
+.Fn stat
 returns information about the file the link references.
 returns information about the file the link references.
-.PP
-.I Fstat
+.Pp
+The
+.Fn fstat
 obtains the same information about an open file
 obtains the same information about an open file
-referenced by the argument descriptor, such as would
+known by the file descriptor
+.Fa fd ,
+such as would
 be obtained by an
 be obtained by an
-.I open
+.Xr open
 call.
 call.
-.PP
-.I Buf
+.Pp
+.Fa Buf
 is a pointer to a
 is a pointer to a
-.I stat
-structure into which information is placed concerning the file.
-The contents of the structure pointed to by
-.IR buf :
-.PP
-.nf
-    struct stat {
-        dev_t    st_dev;      /* device inode resides on */
-        ino_t    st_ino;      /* inode's number */
-        u_short  st_mode;     /* inode protection mode */
-        short    st_nlink;    /* number or hard links to the file */
-        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 */
-        off_t    st_size;     /* file size, in bytes */
-        time_t   st_atime;    /* time of last access */
-        int      st_spare1;
-        time_t   st_mtime;    /* time of last data modification */
-        int      st_spare2;
-        time_t   st_ctime;    /* time of last file status change */
-        int      st_spare3;
-        long     st_blksize;  /* optimal file system I/O ops blocksize */
-        long     st_blocks;   /* blocks allocated for file */
-        u_long   st_flags;    /* user defined flags for file */
-        u_long   st_gen;      /* file generation number */
-    };
-.fi
-.DT
-.PP
-.TP
-st_atime
-Time when file data was last accessed.  Changed by the following system
+.Fn stat
+structure
+as defined by
+.Aq Pa sys/stat.h
+(shown below)
+and into which information is placed concerning the file.
+.Bd -literal
+struct stat {
+    dev_t    st_dev;    /* device inode resides on */
+    ino_t    st_ino;    /* inode's number */
+    mode_t   st_mode;   /* inode protection mode */
+    nlink_t  st_nlink;  /* number or hard links to the file */
+    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 */
+    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 */
+    u_long   st_flags;  /* user defined flags for file */
+    u_long   st_gen;    /* file generation number */
+};
+.Ed
+.Pp
+The time-related fields of
+.Fa struct stat
+are as follows:
+.Bl -tag -width st_blocks
+.It st_atime
+Time when file data last accessed.  Changed by the following system
 calls:
 calls:
-.IR mknod (2),
-.IR utimes (2),
+.Xr mknod 2 ,
+.Xr utimes 2 ,
 and
 and
-.IR read (2).
-For reasons of efficiency, 
-st_atime is not set when a directory
-is searched, although this would be more logical.
-.TP
-st_mtime
-Time when data was last modified.
-It is not set by changes of owner, group, link count, or mode.
+.Xr read 2 .
+.It st_mtime
+Time when file data last modified.
 Changed by the following system calls:
 Changed by the following system calls:
-.IR mknod (2),
-.IR utimes (2),
-.IR write (2).
-.TP
-st_ctime
-Time when file status was last changed.
-It is set both both by writing and changing the i-node.
+.Xr mknod 2 ,
+.Xr utimes 2 ,
+.Xr write 2 .
+.It st_ctime
+Time when file status was last changed (inode data modification).
 Changed by the following system calls:
 Changed by the following system calls:
-.IR chmod (2)
-.IR chown (2),
-.IR link (2),
-.IR mknod (2),
-.IR rename (2),
-.IR unlink (2),
-.IR utimes (2),
-.IR write (2).
-.TP
-st_blocks
+.Xr chmod 2
+.Xr chown 2 ,
+.Xr link 2 ,
+.Xr mknod 2 ,
+.Xr rename 2 ,
+.Xr unlink 2 ,
+.Xr utimes 2 ,
+.Xr write 2 .
+.It st_blocks
 The actual number of blocks allocated for the file in 512-byte units.
 The actual number of blocks allocated for the file in 512-byte units.
-.PP
-The status information word \fIst_mode\fP has bits:
-.nf
-.in +5n
-.ta 1.6i 2.5i 3i
-#define S_IFMT 0170000 /* type of file */
-#define\ \ \ \ S_IFDIR 0040000 /* directory */
-#define\ \ \ \ S_IFCHR 0020000 /* character special */
-#define\ \ \ \ S_IFBLK 0060000 /* block special */
-#define\ \ \ \ S_IFREG 0100000 /* regular */
-#define\ \ \ \ S_IFLNK 0120000 /* symbolic link */
-#define\ \ \ \ S_IFSOCK        0140000 /* socket */
-#define S_ISUID        0004000 /* set user id on execution */
-#define S_ISGID        0002000 /* set group id on execution */
-#define S_ISVTX        0001000 /* save swapped text even after use */
-#define S_IREAD        0000400 /* read permission, owner */
-#define S_IWRITE       0000200 /* write permission, owner */
-#define S_IEXEC        0000100 /* execute/search permission, owner */
-.fi
-.in -5n
-.PP
-The mode bits 0000070 and 0000007 encode group and
-others permissions (see
-.IR chmod (2)).
-.SH "RETURN VALUE
+.El
+.Pp
+The status information word
+.Fa st_mode
+has bits:
+.Bd -literal
+#define S_IFMT 0170000           /* type of file */
+#define        S_IFIFO  0010000  /* named pipe (fifo) */
+#define        S_IFCHR  0020000  /* character special */
+#define        S_IFDIR  0040000  /* directory */
+#define        S_IFBLK  0060000  /* block special */
+#define        S_IFREG  0100000  /* regular */
+#define        S_IFLNK  0120000  /* symbolic link */
+#define        S_IFSOCK 0140000  /* socket */
+#define S_ISUID 0004000  /* set user id on execution */
+#define S_ISGID 0002000  /* set group id on execution */
+#define S_ISVTX 0001000  /* save swapped text even after use */
+#define S_IRUSR 0000400  /* read permission, owner */
+#define S_IWUSR 0000200  /* write permission, owner */
+#define S_IXUSR 0000100  /* execute/search permission, owner */
+.Ed
+.Pp
+For a list of access modes, see
+.Aq Pa sys/stat.h ,
+.Xr access 2
+and
+.Xr chmod 2 .
+.Sh RETURN VALUES
 Upon successful completion a value of 0 is returned.
 Upon successful completion a value of 0 is returned.
-Otherwise, a value of \-1 is returned and
-.I errno
+Otherwise, a value of -1 is returned and
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH "ERRORS
-.I Stat
+.SERRORS
+.Fn Stat
 and
 and
-.I lstat
-will fail if one or more of the following are true:
-.TP 15
-[ENOTDIR]
+.Fn lstat
+will fail if:
+.Bl -tag -width ENAMETOOLONGAA
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named file does not exist.
 The named file does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EFAULT]
-.I Buf
+.It Bq Er EFAULT
+.Fa Buf
 or
 or
-.I name
+.Em name
 points to an invalid address.
 points to an invalid address.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.PP
-.I Fstat
-will fail if one or both of the following are true:
-.TP 15
-[EBADF]
-.I Fildes
+.El
+.Pp
+.Bl -tag -width [EFAULT]
+.Fn Fstat
+will fail if:
+.It Bq Er EBADF
+.Fa fd
 is not a valid open file descriptor.
 is not a valid open file descriptor.
-.TP 15
-[EFAULT]
-.I Buf
+.It Bq Er EFAULT
+.Fa Buf
 points to an invalid address.
 points to an invalid address.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.SH CAVEAT
+.El
+.Sh CAVEAT
 The fields in the stat structure currently marked 
 The fields in the stat structure currently marked 
-.IR st_spare1 ,
-.IR st_spare2 ,
+.Fa st_spare1 ,
+.Fa st_spare2 ,
 and
 and
-.I st_spare3
+.Fa st_spare3
 are present in preparation for inode time stamps expanding
 to 64 bits.  This, however, can break certain programs that
 depend on the time stamps being contiguous (in calls to
 are present in preparation for inode time stamps expanding
 to 64 bits.  This, however, can break certain programs that
 depend on the time stamps being contiguous (in calls to
-.IR utimes (2)).
-.SH "SEE ALSO"
-chmod(2), chown(2), utimes(2)
-.SH BUGS
+.Xr utimes 2 ) .
+.Sh SEE ALSO
+.Xr chmod 2 ,
+.Xr chown 2 ,
+.Xr utimes 2
+.Sh BUGS
 Applying
 Applying
-.I fstat
+.Xr fstat
 to a socket (and thus to a pipe)
 returns a zero'd buffer,
 except for the blocksize field,
 and a unique device and inode number.
 to a socket (and thus to a pipe)
 returns a zero'd buffer,
 except for the blocksize field,
 and a unique device and inode number.
+.Sh STANDARDS
+The
+.Fn stat
+and
+.Fn fstat
+function calls are expected to
+conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
+.Sh HISTORY
+A
+.Nm lstat
+function call appeared in
+.Bx 4.2 .
index 9006eed..a43c8ac 100644 (file)
-.\" Copyright (c) 1989 The Regents of the University of California.
+.\" Copyright (c) 1989, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)statfs.2    6.3 (Berkeley) %G%
+.\"     @(#)statfs.2   6.4 (Berkeley) %G%
 .\"
 .\"
-.TH STATFS 2 ""
-.UC 7
-.SH NAME
-statfs \- get file system statistics
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/types.h>
-#include <sys/mount.h>
-.LP
-.ft B
-statfs(path, buf)
-char *path;
-struct statfs *buf;
-.LP
-.ft B
-fstatfs(fd, buf)
-int fd;
-struct statfs *buf;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Statfs
+.Dd 
+.Dt STATFS 2
+.Os BSD 4.4
+.Sh NAME
+.Nm statfs
+.Nd get file system statistics
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/mount.h>
+.Ft int
+.Fn statfs "const char *path" "struct statfs *buf"
+.Ft int
+.Fn fstatfs "int fd" "struct statfs *buf"
+.Sh DESCRIPTION
+.Fn Statfs
 returns information about a mounted file system.
 returns information about a mounted file system.
-.I path
+.Fa Path
 is the path name of any file within the mounted filesystem.
 is the path name of any file within the mounted filesystem.
-.I Buf
+.Fa Buf
 is a pointer to a
 is a pointer to a
-.I statfs
+.Fn statfs
 structure defined as follows:
 structure defined as follows:
-.IP
-.ta \w'#define\0\0'u +\w'fsid_t\0\0'u +\w'f_mntfromname[MNAMELEN]\0\0'u
-.nf
+.Bd -literal
 typedef quad fsid_t;
 typedef quad fsid_t;
-.sp 1
+
 #define MNAMELEN 32    /* length of buffer for returned name */
 #define MNAMELEN 32    /* length of buffer for returned name */
-.sp 1
+
 struct statfs {
 struct statfs {
-       short   f_type; /* type of filesystem (see below) */
-       short   f_flags;        /* copy of mount flags */
-       long    f_fsize;        /* fundamental file system block size */
-       long    f_bsize;        /* optimal transfer block size */
-       long    f_blocks;       /* total data blocks in file system */
-       long    f_bfree;        /* free blocks in fs */
-       long    f_bavail;       /* free blocks avail to non-superuser */
-       long    f_files;        /* total file nodes in file system */
-       long    f_ffree;        /* free file nodes in fs */
-       fsid_t  f_fsid; /* file system id */
-       long    f_spare[6];     /* spare for later */
-       char    f_mntonname[MNAMELEN];  /* directory on which mounted */
-       char    f_mntfromname[MNAMELEN];        /* mounted filesystem */
+short  f_type;           /* type of filesystem (see below) */
+short  f_flags;          /* copy of mount flags */
+long   f_fsize;          /* fundamental file system block size */
+long   f_bsize;          /* optimal transfer block size */
+long   f_blocks;         /* total data blocks in file system */
+long   f_bfree;          /* free blocks in fs */
+long   f_bavail;         /* free blocks avail to non-superuser */
+long   f_files;          /* total file nodes in file system */
+long   f_ffree;          /* free file nodes in fs */
+fsid_t f_fsid;           /* file system id */
+long   f_spare[6];       /* spare for later */
+char   f_mntonname[MNAMELEN];    /* mount point */
+char   f_mntfromname[MNAMELEN];  /* mounted filesystem */
 };
 /*
 };
 /*
- * File system types.
- */
+* File system types.
+*/
 #define        MOUNT_UFS       1
 #define        MOUNT_NFS       2
 #define        MOUNT_MFS       3
 #define        MOUNT_PC        4
 #define        MOUNT_UFS       1
 #define        MOUNT_NFS       2
 #define        MOUNT_MFS       3
 #define        MOUNT_PC        4
-.fi
-.PP
-Fields that are undefined for a particular file system are set to \-1.
-.I Fstatfs
+.Ed
+.Pp
+Fields that are undefined for a particular file system are set to -1.
+.Fn Fstatfs
 returns the same information about an open file referenced by descriptor
 returns the same information about an open file referenced by descriptor
-.IR fd .
-.SH RETURN VALUE
+.Fa fd .
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Upon successful completion, a value of 0 is returned.
-Otherwise, \-1 is returned and the global variable
-.I errno
+Otherwise, -1 is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Statfs
+.Sh ERRORS
+.Fn Statfs
 fails if one or more of the following are true:
 fails if one or more of the following are true:
-.TP 15
-ENOTDIR
+.Bl -tag -width ENAMETOOLONGA
+.It Bq Er ENOTDIR
 A component of the path prefix of
 A component of the path prefix of
-.I path
+.Fa Path
 is not a directory.
 is not a directory.
-.TP 15
-EINVAL
-.I path
+.It Bq Er EINVAL
+.Fa path
 contains a character with the high-order bit set.
 contains a character with the high-order bit set.
-.TP 15
-ENAMETOOLONG
+.It Bq Er ENAMETOOLONG
 The length of a component of
 The length of a component of
-.I path
+.Fa path
 exceeds 255 characters,
 or the length of
 exceeds 255 characters,
 or the length of
-.I path
+.Fa path
 exceeds 1023 characters.
 exceeds 1023 characters.
-.TP 15
-ENOENT
+.It Bq Er ENOENT
 The file referred to by
 The file referred to by
-.I path
+.Fa path
 does not exist.
 does not exist.
-.TP 15
-EACCES
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix of
 Search permission is denied for a component of the path prefix of
-.IR path .
-.TP 15
-ELOOP
+.Fa path .
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating
 Too many symbolic links were encountered in translating
-.IR path .
-.TP 15
-EFAULT
-.I Buf
+.Fa path .
+.It Bq Er EFAULT
+.Fa Buf
 or
 or
-.I path
+.Fa path
 points to an invalid address.
 points to an invalid address.
-.TP 15
-EIO
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.PP
-.I Fstatfs
+.El
+.Pp
+.Fn Fstatfs
 fails if one or both of the following are true:
 fails if one or both of the following are true:
-.TP 15
-EBADF
-.I fd
+.Bl -tag -width ENAMETOOLONGA
+.It Bq Er EBADF
+.Fa Fd
 is not a valid open file descriptor.
 is not a valid open file descriptor.
-.TP 15
-EFAULT
-.I buf
+.It Bq Er EFAULT
+.Fa Buf
 points to an invalid address.
 points to an invalid address.
-.TP 15
-EIO
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
+.El
+.Sh HISTORY
+The
+.Nm
+function call is currently under development.
index ddb72b0..396ae3a 100644 (file)
@@ -1,88 +1,87 @@
-.\" Copyright (c) 1980 The Regents of the University of California.
+.\" Copyright (c) 1980, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)swapon.2    6.6 (Berkeley) %G%
+.\"     @(#)swapon.2   6.7 (Berkeley) %G%
 .\"
 .\"
-.TH SWAPON 2 ""
-.UC 4
-.SH NAME
-swapon \- add a swap device for interleaved paging/swapping
-.SH SYNOPSIS
-.nf
-.B swapon(special)
-.B char *special;
-.fi
-.SH DESCRIPTION
-.I Swapon
+.Dd 
+.Dt SWAPON 2
+.Os BSD 4
+.Sh NAME
+.Nm swapon
+.Nd add a swap device for interleaved paging/swapping
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn swapon "const char *special"
+.Sh DESCRIPTION
+.Fn Swapon
 makes the block device 
 makes the block device 
-.I special 
+.Fa special
 available to the system for
 allocation for paging and swapping.  The names of potentially
 available devices are known to the system and defined at system
 configuration time.  The size of the swap area on 
 available to the system for
 allocation for paging and swapping.  The names of potentially
 available devices are known to the system and defined at system
 configuration time.  The size of the swap area on 
-.I special 
+.Fa special
 is calculated at the time the device is first made available
 for swapping.
 is calculated at the time the device is first made available
 for swapping.
-.SH "RETURN VALUE
-If an error has occurred, a value of \-1 is returned and
-.I errno
+.Sh RETURN VALUES
+If an error has occurred, a value of -1 is returned and
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Swapon
+.Sh ERRORS
+.Fn Swapon
 succeeds unless:
 succeeds unless:
-.TP 15
-[ENOTDIR]
+.Bl -tag -width ENAMETOOLONG
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named device does not exist.
 The named device does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The caller is not the super-user.
 The caller is not the super-user.
-.TP 15
-[ENOTBLK]
-.I Special
+.It Bq Er ENOTBLK
+.Fa Special
 is not a block device.
 is not a block device.
-.TP 15
-[EBUSY]
-The device specified by \fIspecial\fP has already
+.It Bq Er EBUSY
+The device specified by
+.Fa special
+has already
 been made available for swapping
 been made available for swapping
-.TP 15
-[EINVAL]
-The device configured by \fIspecial\fP was not
+.It Bq Er EINVAL
+The device configured by
+.Fa special
+was not
 configured into the system as a swap device.
 configured into the system as a swap device.
-.TP 15
-[ENXIO]
+.It Bq Er ENXIO
 The major device number of 
 The major device number of 
-.I special
+.Fa special
 is out of range (this indicates no device driver exists
 for the associated hardware).
 is out of range (this indicates no device driver exists
 for the associated hardware).
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while opening the swap device.
 An I/O error occurred while opening the swap device.
-.TP 15
-[EFAULT]
-.I Special
+.It Bq Er EFAULT
+.Fa Special
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.SH "SEE ALSO"
-swapon(8), config(8)
-.SH BUGS
+.Sh SEE ALSO
+.Xr swapon 8 ,
+.Xr config 8
+.Sh BUGS
 There is no way to stop swapping on a disk so that the pack may be
 dismounted.
 There is no way to stop swapping on a disk so that the pack may be
 dismounted.
-.PP
+.Pp
 This call will be upgraded in future versions of the system.
 This call will be upgraded in future versions of the system.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.0 .
index a7ed983..bfaeada 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)symlink.2   6.5 (Berkeley) %G%
+.\"     @(#)symlink.2  6.6 (Berkeley) %G%
 .\"
 .\"
-.TH SYMLINK 2 ""
-.UC 5
-.SH NAME
-symlink \- make symbolic link to a file
-.SH SYNOPSIS
-.nf
-.ft B
-symlink(name1, name2)
-char *name1, *name2;
-.fi
-.ft R
-.SH DESCRIPTION
+.Dd 
+.Dt SYMLINK 2
+.Os BSD 4.2
+.Sh NAME
+.Nm symlink
+.Nd make symbolic link to a file
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn symlink "const char *name1" "const char *name2"
+.Sh DESCRIPTION
 A symbolic link
 A symbolic link
-.I name2
+.Fa name2
 is created to
 is created to
-.IR name1
-(\fIname2\fP is the name of the
-file created, \fIname1\fP is the string
+.Fa name1
+.Pf ( Fa name2
+is the name of the
+file created,
+.Fa name1
+is the string
 used in creating the symbolic link).
 Either name may be an arbitrary path name; the files need not
 be on the same file system.
 used in creating the symbolic link).
 Either name may be an arbitrary path name; the files need not
 be on the same file system.
-.SH "RETURN VALUE
+.Sh RETURN VALUES
 Upon successful completion, a zero value is returned.
 Upon successful completion, a zero value is returned.
-If an error occurs, the error code is stored in \fIerrno\fP
-and a \-1 value is returned.
-.SH "ERRORS
-The symbolic link is made unless on or more of the
-following are true:
-.TP 15
-[ENOTDIR]
-A component of the \fIname2\fP prefix is not a directory.
-.TP 15
-[EINVAL]
-Either \fIname1\fP or \fIname2\fP
+If an error occurs, the error code is stored in
+.Va errno
+and a -1 value is returned.
+.Sh ERRORS
+The symbolic link succeeds unless:
+.Bl -tag -width ENAMETOO
+.It Bq Er ENOTDIR
+A component of the
+.Fa name2
+prefix is not a directory.
+.It Bq Er EINVAL
+Either
+.Fa name1
+or
+.Fa name2
 contains a character with the high-order bit set.
 contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of either pathname exceeded 255 characters,
 or the entire length of either path name exceeded 1023 characters.
 A component of either pathname exceeded 255 characters,
 or the entire length of either path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named file does not exist.
 The named file does not exist.
-.TP 15
-[EACCES]
-A component of the \fIname2\fP path prefix denies search permission.
-.TP 15
-[ELOOP]
+.It Bq Er EACCES
+A component of the
+.Fa name2
+path prefix denies search permission.
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EEXIST]
-\fIName2\fP already exists.
-.TP 15
-[EIO]
-An I/O error occurred while making the directory entry for \fIname2\fP,
-or allocating the inode for \fIname2\fP,
-or writing out the link contents of \fIname2\fP.
-.TP 15
-[EROFS]
-The file \fIname2\fP would reside on a read-only file system.
-.TP 15
-[ENOSPC]
+.It Bq Er EEXIST
+.Fa Name2
+already exists.
+.It Bq Er EIO
+An I/O error occurred while making the directory entry for
+.Fa name2 ,
+or allocating the inode for
+.Fa name2 ,
+or writing out the link contents of
+.Fa name2 .
+.It Bq Er EROFS
+The file
+.Fa name2
+would reside on a read-only file system.
+.It Bq Er ENOSPC
 The directory in which the entry for the new symbolic link is being placed
 cannot be extended because there is no space left on the file
 system containing the directory.
 The directory in which the entry for the new symbolic link is being placed
 cannot be extended because there is no space left on the file
 system containing the directory.
-.TP 15
-[ENOSPC]
+.It Bq Er ENOSPC
 The new symbolic link cannot be created because there
 there is no space left on the file
 system that will contain the symbolic link.
 The new symbolic link cannot be created because there
 there is no space left on the file
 system that will contain the symbolic link.
-.TP 15
-[ENOSPC]
+.It Bq Er ENOSPC
 There are no free inodes on the file system on which the
 symbolic link is being created.
 There are no free inodes on the file system on which the
 symbolic link is being created.
-.TP 15
-[EDQUOT]
+.It Bq Er EDQUOT
 The directory in which the entry for the new symbolic link
 is being placed cannot be extended because the
 user's quota of disk blocks on the file system
 containing the directory has been exhausted.
 The directory in which the entry for the new symbolic link
 is being placed cannot be extended because the
 user's quota of disk blocks on the file system
 containing the directory has been exhausted.
-.TP 15
-[EDQUOT]
+.It Bq Er EDQUOT
 The new symbolic link cannot be created because the user's
 quota of disk blocks on the file system that will
 contain the symbolic link has been exhausted.
 The new symbolic link cannot be created because the user's
 quota of disk blocks on the file system that will
 contain the symbolic link has been exhausted.
-.TP 15
-[EDQUOT]
+.It Bq Er EDQUOT
 The user's quota of inodes on the file system on
 which the symbolic link is being created has been exhausted.
 The user's quota of inodes on the file system on
 which the symbolic link is being created has been exhausted.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while making the directory entry or allocating the inode.
 An I/O error occurred while making the directory entry or allocating the inode.
-.TP 15
-[EFAULT]
-.I Name1
+.It Bq Er EFAULT
+.Fa Name1
 or
 or
-.I name2
+.Fa name2
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.SH "SEE ALSO"
-link(2), ln(1), unlink(2)
+.El
+.Sh SEE ALSO
+.Xr link 2 ,
+.Xr ln 1 ,
+.Xr unlink 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 04dd6aa..f61bbaf 100644 (file)
@@ -1,32 +1,47 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)sync.2      6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH SYNC 2 ""
-.UC 4
-.SH NAME
-sync \- update super-block
-.SH SYNOPSIS
-.B sync()
-.SH DESCRIPTION
-.I Sync
-causes all information in core
-memory that should be on disk to be written out.
-This includes modified super blocks,
-modified i-nodes, and delayed block I/O.
-.PP
-.I Sync
-should be used by programs that examine a file system,
-for example
-.I "fsck, df,"
-etc.
-.I Sync
-is mandatory before a boot.
-.SH "SEE ALSO"
-fsync(2), sync(8), update(8)
-.SH BUGS
-The writing, although scheduled, is not necessarily
-complete upon return from 
-.IR sync .
+.\"     @(#)sync.2     6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt SYNC 2
+.Os BSD 4
+.Sh NAME
+.Nm sync
+.Nd "synchronize disk block in-core status with that on disk"
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft void
+.Fn sync void
+.Sh DESCRIPTION
+The 
+.Fn sync
+function forces a write of dirty (modified) buffers
+in the block buffer cache out
+to disk. The kernel keeps this information in core to reduce
+the number of disk I/O transfers required by the system.
+As information in the cache is lost after a system crash a
+.Fn sync
+call is issued
+frequently
+by the user process
+.Xr update 8
+(about every 30 seconds). 
+.Pp
+The function
+.Xr fsync 2
+may be used to synchronize individual file descriptor
+attributes.
+.Sh SEE ALSO
+.Xr fsync 2 ,
+.Xr sync 8 ,
+.Xr update 8
+.Sh BUGS
+.Fn Sync
+may return before the buffers are completely flushed.
+.Sh HISTORY
+A
+.Nm
+function call appeared in Version 6 AT&T UNIX.
index d461336..966ec11 100644 (file)
@@ -1,45 +1,45 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)syscall.2   6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH SYSCALL 2 ""
-.UC 4
-.SH NAME
-syscall \- indirect system call
-.SH SYNOPSIS
-.nf
-.ft B
-#include <syscall.h>
-.PP
-.BR "syscall(number, arg, ...)" \  \  (VAX-11)
-.fi
-.SH DESCRIPTION
-.I Syscall
+.\"     @(#)syscall.2  6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt SYSCALL 2
+.Os BSD 4
+.Sh NAME
+.Nm syscall
+.Nd indirect system call
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Fd #include <sys/syscall.h>
+.Ft int
+.Fn syscall "int number" "..."
+.Sh DESCRIPTION
+.Fn Syscall
 performs the system call whose assembly language
 interface has the specified
 performs the system call whose assembly language
 interface has the specified
-.I number,
-register arguments
-.I r0
-and
-.I r1
-and further arguments
-.IR arg .
+.Fa number
+with the specified arguments.
 Symbolic constants for system calls can be found in the header file
 Symbolic constants for system calls can be found in the header file
-.I <syscall.h>.
-.PP
+.Ao Pa syscall.h Ac .
+.Pp
+.Sh RETURN VALUES
 The r0 value of the system call is returned.
 The r0 value of the system call is returned.
-.SH DIAGNOSTICS
 When the C-bit is set,
 When the C-bit is set,
-.I syscall
-returns \-1 and sets the
+.Fn syscall
+returns -1 and sets the
 external variable 
 external variable 
-.I errno
+.Va errno
 (see
 (see
-.IR intro (2)).
-.SH BUGS
+.Xr intro 2 ) .
+.Sh BUGS
 There is no way to simulate system calls
 such as
 There is no way to simulate system calls
 such as
-.IR pipe (2),
-which return values in register r1.
+.Xr pipe 2 .
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.0 .
index b1b4961..aead466 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\" All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"    @(#)truncate.2  6.8 (Berkeley) %G%
+.\"     @(#)truncate.2 6.9 (Berkeley) %G%
 .\"
 .\"
-.TH TRUNCATE 2 ""
-.UC 5
-.SH NAME
-truncate \- truncate a file to a specified length
-.SH SYNOPSIS
-.nf
-.ft B
-truncate(path, length)
-char *path;
-off_t length;
-.PP
-.ft B
-ftruncate(fd, length)
-int fd;
-off_t length;
-.fi
-.SH DESCRIPTION
-.I Truncate
+.Dd 
+.Dt TRUNCATE 2
+.Os BSD 4.2
+.Sh NAME
+.Nm truncate ,
+.Nm ftruncate
+.Nd truncate a file to a specified length
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn truncate "const char *path" "off_t length"
+.Ft int
+.Fn ftruncate "int fd" "off_t length"
+.Sh DESCRIPTION
+.Fn Truncate
 causes the file named by
 causes the file named by
-.I path
+.Fa path
 or referenced by
 or referenced by
-.I fd
+.Fa fd
 to be truncated to at most
 to be truncated to at most
-.I length
+.Fa length
 bytes in size.  If the file previously
 was larger than this size, the extra data
 is lost.
 With
 bytes in size.  If the file previously
 was larger than this size, the extra data
 is lost.
 With
-.IR ftruncate ,
+.Fn ftruncate ,
 the file must be open for writing.
 the file must be open for writing.
-.SH "RETURN VALUES
+.SRETURN VALUES
 A value of 0 is returned if the call succeeds.  If the call
 A value of 0 is returned if the call succeeds.  If the call
-fails a \-1 is returned, and the global variable \fIerrno\fP
+fails a -1 is returned, and the global variable
+.Va errno
 specifies the error.
 specifies the error.
-.SH "ERRORS
-.I Truncate
+.SERRORS
+.Fn Truncate
 succeeds unless:
 succeeds unless:
-.TP 15
-[ENOTDIR]
+.Bl -tag -width [ENOTDIR]
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named file does not exist.
 The named file does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 The named file is not writable by the user.
 The named file is not writable by the user.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EISDIR]
+.It Bq Er EISDIR
 The named file is a directory.
 The named file is a directory.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The named file resides on a read-only file system.
 The named file resides on a read-only file system.
-.TP 15
-[ETXTBSY]
+.It Bq Er ETXTBSY
 The file is a pure procedure (shared text) file that is being executed.
 The file is a pure procedure (shared text) file that is being executed.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred updating the inode.
 An I/O error occurred updating the inode.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.PP
-.I Ftruncate
+.El
+.Pp
+.Fn Ftruncate
 succeeds unless:
 succeeds unless:
-.TP 15
-[EBADF]
+.Bl -tag -width [ENOTDIR]
+.It Bq Er EBADF
 The
 The
-.I fd
+.Fa fd
 is not a valid descriptor.
 is not a valid descriptor.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The
 The
-.I fd
+.Fa fd
 references a socket, not a file.
 references a socket, not a file.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The
 The
-.I fd
+.Fa fd
 is not open for writing.
 is not open for writing.
-.SH "SEE ALSO"
-open(2)
-.SH BUGS
+.El
+.Sh SEE ALSO
+.Xr open 2
+.Sh BUGS
 These calls should be generalized to allow ranges
 of bytes in a file to be discarded.
 These calls should be generalized to allow ranges
 of bytes in a file to be discarded.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index fe831d2..b58bd83 100644 (file)
@@ -1,33 +1,56 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)umask.2     6.1 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH UMASK 2 ""
-.UC 4
-.SH NAME
-umask \- set file creation mode mask
-.SH SYNOPSIS
-.ft B
-oumask = umask(numask)
-.br
-int oumask, numask;
-.ft R
-.SH DESCRIPTION
-.I Umask
-sets the process's file mode creation mask to \fInumask\fP
-and returns the previous value of the mask.  The low-order
-9 bits of \fInumask\fP are used whenever a file is created,
-clearing corresponding bits in the file mode
+.\"     @(#)umask.2    6.2 (Berkeley) %G%
+.\"
+.Dd 
+.Dt UMASK 2
+.Os BSD 4
+.Sh NAME
+.Nm umask
+.Nd set file creation mode mask
+.Sh SYNOPSIS
+.Fd #include <sys/stat.h>
+.Ft mode_t
+.Fn umask "mode_t numask"
+.Sh DESCRIPTION
+The
+.Fn umask
+routine sets the process's file mode creation mask to
+.Fa numask
+and returns the previous value of the mask.  The 9 low-order
+access permission
+bits of
+.Fa numask
+are used by system calls, including
+.Xr open 2 ,
+.Xr mkdir 2 ,
+and
+.Xr mkfifo 2 ,
+to turn off corresponding bits
+requested in file mode.
 (see
 (see
-.IR chmod (2)).
+.Xr chmod 2 ) .
 This clearing allows each user to restrict the default access
 to his files.
 This clearing allows each user to restrict the default access
 to his files.
-.PP
-The value is initially 022 (write access for owner only).
-The mask is inherited by child processes.
-.SH "RETURN VALUE
+.Pp
+The default mask value is 022 (write access for 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.
 The previous value of the file mode mask is returned by the call.
-.SH SEE ALSO
-chmod(2), mknod(2), open(2)
+.Sh ERRORS
+The
+.Fn umask
+function is always successful.
+.Sh SEE ALSO
+.Xr chmod 2 ,
+.Xr mknod 2 ,
+.Xr open 2
+.Sh STANDARDS
+The
+.Fn umask
+function call is expected to
+conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
index f9ceab8..36a0658 100644 (file)
@@ -1,84 +1,85 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)unlink.2    6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH UNLINK 2 ""
-.UC 4
-.SH NAME
-unlink \- remove directory entry
-.SH SYNOPSIS
-.nf
-.ft B
-unlink(path)
-char *path;
-.fi
-.ft R
-.SH DESCRIPTION
-.I Unlink
-removes the entry for the file
-.I path
-from its directory.
-If this entry was the last link to the file,
+.\"     @(#)unlink.2   6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt UNLINK 2
+.Os BSD 4
+.Sh NAME
+.Nm unlink
+.Nd remove directory entry
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn unlink "const char *path"
+.Sh DESCRIPTION
+The
+.Fn unlink
+function
+removes the link named by
+.Fa path
+from its directory and decrements the link count of the
+file which was referenced by the link.
+If that decrement reduces the link count of the file
+to zero,
 and no process has the file open, then
 all resources associated with the file are reclaimed.
 and no process has the file open, then
 all resources associated with the file are reclaimed.
-If, however, the file was open in any process, the actual
-resource reclamation is delayed until it is closed,
-even though the directory entry has disappeared.
-.SH "RETURN VALUE
+If one or more process have the file open when the last link is removed,
+the link is removed, but the removal of the file is delayed until
+all references to it have been closed.
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Upon successful completion, a value of 0 is returned.
-Otherwise, a value of \-1 is returned and
-.I errno
+Otherwise, a value of -1 is returned and
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH "ERRORS
-The \fIunlink\fP succeeds unless:
-.TP 15
-[ENOTDIR]
+.Sh ERRORS
+The
+.Fn unlink
+succeeds unless:
+.Bl -tag -width ENAMETOOLONGAA
+.It Bq Er ENOTDIR
 A component of the path prefix is not a directory.
 A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named file does not exist.
 The named file does not exist.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Search permission is denied for a component of the path prefix.
 Search permission is denied for a component of the path prefix.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
 Write permission is denied on the directory containing the link
 to be removed.
 Write permission is denied on the directory containing the link
 to be removed.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating the pathname.
 Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The named file is a directory and the effective user ID
 of the process is not the super-user.
 The named file is a directory and the effective user ID
 of the process is not the super-user.
-.TP 15
-[EPERM]
+.It Bq Er EPERM
 The directory containing the file is marked sticky,
 and neither the containing directory nor the file to be removed
 are owned by the effective user ID.
 The directory containing the file is marked sticky,
 and neither the containing directory nor the file to be removed
 are owned by the effective user ID.
-.TP 15
-[EBUSY]
+.It Bq Er EBUSY
 The entry to be unlinked is the mount point for a
 mounted file system.
 The entry to be unlinked is the mount point for a
 mounted file system.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while deleting the directory entry
 or deallocating the inode.
 An I/O error occurred while deleting the directory entry
 or deallocating the inode.
-.TP 15
-[EROFS]
+.It Bq Er EROFS
 The named file resides on a read-only file system.
 The named file resides on a read-only file system.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.SH "SEE ALSO"
-close(2), link(2), rmdir(2)
+.El
+.Sh SEE ALSO
+.Xr close 2 ,
+.Xr link 2 ,
+.Xr rmdir 2
+.Sh HISTORY
+An
+.Nm
+function call appeared in Version 6 AT&T UNIX.
index a997629..0a6e46d 100644 (file)
@@ -1,76 +1,92 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1990 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)utimes.2    6.5 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH UTIMES 2 ""
-.UC 4
-.SH NAME
-utimes \- set file times
-.SH SYNOPSIS
-.nf
-.ft B
-#include <sys/time.h>
-.PP
-.ft B
-utimes(file, tvp)
-char *file;
-struct timeval tvp[2];
-.fi
-.SH DESCRIPTION
+.\"     @(#)utimes.2   6.6 (Berkeley) %G%
+.\"
+.Dd 
+.Dt UTIMES 2
+.Os BSD 4
+.Sh NAME
+.Nm utimes
+.Nd set file access and modification times
+.Sh SYNOPSIS
+.Fd #include <sys/time.h>
+.Ft int
+.Fn utimes "const char *file" "const struct timeval *times"
+.Sh DESCRIPTION
 The
 The
-.I utimes
-call
-uses the
-\*(lqaccessed\*(rq and \*(lqupdated\*(rq times in that order
-from the
-.I tvp
-vector
-to set the corresponding recorded times for
-.I file.
-.PP
-The caller must be the owner of the file or the super-user.
-The \*(lqinode-changed\*(rq time of the file is set to the current time.
-.SH "RETURN VALUE
+.Fn utimes
+function sets the access and modification times of the named file from
+the structures in the argument array
+.Fa times .
+.Pp
+The first structure is the access time, and the second is the modification
+time.
+.Pp
+If the times are specified (the
+.Fa times
+argument is
+.No non- Ns Dv NULL )
+the caller must be the owner of the file or be the superuser.
+.Pp
+If the times are not specified (the
+.Fa times
+argument is
+.Dv NULL )
+the caller must be the owner of the file, have permission to
+write the file, or be the super-user.
+.Sh RETURN VALUES
 Upon successful completion, a value of 0 is returned.
 Upon successful completion, a value of 0 is returned.
-Otherwise, a value of \-1 is returned and
-.I errno
+Otherwise, a value of -1 is returned and
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH "ERRORS
-.I Utimes
-will fail if one or more of the following are true:
-.TP 15
-[ENOTDIR]
-A component of the path prefix is not a directory.
-.TP 15
-[EINVAL]
+.Sh ERRORS
+.Fn Utimes
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EACCES
+Search permission is denied for a component of the path prefix;
+or the
+.Fa times
+argument is
+.Dv NULL
+and the effective user ID of the process does not
+match the owner of the file, and is not the super-user, and write
+access is denied.
+.It Bq Er EFAULT
+.Xr File
+or
+.Fa times
+points outside the process's allocated address space.
+.It Bq Er EINVAL
 The pathname contains a character with the high-order bit set.
 The pathname contains a character with the high-order bit set.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er EIO
+An I/O error occurred while reading or writing the affected inode.
+.It Bq Er ELOOP
+Too many symbolic links were encountered in translating the pathname.
+.It Bq Er ENAMETOOLONG
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
 A component of a pathname exceeded 255 characters,
 or an entire path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 The named file does not exist.
 The named file does not exist.
-.TP 15
-[ELOOP]
-Too many symbolic links were encountered in translating the pathname.
-.TP 15
-[EPERM]
-The process is not super-user and not the owner of the file.
-.TP 15
-[EACCES]
-Search permission is denied for a component of the path prefix.
-.TP 15
-[EROFS]
+.It Bq Er ENOTDIR
+A component of the path prefix is not a directory.
+.It Bq Er EPERM
+The
+.Fa times
+argument is not
+.Dv NULL
+and the calling process's effective user ID
+does not match the owner of the file and is not the super-user.
+.It Bq Er EROFS
 The file system containing the file is mounted read-only.
 The file system containing the file is mounted read-only.
-.TP 15
-[EFAULT]
-.I File
-or \fItvp\fP points outside the process's allocated address space.
-.TP 15
-[EIO]
-An I/O error occurred while reading or writing the affected inode.
-.SH SEE ALSO
-stat(2)
+.El
+.Sh SEE ALSO
+.Xr stat 2
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 4.2 .
index 0d01ca6..5d996a8 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)vfork.2     6.2 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH VFORK 2 ""
-.UC 4
-.SH NAME
-vfork \- spawn new process in a virtual memory efficient way
-.SH SYNOPSIS
-.B pid = vfork()
-.br
-.B int pid;
-.SH DESCRIPTION
-.I Vfork
+.\"     @(#)vfork.2    6.3 (Berkeley) %G%
+.\"
+.Dd 
+.Dt VFORK 2
+.Os BSD 4
+.Sh NAME
+.Nm vfork
+.Nd spawn new process in a virtual memory efficient way
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Ft int
+.Fn vfork void
+.Sh DESCRIPTION
+.Fn Vfork
 can be used to create new processes without fully copying the address
 space of the old process, which is horrendously inefficient in a paged
 environment.  It is useful when the purpose of
 can be used to create new processes without fully copying the address
 space of the old process, which is horrendously inefficient in a paged
 environment.  It is useful when the purpose of
-.IR fork (2)
+.Xr fork 2
 would have been to create a new system context for an
 would have been to create a new system context for an
-.IR execve .
-.I Vfork
+.Xr execve .
+.Fn Vfork
 differs from
 differs from
-.I fork
+.Xr fork
 in that the child borrows the parent's memory and thread of
 control until a call to
 in that the child borrows the parent's memory and thread of
 control until a call to
-.IR execve (2)
+.Xr execve 2
 or an exit (either by a call to
 or an exit (either by a call to
-.IR exit (2)
+.Xr exit 2
 or abnormally.)
 The parent process is suspended while the child is using its resources.
 or abnormally.)
 The parent process is suspended while the child is using its resources.
-.PP
-.I Vfork
+.Pp
+.Fn Vfork
 returns 0 in the child's context and (later) the pid of the child in
 the parent's context.
 returns 0 in the child's context and (later) the pid of the child in
 the parent's context.
-.PP
-.I Vfork
+.Pp
+.Fn Vfork
 can normally be used just like
 can normally be used just like
-.I fork.
+.Xr fork .
 It does not work, however, to return while running in the childs context
 from the procedure that called
 It does not work, however, to return while running in the childs context
 from the procedure that called
-.I vfork
+.Fn vfork
 since the eventual return from
 since the eventual return from
-.I vfork
+.Fn vfork
 would then return to a no longer existent stack frame.
 Be careful, also, to call
 would then return to a no longer existent stack frame.
 Be careful, also, to call
-.I _exit
+.Xr _exit
 rather than
 rather than
-.I exit
+.Xr exit
 if you can't
 if you can't
-.IR execve ,
+.Xr execve ,
 since
 since
-.I exit
+.Xr exit
 will flush and close standard I/O channels, and thereby mess up the
 parent processes standard I/O data structures.
 (Even with
 will flush and close standard I/O channels, and thereby mess up the
 parent processes standard I/O data structures.
 (Even with
-.I fork
+.Xr fork
 it is wrong to call
 it is wrong to call
-.I exit
+.Xr exit
 since buffered data would then be flushed twice.)
 since buffered data would then be flushed twice.)
-.SH SEE ALSO
-fork(2), execve(2), sigvec(2), wait(2),
-.SH DIAGNOSTICS
+.Sh SEE ALSO
+.Xr fork 2 ,
+.Xr execve 2 ,
+.Xr sigvec 2 ,
+.Xr wait 2 ,
+.Sh DIAGNOSTICS
 Same as for
 Same as for
-.IR fork .
-.SH BUGS
+.Xr fork .
+.Sh BUGS
 This system call will be eliminated when proper system sharing
 mechanisms are implemented. 
 Users should not depend on the memory
 sharing semantics of
 This system call will be eliminated when proper system sharing
 mechanisms are implemented. 
 Users should not depend on the memory
 sharing semantics of
-.I vfork
+.Xr vfork
 as it will, in that case, be made synonymous to
 as it will, in that case, be made synonymous to
-.IR fork .
-.PP
+.Xr fork .
+.Pp
 To avoid a possible deadlock situation,
 processes that are children in the middle
 of a
 To avoid a possible deadlock situation,
 processes that are children in the middle
 of a
-.I vfork
-are never sent SIGTTOU or SIGTTIN signals; rather,
+.Fn vfork
+are never sent
+.Dv SIGTTOU
+or
+.Dv SIGTTIN
+signals; rather,
 output or
 output or
-.IR ioctl s
+.Xr ioctl 2
+calls
 are allowed
 and input attempts result in an end-of-file indication.
 are allowed
 and input attempts result in an end-of-file indication.
+.Sh HISTORY
+The
+.Nm
+function call appeared in
+.Bx 3.0 .
index 9a95ff9..88f95f1 100644 (file)
 .\" Copyright (c) 1980, 1991 Regents of the University of California.
 .\" Copyright (c) 1980, 1991 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)wait.2      6.4 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH WAIT 2 ""
-.UC 4
-.SH NAME
-wait, waitpid, wait4, wait3 \- wait for process to terminate
-.SH SYNOPSIS
-.ft B
-.nf
-#include <sys/types.h>
-#include <sys/wait.h>
-.PP
-.ft B
-pid = wait(statp)
-pid_t pid;
-int *statp;
-.PP
-.ft B
-pid = waitpid(wpid, statp, options)
-pid_t pid, wpid;
-int *statp;
-int options;
-.PP
-.ft B
-#include <sys/time.h>
-#include <sys/resource.h>
-.PP
-.ft B
-pid = wait4(wpid, statp, options, rusage)
-pid_t pid, wpid;
-int *statp;
-int options;
-struct rusage *rusage;
-.PP
-.ft B
-pid = wait3(statp, options, rusage)
-pid_t pid;
-int *statp;
-int options;
-struct rusage *rusage;
-.fi
-.SH DESCRIPTION
-.I Wait
-causes its caller to delay until a signal is received or
-one of its child
-processes terminates.
-If any child has died since the last
-.IR wait ,
-return is immediate, returning the process id and
-exit status of one of the terminated
-children.
-If there are no children, return is immediate with
-the value \-1 returned.
-.PP
+.\"     @(#)wait.2     6.5 (Berkeley) %G%
+.\"
+.Dd 
+.Dt WAIT 2
+.Os BSD 4
+.Sh NAME
+.Nm wait ,
+.Nm waitpid ,
+.Nm wait4 ,
+.Nm wait3
+.Nd wait for process terminatation
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/wait.h>
+.Ft pid_t
+.Fn wait "int *status"
+.Fd #include <sys/time.h>
+.Fd #include <sys/resource.h>
+.Ft pid_t
+.Fn waitpid "pid_t wpid" "int *status" "int options"
+.Ft pid_t
+.Fn wait3 "int *status" "int options" "struct rusage *rusage"
+.Ft pid_t
+.Fn wait4 "pid_t wpid" "int *status" "int options" "struct rusage *rusage"
+.Sh DESCRIPTION
+The
+.Fn wait
+function suspends execution of its calling process until
+.Fa status
+information is available for a terminated child process,
+or a signal is received.
 On return from a successful 
 On return from a successful 
-.I wait
-call with a non-null
-.I statp
-pointer, 
-the location to which
-.I statp
-points contains termination information about the process that exited
+.Fn wait
+call, 
+the
+.Fa status
+area contains termination information about the process that exited
 as defined below.
 as defined below.
-.PP
+.Pp
 The
 The
-.I wait4
+.Fn wait4
 call provides a more general interface for programs
 call provides a more general interface for programs
-that wish to wait for certain child processes,
-that wish resource utilization statistics accummulated by child processes,
+that need to wait for certain child processes,
+that need resource utilization statistics accummulated by child processes,
 or that require options.
 The other wait functions are implemented using
 or that require options.
 The other wait functions are implemented using
-.IR wait4 .
-.PP
+.Fn wait4 .
+.Pp
 The
 The
-.I wpid
+.Fa wpid
 parameter specifies the set of child processes for which to wait.
 If
 parameter specifies the set of child processes for which to wait.
 If
-.I wpid
-is \-1, the call waits for any child process.
+.Fa wpid
+is -1, the call waits for any child process.
 If
 If
-.I wpid
+.Fa wpid
 is 0,
 the call waits for any child process in the process group of the caller.
 If
 is 0,
 the call waits for any child process in the process group of the caller.
 If
-.I wpid
+.Fa wpid
 is greater than zero, the call waits for the process with process id
 is greater than zero, the call waits for the process with process id
-.IR wpid .
+.Fa wpid .
 If
 If
-.I wpid
-is less than \-1, the call waits for any process whose process group id
+.Fa wpid
+is less than -1, the call waits for any process whose process group id
 equals the absolute value of
 equals the absolute value of
-.IR wpid .
-.PP
+.Fa wpid .
+.Pp
 The
 The
-.I statp
+.Fa status
 parameter is defined below.  The
 parameter is defined below.  The
-.I options
+.Fa options
 parameter contains the bitwise OR of any of the following options.
 parameter contains the bitwise OR of any of the following options.
-The WNOHANG option
+The
+.Dv WNOHANG
+option
 is used to indicate that the call should not block if
 there are no processes that wish to report status.
 is used to indicate that the call should not block if
 there are no processes that wish to report status.
-If the WUNTRACED option is set,
+If the
+.Dv WUNTRACED
+option is set,
 children of the current process that are stopped
 children of the current process that are stopped
-due to a SIGTTIN, SIGTTOU, SIGTSTP, or SIGSTOP signal also have
+due to a
+.Dv SIGTTIN , SIGTTOU , SIGTSTP ,
+or
+.Dv SIGSTOP
+signal also have
 their status reported.
 their status reported.
-.PP
+.Pp
 If
 If
-.I rusage
+.Fa rusage
 is non-zero, a summary of the resources used by the terminated
 process and all its
 children is returned (this information is currently not available
 for stopped processes).
 is non-zero, a summary of the resources used by the terminated
 process and all its
 children is returned (this information is currently not available
 for stopped processes).
-.PP
-When the WNOHANG option is specified and no processes
+.Pp
+When the
+.Dv WNOHANG
+option is specified and no processes
 wish to report status, 
 wish to report status, 
-.I wait4
+.Fn wait4
 returns a 
 returns a 
-.I pid
+process id
 of 0.
 of 0.
-.PP
+.Pp
 The
 The
-.I waitpid
+.Fn waitpid
 call is identical to
 call is identical to
-.I wait4
+.Fn wait4
 with an
 with an
-.I rusage
+.Fa rusage
 value of zero.
 The older
 value of zero.
 The older
-.I wait3
+.Fn wait3
 call is the same as
 call is the same as
-.I wait4
+.Fn wait4
 with a
 with a
-.I wpid
-value of \-1.
-.PP
-If the
-.I statp
-parameter is not null,
-the status of the process is placed in the location to which
-.I statp
-points.
-The following macros may be used with that status information
-to test the state and/or manner of exit of the process.
+.Fa wpid
+value of -1.
+.Pp
+The following macros may be used to test the manner of exit of the process.
 One of the first three macros will evaluate to a non-zero (true) value:
 One of the first three macros will evaluate to a non-zero (true) value:
-.IP WIFEXITED(status)
+.Bl -tag -width Ds
+.It Fn WIFEXITED status
 True if the process terminated normally by a call to
 True if the process terminated normally by a call to
-.IR _exit (2)
+.Xr _exit 2
 or
 or
-.IR exit (2).
-.IP WIFSIGNALED(status)
+.Xr exit 2 .
+.It Fn WIFSIGNALED status
 True if the process terminated due to receipt of a signal.
 True if the process terminated due to receipt of a signal.
-.IP WIFSTOPPED(status)
+.It Fn WIFSTOPPED status
 True if the process has not terminated, but has stopped and can be restarted.
 This macro can be true only if the wait call specified the
 True if the process has not terminated, but has stopped and can be restarted.
 This macro can be true only if the wait call specified the
-WUNTRACED
+.Dv WUNTRACED
 option
 or if the child process is being traced (see
 option
 or if the child process is being traced (see
-.IR ptrace (2)).
-.LP
+.Xr ptrace 2 ) .
+.El
+.Pp
 Depending on the values of those macros, the following macros
 produce the remaining status information about the child process:
 Depending on the values of those macros, the following macros
 produce the remaining status information about the child process:
-.IP WEXITSTATUS(status)
-If WIFEXITED(status) is true, evaluates to the low-order 8 bits
+.Bl -tag -width Ds
+.It Fn WEXITSTATUS status
+If
+.Fn WIFEXITED status
+is true, evaluates to the low-order 8 bits
 of the argument passed to
 of the argument passed to
-.IR _exit (2)
+.Xr _exit 2
 or
 or
-.IR exit (2)
+.Xr exit 2
 by the child.
 by the child.
-.IP WTERMSIG(status)
-If WIFSIGNALED(status) is true, evaluates to the number of the signal
+.It Fn WTERMSIG status
+If
+.Fn WIFSIGNALED status
+is true, evaluates to the number of the signal
 that caused the termination of the process.
 that caused the termination of the process.
-.IP WCOREDUMP(status)
-If WIFSIGNALED(status) is true, evaluates as true if the termination
+.It Fn WCOREDUMP status
+If
+.Fn WIFSIGNALED status
+is true, evaluates as true if the termination
 of the process was accompanied by the creation of a core file
 containing an image of the process when the signal was received.
 of the process was accompanied by the creation of a core file
 containing an image of the process when the signal was received.
-.IP WSTOPSIG(status)
-If WIFSTOPPED(status) is true, evaluates to the number of the signal
+.It Fn WSTOPSIG status
+If
+.Fn WIFSTOPPED status
+is true, evaluates to the number of the signal
 that caused the process to stop.
 that caused the process to stop.
-.SH NOTES
+.El
+.Sh NOTES
 See
 See
-.IR sigaction (2)
+.Xr sigaction 2
 for a list of termination signals.
 A status of 0 indicates normal termination.
 for a list of termination signals.
 A status of 0 indicates normal termination.
-.PP
-If the parent process terminates without
-waiting on its children,
-the initialization process
-(process ID = 1)
-inherits the children.
-.PP
+.Pp
+If a parent process terminates without
+waiting for all of its child processes to terminate,
+the remaining child processes are assigned the parent
+process 1 ID (the init process ID).
+.Pp
 If a signal is caught while any of the
 If a signal is caught while any of the
-.I wait
+.Fn wait
 calls is pending,
 the call may be interrupted or restarted when the signal-catching routine
 returns,
 depending on the options in effect for the signal;
 see
 calls is pending,
 the call may be interrupted or restarted when the signal-catching routine
 returns,
 depending on the options in effect for the signal;
 see
-.IR intro (2),
+.Xr intro 2 ,
 System call restart.
 System call restart.
-.SH "RETURN VALUE
-If \fIwait\fP returns due to a stopped
+.Sh RETURN VALUES
+If
+.Fn wait
+returns due to a stopped
 or terminated child process, the process ID of the child
 or terminated child process, the process ID of the child
-is returned to the calling process.  Otherwise, a value of \-1
-is returned and \fIerrno\fP is set to indicate the error.
-.PP
+is returned to the calling process.  Otherwise, a value of -1
+is returned and
+.Va errno
+is set to indicate the error.
+.Pp
 If
 If
-.IR wait4 ,
-.I wait3
+.Fn wait4 ,
+.Fn wait3
 or
 or
-.I waitpid
+.Fn waitpid
 returns due to a stopped
 or terminated child process, the process ID of the child
 is returned to the calling process.
 If there are no children not previously awaited,
 returns due to a stopped
 or terminated child process, the process ID of the child
 is returned to the calling process.
 If there are no children not previously awaited,
-\-1 is returned with
-.I errno
-set to [ECHILD].
-Otherwise, if WNOHANG is specified and there are
+-1 is returned with
+.Va errno
+set to
+.Bq Er ECHILD .
+Otherwise, if
+.Dv WNOHANG
+is specified and there are
 no stopped or exited children,
 0 is returned.
 If an error is detected or a caught signal aborts the call,
 no stopped or exited children,
 0 is returned.
 If an error is detected or a caught signal aborts the call,
-a value of \-1
-is returned and \fIerrno\fP is set to indicate the error.
-.SH ERRORS
-.I Wait
-will fail and return immediately if one or more of the following
-are true:
-.TP 15
-[ECHILD]
+a value of -1
+is returned and
+.Va errno
+is set to indicate the error.
+.Sh ERRORS
+.Fn Wait
+will fail and return immediately if:
+.Bl -tag -width Er
+.It Bq Er ECHILD
 The calling process has no existing unwaited-for
 child processes.
 The calling process has no existing unwaited-for
 child processes.
-.TP 15
-[EFAULT]
-The \fIstatp\fP or \fIrusage\fP arguments point to an illegal address.
+.It Bq Er EFAULT
+The
+.Fa status
+or
+.Fa rusage
+arguments point to an illegal address.
 (May not be detected before exit of a child process.)
 (May not be detected before exit of a child process.)
-.TP 15
-[EINTR]
+.It Bq Er EINTR
 The call was interrupted by a caught signal,
 The call was interrupted by a caught signal,
-or the signal did not have the SA_RESTART flag set.
-.SH STANDARDS
+or the signal did not have the
+.Dv SA_RESTART
+flag set.
+.El
+.Sh STANDARDS
 The
 The
-.I wait
+.Fn wait
 and
 and
-.I waitpid
+.Fn waitpid
 functions are defined by POSIX;
 functions are defined by POSIX;
-.I wait4
+.Fn wait4
 and
 and
-.I wait3
+.Fn wait3
 are not specified by POSIX.
 are not specified by POSIX.
-The WCOREDUMP macro
+The
+.Fn WCOREDUMP
+macro
 and the ability to restart a pending
 and the ability to restart a pending
-.I wait
+.Fn wait
 call are extensions to the POSIX interface.
 call are extensions to the POSIX interface.
-.SH "SEE ALSO"
-exit(2), sigaction(2)
+.Sh SEE ALSO
+.Xr exit 2 ,
+.Xr sigaction 2
+.Sh HISTORY
+A
+.Nm
+function call appeared in Version 6 AT&T UNIX.
index 754fd10..e62028e 100644 (file)
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1980, 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)write.2     6.5 (Berkeley) %G%
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.TH WRITE 2 ""
-.UC 4
-.SH NAME
-write, writev \- write output
-.SH SYNOPSIS
-.nf
-.ft B
-cc = write(d, buf, nbytes)
-int cc, d;
-char *buf;
-int nbytes;
-.PP
-.ft B
-#include <sys/types.h>
-#include <sys/uio.h>
-.PP
-.ft B
-cc = writev(d, iov, iovcnt)
-int cc, d;
-struct iovec *iov;
-int iovcnt;
-.fi
-.SH DESCRIPTION
-.I Write
+.\"     @(#)write.2    6.6 (Berkeley) %G%
+.\"
+.Dd 
+.Dt WRITE 2
+.Os BSD 4
+.Sh NAME
+.Nm write ,
+.Nm writev
+.Nd write output
+.Sh SYNOPSIS
+.Fd #include <unistd.h>
+.Fd #include <sys/types.h>
+.Fd #include <sys/uio.h>
+.Ft ssize_t
+.Fn write "int d" "const char *buf" "size_t nbytes"
+.Ft int
+.Fn writev "int d" "struct iovec *iov" "int iovcnt"
+.Sh DESCRIPTION
+.Fn Write
 attempts to write
 attempts to write
-.I nbytes
+.Fa nbytes
 of data to the object referenced by the descriptor
 of data to the object referenced by the descriptor
-.I d
+.Fa d
 from the buffer pointed to by
 from the buffer pointed to by
-.IR buf .
-.I Writev
+.Fa buf .
+.Fn Writev
 performs the same action, but gathers the output data
 from the 
 performs the same action, but gathers the output data
 from the 
-.I iovcnt
+.Fa iovcnt
 buffers specified by the members of the
 buffers specified by the members of the
-.I iov
-array: iov[0], iov[1], ..., iov[iovcnt\|\-\|1].
-.PP
+.Fa iov
+array: iov[0], iov[1], ..., iov[iovcnt\|-\|1].
+.Pp
 For 
 For 
-.IR writev ,
+.Fn writev ,
 the 
 the 
-.I iovec
-structure is defined as
-.PP
-.nf
-.RS
-.DT
+.Fa iovec
+structure is defined as:
+.Bd -literal -offset indent -compact
 struct iovec {
        caddr_t iov_base;
        int     iov_len;
 };
 struct iovec {
        caddr_t iov_base;
        int     iov_len;
 };
-.RE
-.fi
-.PP
+.Ed
+.Pp
 Each 
 Each 
-.I iovec
+.Fa iovec
 entry specifies the base address and length of an area
 in memory from which data should be written.
 entry specifies the base address and length of an area
 in memory from which data should be written.
-.I Writev
+.Fn Writev
 will always write a complete area before proceeding
 to the next.
 will always write a complete area before proceeding
 to the next.
-.PP
-On objects capable of seeking, the \fIwrite\fP starts at a position
+.Pp
+On objects capable of seeking, the
+.Fn write
+starts at a position
 given by the pointer associated with
 given by the pointer associated with
-.IR d ,
+.Fa d ,
 see
 see
-.IR lseek (2).
+.Xr lseek 2 .
 Upon return from
 Upon return from
-.IR write ,
-the pointer is incremented by the number of bytes actually written.
-.PP
+.Fn write ,
+the pointer is incremented by the number of bytes which were written.
+.Pp
 Objects that are not capable of seeking always write from the current
 position.  The value of the pointer associated with such an object
 is undefined.
 Objects that are not capable of seeking always write from the current
 position.  The value of the pointer associated with such an object
 is undefined.
-.PP
+.Pp
 If the real user is not the super-user, then
 If the real user is not the super-user, then
-.I write
+.Fn write
 clears the set-user-id bit on a file.
 This prevents penetration of system security
 by a user who
 clears the set-user-id bit on a file.
 This prevents penetration of system security
 by a user who
-\*(lqcaptures\*(rq a writable set-user-id file
+.Dq captures
+a writable set-user-id file
 owned by the super-user.
 owned by the super-user.
-.PP
+.Pp
 When using non-blocking I/O on objects such as sockets that are subject
 to flow control,
 When using non-blocking I/O on objects such as sockets that are subject
 to flow control,
-.I write
+.Fn write
 and
 and
-.I writev
+.Fn writev
 may write fewer bytes than requested;
 the return value must be noted,
 and the remainder of the operation should be retried when possible.
 may write fewer bytes than requested;
 the return value must be noted,
 and the remainder of the operation should be retried when possible.
-.SH "RETURN VALUE
-Upon successful completion the number of bytes actually written
-is returned.  Otherwise a \-1 is returned and the global variable
-.I errno
+.Sh RETURN VALUES
+Upon successful completion the number of bytes which were written
+is returned.  Otherwise a -1 is returned and the global variable
+.Va errno
 is set to indicate the error.
 is set to indicate the error.
-.SH ERRORS
-.I Write
+.Sh ERRORS
+.Fn Write
 and
 and
-.I writev
-will fail and the file pointer will remain unchanged if one or more
-of the following are true:
-.TP 15
-[EBADF]
-\fID\fP is not a valid descriptor open for writing.
-.TP 15
-[EPIPE]
+.Fn writev
+will fail and the file pointer will remain unchanged if:
+.Bl -tag -width Er
+.It Bq Er EBADF
+.Fa D
+is not a valid descriptor open for writing.
+.It Bq Er EPIPE
 An attempt is made to write to a pipe that is not open
 for reading by any process.
 An attempt is made to write to a pipe that is not open
 for reading by any process.
-.TP 15
-[EPIPE]
-An attempt is made to write to a socket of type SOCK_STREAM
+.It Bq Er EPIPE
+An attempt is made to write to a socket of type
+.DV SOCK_STREAM
 that is not connected to a peer socket.
 that is not connected to a peer socket.
-.TP 15
-[EFBIG]
+.It Bq Er EFBIG
 An attempt was made to write a file that exceeds the process's
 file size limit or the maximum file size.
 An attempt was made to write a file that exceeds the process's
 file size limit or the maximum file size.
-.TP 15
-[EFAULT]
-Part of \fIiov\fP or data to be written to the file
+.It Bq Er EFAULT
+Part of
+.Fa iov
+or data to be written to the file
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The pointer associated with
 The pointer associated with
-.I d
+.Fa d
 was negative.
 was negative.
-.TP 15
-[ENOSPC]
+.It Bq Er ENOSPC
 There is no free space remaining on the file system
 containing the file.
 There is no free space remaining on the file system
 containing the file.
-.TP 15
-[EDQUOT]
+.It Bq Er EDQUOT
 The user's quota of disk blocks on the file system
 containing the file has been exhausted.
 The user's quota of disk blocks on the file system
 containing the file has been exhausted.
-.TP 15
-[EIO]
+.It Bq Er EIO
 An I/O error occurred while reading from or writing to the file system.
 An I/O error occurred while reading from or writing to the file system.
-.TP 15
-[EWOULDBLOCK]
+.It Bq Er EWOULDBLOCK
 The file was marked for non-blocking I/O,
 and no data could be written immediately.
 The file was marked for non-blocking I/O,
 and no data could be written immediately.
-.PP
+.El
+.Pp
 In addition, 
 In addition, 
-.I writev
+.Fn writev
 may return one of the following errors:
 may return one of the following errors:
-.TP 15
-[EINVAL]
-.I Iovcnt
+.Bl -tag -width Er
+.It Bq Er EINVAL
+.Fa Iovcnt
 was less than or equal to 0, or greater than 16.
 was less than or equal to 0, or greater than 16.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 One of the
 One of the
-.I iov_len
+.Fa iov_len
 values in the
 values in the
-.I iov
+.Fa iov
 array was negative.
 array was negative.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 The sum of the
 The sum of the
-.I iov_len
+.Fa iov_len
 values in the
 values in the
-.I iov
+.Fa iov
 array overflowed a 32-bit integer.
 array overflowed a 32-bit integer.
-.SH "SEE ALSO"
-fcntl(2), lseek(2), open(2), pipe(2), select(2)
+.El
+.Sh SEE ALSO
+.Xr fcntl 2 ,
+.Xr lseek 2 ,
+.Xr open 2 ,
+.Xr pipe 2 ,
+.Xr select 2
+.Sh STANDARDS
+.Fn Write
+is expected to conform to IEEE Std 1003.1-1988
+.Pq Dq Tn POSIX .
+.Sh HISTORY
+The
+.Fn writev
+function call
+appeared in
+.Bx 4.2 .
+A
+.Nm write
+function call
+appeared in
+Version 6 AT&T UNIX.