summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-06-13 10:08:39 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-06-13 10:08:39 +0000
commitc70041f4ba685f7265d7c1a79c387ee48f44cc33 (patch)
treeb86a2f7df7cfcf603d46ae16d9f93c847744cd69
parentf006ff6a3ed2b3936f8afb782b367626e8ff070e (diff)
fix lots of .Xr and other minor things
-rw-r--r--lib/libc/sys/_exit.22
-rw-r--r--lib/libc/sys/brk.22
-rw-r--r--lib/libc/sys/close.22
-rw-r--r--lib/libc/sys/execve.23
-rw-r--r--lib/libc/sys/fcntl.24
-rw-r--r--lib/libc/sys/fork.24
-rw-r--r--lib/libc/sys/getfsstat.22
-rw-r--r--lib/libc/sys/getrlimit.24
-rw-r--r--lib/libc/sys/getsockname.22
-rw-r--r--lib/libc/sys/getsockopt.210
-rw-r--r--lib/libc/sys/intro.236
-rw-r--r--lib/libc/sys/mmap.22
-rw-r--r--lib/libc/sys/open.22
-rw-r--r--lib/libc/sys/rfork.23
-rw-r--r--lib/libc/sys/sigaction.231
-rw-r--r--lib/libc/sys/stat.212
-rw-r--r--lib/libc/sys/statfs.24
-rw-r--r--lib/libc/sys/utimes.24
-rw-r--r--lib/libc/sys/vfork.226
-rw-r--r--lib/libc/sys/wait.27
20 files changed, 98 insertions, 64 deletions
diff --git a/lib/libc/sys/_exit.2 b/lib/libc/sys/_exit.2
index 402de8fb9b1..f8d08d2d986 100644
--- a/lib/libc/sys/_exit.2
+++ b/lib/libc/sys/_exit.2
@@ -55,7 +55,7 @@ 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.
.It
If the parent process of the calling process has an outstanding
-.Xr wait
+.Xr wait 2
call
or catches the
.Dv SIGCHLD
diff --git a/lib/libc/sys/brk.2 b/lib/libc/sys/brk.2
index f580c15f685..ed779034d08 100644
--- a/lib/libc/sys/brk.2
+++ b/lib/libc/sys/brk.2
@@ -116,7 +116,7 @@ otherwise -1 with
.Va errno
set to indicate why the allocation failed.
.Sh ERRORS
-.Xr Sbrk
+.Nm Sbrk
will fail and no additional memory will be allocated if
one of the following are true:
.Bl -tag -width Er
diff --git a/lib/libc/sys/close.2 b/lib/libc/sys/close.2
index 5cd4d18ec36..58d74ef7295 100644
--- a/lib/libc/sys/close.2
+++ b/lib/libc/sys/close.2
@@ -80,7 +80,7 @@ of the descriptors can be rearranged with
or deleted with
.Fn close
before the
-.Xr execve
+.Xr execve 2
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.
diff --git a/lib/libc/sys/execve.2 b/lib/libc/sys/execve.2
index c5c9838e611..baa0ba7bd38 100644
--- a/lib/libc/sys/execve.2
+++ b/lib/libc/sys/execve.2
@@ -259,7 +259,8 @@ the real
is ``root'', then the program has some of the powers
of a super-user as well.
.Sh SEE ALSO
-.Xr exit 2 ,
+.Xr _exit 2 ,
+.Xr exit 3 ,
.Xr fork 2 ,
.Xr execl 3 ,
.Xr environ 7
diff --git a/lib/libc/sys/fcntl.2 b/lib/libc/sys/fcntl.2
index c587b948bfd..382fd1ab412 100644
--- a/lib/libc/sys/fcntl.2
+++ b/lib/libc/sys/fcntl.2
@@ -130,9 +130,9 @@ flags are as follows:
.Bl -tag -width O_NONBLOCKX
.It Dv O_NONBLOCK
Non-blocking I/O; if no data is available to a
-.Xr read
+.Xr read 2
call, or if a
-.Xr write
+.Xr write 2
operation would block,
the read or write call returns -1 with the error
.Er EAGAIN .
diff --git a/lib/libc/sys/fork.2 b/lib/libc/sys/fork.2
index 3f5bde2032a..3f6c3cb9987 100644
--- a/lib/libc/sys/fork.2
+++ b/lib/libc/sys/fork.2
@@ -62,9 +62,9 @@ for instance, file pointers in file objects are shared between
the child and the parent, so that an
.Xr lseek 2
on a descriptor in the child process can affect a subsequent
-.Xr read
+.Xr read 2
or
-.Xr write
+.Xr write 2
by the parent.
This descriptor copying is also used by the shell to
establish standard input and output for newly created processes
diff --git a/lib/libc/sys/getfsstat.2 b/lib/libc/sys/getfsstat.2
index c924dd62c39..98c8d911018 100644
--- a/lib/libc/sys/getfsstat.2
+++ b/lib/libc/sys/getfsstat.2
@@ -50,7 +50,7 @@
returns information about all mounted file systems.
.Fa Buf
is a pointer to an array of
-.Xr statfs
+.Xr statfs 2
structures defined as follows:
.Bd -literal
typedef struct { int32_t val[2]; } fsid_t;
diff --git a/lib/libc/sys/getrlimit.2 b/lib/libc/sys/getrlimit.2
index c81379974d7..ce60b081281 100644
--- a/lib/libc/sys/getrlimit.2
+++ b/lib/libc/sys/getrlimit.2
@@ -62,7 +62,7 @@ parameter is one of the following:
.Bl -tag -width RLIMIT_FSIZEAA
.It Li RLIMIT_CORE
The largest size (in bytes)
-.Xr core
+.Pa core
file that may be created.
.It Li RLIMIT_CPU
The maximum amount of cpu time (in seconds) to be used by
@@ -136,7 +136,7 @@ equivalent.
.Pp
The system refuses to extend the data or stack space when the limits
would be exceeded in the normal way: a
-.Xr break
+.Xr brk 2
call fails if the data space limit is reached.
When the stack limit is reached, the process receives
a segmentation fault
diff --git a/lib/libc/sys/getsockname.2 b/lib/libc/sys/getsockname.2
index 4582a3ea500..45e2f9808d1 100644
--- a/lib/libc/sys/getsockname.2
+++ b/lib/libc/sys/getsockname.2
@@ -81,7 +81,7 @@ process address space.
.Xr socket 2
.Sh BUGS
Names bound to sockets in the UNIX domain are inaccessible;
-.Xr getsockname
+.Nm getsockname
returns a zero length name.
.Sh HISTORY
The
diff --git a/lib/libc/sys/getsockopt.2 b/lib/libc/sys/getsockopt.2
index 5fb33ce8bb8..247467c4ce8 100644
--- a/lib/libc/sys/getsockopt.2
+++ b/lib/libc/sys/getsockopt.2
@@ -191,7 +191,7 @@ is performed.
If the socket promises reliable delivery of data and
.Dv SO_LINGER is set,
the system will block the process on the
-.Xr close
+.Xr close 2
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
@@ -202,7 +202,7 @@ is requested).
If
.Dv SO_LINGER
is disabled and a
-.Xr close
+.Xr close 2
is issued, the system will process the close in a manner that allows
the process to continue as quickly as possible.
.Pp
@@ -216,9 +216,9 @@ With protocols that support out-of-band data, the
option
requests that out-of-band data be placed in the normal data input queue
as received; it will then be accessible with
-.Xr recv
+.Xr recv 2
or
-.Xr read
+.Xr read 2
calls without the
.Dv MSG_OOB
flag.
@@ -338,7 +338,7 @@ is not in a valid part of the process address space.
.Sh SEE ALSO
.Xr ioctl 2 ,
.Xr socket 2 ,
-.Xr getprotoent 3
+.Xr getprotoent 3 ,
.Xr protocols 5
.Sh BUGS
Several of the socket options should be handled at lower levels of the system.
diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2
index 0f16417d4bf..803b5e19b98 100644
--- a/lib/libc/sys/intro.2
+++ b/lib/libc/sys/intro.2
@@ -124,9 +124,9 @@ 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
+.Xr wait 2
or
-.Xr waitpid
+.Xr waitpid 2
function was executed by a process that had no existing or unwaited-for
child processes.
.It Er 11 EDEADLK Em "Resource deadlock avoided" .
@@ -152,7 +152,7 @@ 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,
for instance, as the new link name in a
-.Xr link
+.Xr link 2
function.
.It Er 18 EXDEV Em "Improper link" .
A hard link to a file on another file system
@@ -170,9 +170,9 @@ 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
+.Xr signal 3
or
-.Xr kill
+.Xr kill 2
function).
.It Er 23 ENFILE Em "Too many open files in system" .
Maximum number of file descriptors allowable on the system
@@ -181,7 +181,7 @@ 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
+.Xr getdtablesize 2
will obtain the current limit.
.It Er 25 ENOTTY Em "Inappropriate ioctl for device" .
A control function (see
@@ -192,7 +192,7 @@ special device for which the operation was inappropriate.
The new process was a pure procedure (shared text) file
which was open for writing by another process, or
while the pure procedure file was being executed an
-.Xr open
+.Xr open 2
call requested write access.
.It Er 27 EFBIG Em "File too large" .
The size of a file exceeded the maximum (about
@@ -201,7 +201,7 @@ The size of a file exceeded the maximum (about
bytes).
.It Er 28 ENOSPC Em "Device out of space" .
A
-.Xr write
+.Xr write 2
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 were available
@@ -210,7 +210,7 @@ created file failed because no more inodes were available
on the file system.
.It Er 29 ESPIPE Em "Illegal seek" .
An
-.Xr lseek
+.Xr lseek 2
function was issued on a socket, pipe or
.Tn FIFO .
.It Er 30 EROFS Em "Read-only file system" .
@@ -309,12 +309,12 @@ An operation on a socket or pipe was not performed because
the system lacked sufficient buffer space or because a queue was full.
.It Er 56 EISCONN Em "Socket is already connected" .
A
-.Xr connect
+.Xr connect 2
request was made on an already connected socket; or,
a
-.Xr sendto
+.Xr sendto 2
or
-.Xr sendmsg
+.Xr sendmsg 2
request on a connected socket specified a destination
when already connected.
.It Er 57 ENOTCONN Em "Socket is not connected" .
@@ -328,9 +328,9 @@ had already been shut down with a previous
call.
.It Er 60 ETIMEDOUT Em "Operation timed out" .
A
-.Xr connect
+.Xr connect 2
or
-.Xr send
+.Xr send 2
request failed because the connected party did not
properly respond after a period of time. (The timeout
period is dependent on the communication protocol.)
@@ -362,7 +362,7 @@ was supplied to a remove directory or rename call.
The quota system ran out of table entries.
.It Er 69 EDQUOT Em "Disc quota exceeded" .
A
-.Xr write
+.Xr write 2
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
@@ -417,7 +417,7 @@ A new process is created by a currently active process; (see
The parent process ID of a process is initially the process ID of its creator.
If the creating process exits,
the parent process ID of each child is set to the ID of a system process,
-.Xr init .
+.Xr init 8 .
.It Process Group
Each active process is a member of a process group that is identified by
a non-negative integer called the process group ID. This is the process
@@ -464,7 +464,7 @@ as the group,
but is in a different process group.
Note that when a process exits, the parent process for its children
is changed to be
-.Xr init ,
+.Xr init 8 ,
which is in a separate session.
Not all members of an orphaned process group are necessarily orphaned
processes (those whose creating process has exited).
@@ -523,7 +523,7 @@ process and is granted special privileges if its effective user ID is 0.
.It Special Processes
The processes with process IDs of 0, 1, and 2 are special.
Process 0 is the scheduler. Process 1 is the initialization process
-.Xr init ,
+.Xr init 8 ,
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.
diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2
index f5cdb298218..19de24c96c9 100644
--- a/lib/libc/sys/mmap.2
+++ b/lib/libc/sys/mmap.2
@@ -197,7 +197,7 @@ parameter wasn't available.
.Dv MAP_ANON
was specified and insufficient memory was available.
.Sh "SEE ALSO"
-.Xr getpagesize 2 ,
+.Xr getpagesize 3 ,
.Xr msync 2 ,
.Xr munmap 2 ,
.Xr mprotect 2 ,
diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2
index cf215d87d85..d676ad36885 100644
--- a/lib/libc/sys/open.2
+++ b/lib/libc/sys/open.2
@@ -138,7 +138,7 @@ When a new file is created it is given the group of the directory
which contains it.
.Pp
The new descriptor is set to remain open across
-.Xr execve
+.Xr execve 2
system calls; see
.Xr close 2
and
diff --git a/lib/libc/sys/rfork.2 b/lib/libc/sys/rfork.2
index 63ef078dd8e..a275557152b 100644
--- a/lib/libc/sys/rfork.2
+++ b/lib/libc/sys/rfork.2
@@ -83,7 +83,8 @@ will sleep, if necessary, until required process resources are available.
.Pp
.Fn Fork
can be implemented as a call to
-.Xr rfork "RFFDG|RFPROC"
+.Xr rfork 2
+"RFFDG|RFPROC"
but isn't for backwards compatibility.
.Sh ERRORS
.Fn Rfork
diff --git a/lib/libc/sys/sigaction.2 b/lib/libc/sys/sigaction.2
index 8d90440a2be..9984cc63260 100644
--- a/lib/libc/sys/sigaction.2
+++ b/lib/libc/sys/sigaction.2
@@ -43,10 +43,16 @@
.Fd #include <signal.h>
.Bd -literal
struct sigaction {
- void (*sa_handler)();
+ union { /* signal handler */
+ void (*__sa_handler) __P((int));
+ void (*__sa_sigaction) __P((int, siginfo_t *, void *));
+ } __sigaction_u;
sigset_t sa_mask;
int sa_flags;
};
+
+#define sa_handler __sigaction_u.__sa_handler
+#define sa_sigaction __sigaction_u.__sa_sigaction
.Ed
.Ft int
.Fn sigaction "int sig" "const struct sigaction *act" "struct sigaction *oact"
@@ -140,6 +146,14 @@ until another
call is made, or an
.Xr execve 2
is performed.
+The value of
+.Fa sa_handler
+(or, if the
+.Dv SA_SIGINFO
+flag is set, the value of
+.Fa sa_sigaction
+instead) indicates what action should be performed when a
+signal arrives.
A signal-specific default action may be reset by
setting
.Fa sa_handler
@@ -302,6 +316,14 @@ is set to indicated the reason.
.Sh EXAMPLE
The handler routine can be declared:
.Bd -literal -offset indent
+void handler(sig)
+int sig;
+int nothing; /* this will be NULL */
+struct sigcontext *scp;
+.Pp
+.Ed
+or if SA_SIGINFO is enabled,
+.Bd -literal -offset indent
void handler(sig, sip, scp)
int sig;
siginfo_t *sip;
@@ -322,7 +344,12 @@ as described in
.Pa <sys/siginfo.h> .
If
.Dv SA_SIGINFO
-is not set, this is NULL.
+is not set, this pointer will be NULL instead.
+The function specified in
+.Fa sa_sigaction
+will be called instead of the function specified by
+.Fa sa_handler
+(Note that in some implementations these are in fact the same).
.Fa Scp
is a pointer to the
.Fa sigcontext
diff --git a/lib/libc/sys/stat.2 b/lib/libc/sys/stat.2
index 6e6c2c435ef..a48f1f7f5ec 100644
--- a/lib/libc/sys/stat.2
+++ b/lib/libc/sys/stat.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: stat.2,v 1.4 1997/03/31 02:23:40 deraadt Exp $
+.\" $OpenBSD: stat.2,v 1.5 1997/06/13 10:08:36 deraadt Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@@ -80,7 +80,7 @@ size, blocks, and link count (always 1).
.Pp
The
.Fn fstat
-obtains the same information about an open file
+function obtains the same information about an open file
known by the file descriptor
.Fa fd .
.Pp
@@ -118,7 +118,7 @@ The time-related fields of
are as follows:
.Bl -tag -width XXXst_mtime
.It st_atime
-Time when file data last accessed.
+Time when file data was last accessed.
Changed by the
.Xr mknod 2 ,
.Xr utimes 2
@@ -126,7 +126,7 @@ and
.Xr read 2
system calls.
.It st_mtime
-Time when file data last modified.
+Time when file data was last modified.
Changed by the
.Xr mknod 2 ,
.Xr utimes 2
@@ -260,11 +260,11 @@ depend on the time stamps being contiguous (in calls to
.Sh SEE ALSO
.Xr chmod 2 ,
.Xr chown 2 ,
-.Xr utimes 2
+.Xr utimes 2 ,
.Xr symlink 7
.Sh BUGS
Applying
-.Xr fstat
+.Fn fstat
to a socket (and thus to a pipe)
returns a zero'd buffer,
except for the blocksize field,
diff --git a/lib/libc/sys/statfs.2 b/lib/libc/sys/statfs.2
index 5fb4dc054d7..0ae57e68c1f 100644
--- a/lib/libc/sys/statfs.2
+++ b/lib/libc/sys/statfs.2
@@ -52,7 +52,9 @@ returns information about a mounted file system.
.Fa Path
is the path name of any file within the mounted file system.
.Fa Buf
-is a pointer to a statfs structure defined as follows:
+is a pointer to a
+.Nm statfs
+structure defined as follows:
.Bd -literal
typedef struct { int32_t val[2]; } fsid_t;
diff --git a/lib/libc/sys/utimes.2 b/lib/libc/sys/utimes.2
index 52da6100139..7d7df5036c9 100644
--- a/lib/libc/sys/utimes.2
+++ b/lib/libc/sys/utimes.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: utimes.2,v 1.2 1996/05/01 11:08:27 deraadt Exp $
+.\" $OpenBSD: utimes.2,v 1.3 1997/06/13 10:08:37 deraadt Exp $
.\" $NetBSD: utimes.2,v 1.9 1996/04/23 10:34:16 mycroft Exp $
.\"
.\" Copyright (c) 1990, 1993
@@ -92,7 +92,7 @@ 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
+.Pa File
or
.Fa times
points outside the process's allocated address space.
diff --git a/lib/libc/sys/vfork.2 b/lib/libc/sys/vfork.2
index 06e201dfcf2..55e184b2954 100644
--- a/lib/libc/sys/vfork.2
+++ b/lib/libc/sys/vfork.2
@@ -50,10 +50,10 @@ space of the old process, which is horrendously inefficient in a paged
environment. It is useful when the purpose of
.Xr fork 2
would have been to create a new system context for an
-.Xr execve .
+.Xr execve 2 .
.Fn Vfork
differs from
-.Xr fork
+.Xr fork 2
in that the child borrows the parent's memory and thread of
control until a call to
.Xr execve 2
@@ -68,7 +68,7 @@ the parent's context.
.Pp
.Fn Vfork
can normally be used just like
-.Xr fork .
+.Xr fork 2 .
It does not work, however, to return while running in the childs context
from the procedure that called
.Fn vfork
@@ -76,36 +76,38 @@ since the eventual return from
.Fn vfork
would then return to a no longer existent stack frame.
Be careful, also, to call
-.Xr _exit
+.Xr _exit 2
rather than
-.Xr exit
+.Xr exit 3
if you can't
-.Xr execve ,
+.Xr execve 2 ,
since
-.Xr exit
+.Xr exit 3
will flush and close standard I/O channels, and thereby mess up the
parent processes standard I/O data structures.
(Even with
-.Xr fork
+.Xr fork 2
it is wrong to call
-.Xr exit
+.Xr exit 3
since buffered data would then be flushed twice.)
.Sh SEE ALSO
+.Xr _exit 2 ,
+.Xr exit 3 ,
.Xr fork 2 ,
.Xr execve 2 ,
.Xr sigaction 2 ,
.Xr wait 2 ,
.Sh DIAGNOSTICS
Same as for
-.Xr fork .
+.Xr fork 2 .
.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
-.Xr vfork
+.Xr vfork 2
as it will, in that case, be made synonymous to
-.Xr fork .
+.Xr fork 2 .
.Pp
To avoid a possible deadlock situation,
processes that are children in the middle
diff --git a/lib/libc/sys/wait.2 b/lib/libc/sys/wait.2
index d72a93dce4f..87556e0829c 100644
--- a/lib/libc/sys/wait.2
+++ b/lib/libc/sys/wait.2
@@ -158,7 +158,7 @@ One of the first three macros will evaluate to a non-zero (true) value:
True if the process terminated normally by a call to
.Xr _exit 2
or
-.Xr exit 2 .
+.Xr exit 3 .
.It Fn WIFSIGNALED status
True if the process terminated due to receipt of a signal.
.It Fn WIFSTOPPED status
@@ -180,7 +180,7 @@ is true, evaluates to the low-order 8 bits
of the argument passed to
.Xr _exit 2
or
-.Xr exit 2
+.Xr exit 3
by the child.
.It Fn WTERMSIG status
If
@@ -293,7 +293,8 @@ and the ability to restart a pending
.Fn wait
call are extensions to the POSIX interface.
.Sh SEE ALSO
-.Xr exit 2 ,
+.Xr _exit 2 ,
+.Xr exit 3 ,
.Xr sigaction 2
.Sh HISTORY
A