summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man2/accept.29
-rw-r--r--man2/close.25
-rw-r--r--man2/send.26
-rw-r--r--man2/setsid.25
-rw-r--r--man2/socket.26
-rw-r--r--man3/closedir.35
-rw-r--r--man3/initgroups.36
-rw-r--r--man3/mkstemp.37
-rw-r--r--man3/opendir.36
-rw-r--r--man3/readdir.33
-rw-r--r--man3/telldir.37
11 files changed, 48 insertions, 17 deletions
diff --git a/man2/accept.2 b/man2/accept.2
index c67f7a3f8..b1362e397 100644
--- a/man2/accept.2
+++ b/man2/accept.2
@@ -151,8 +151,13 @@ needs to have the
flag set (see
.BR socket (7)).
.SH "RETURN VALUE"
-The call returns \-1 on error. If it succeeds, it returns a non-negative
-integer that is a descriptor for the accepted socket.
+On success,
+.B accept
+returns a non-negative integer that is a descriptor
+for the accepted socket.
+On error, \-1 is returned, and
+.I errno
+is set appropriately.
.SH "ERROR HANDLING"
Linux
.B accept
diff --git a/man2/close.2 b/man2/close.2
index 8f59c0ef5..fecd71b56 100644
--- a/man2/close.2
+++ b/man2/close.2
@@ -58,7 +58,10 @@ removed using
the file is deleted.
.SH "RETURN VALUE"
.B close
-returns zero on success, or \-1 if an error occurred.
+returns zero on success.
+On error, \-1 is returned, and
+.I errno
+is set appropriately.
.SH ERRORS
.TP
.B EBADF
diff --git a/man2/send.2 b/man2/send.2
index f84d1b78c..6e5b9c8c2 100644
--- a/man2/send.2
+++ b/man2/send.2
@@ -243,8 +243,10 @@ sysctl; see
.\" msg_control* fields.
.\" The flags returned in msg_flags.
.SH "RETURN VALUE"
-The calls return the number of characters sent, or \-1
-if an error occurred.
+On success, these calls return the number of characters sent.
+On error, \-1 is returned, and
+.I errno
+is set appropriately.
.SH ERRORS
These are some standard errors generated by the socket layer. Additional errors
may be generated and returned from the underlying protocol modules; see their
diff --git a/man2/setsid.2 b/man2/setsid.2
index 269032d72..336360e8d 100644
--- a/man2/setsid.2
+++ b/man2/setsid.2
@@ -45,7 +45,10 @@ will be the only process in this new process group and in this new session.
.SH "RETURN VALUE"
The session ID of the calling process.
.SH ERRORS
-On error, \-1 will be returned. The only error which can happen is
+On error, \-1 is returned, and
+.I errno
+is set.
+The only error which can happen is
EPERM. It is returned when the process group ID of any process
equals the PID of the calling process. Thus, in particular,
.B setsid
diff --git a/man2/socket.2 b/man2/socket.2
index 225b77803..1aecd47dc 100644
--- a/man2/socket.2
+++ b/man2/socket.2
@@ -271,8 +271,10 @@ and
.BR getsockopt (2)
are used to set and get options, respectively.
.SH "RETURN VALUE"
-\-1 is returned if an error occurs; otherwise the return value is a
-descriptor referencing the socket.
+On success, a file descriptor for the new socket is returned.
+On error, \-1 is returned, and
+.I errno
+is set appropriately.
.SH ERRORS
.TP
.B EACCES
diff --git a/man3/closedir.3 b/man3/closedir.3
index dba5abbfc..0a191ed36 100644
--- a/man3/closedir.3
+++ b/man3/closedir.3
@@ -42,7 +42,10 @@ The \fBclosedir()\fP function closes the directory stream associated with
\fIdir\fP. The directory stream descriptor \fIdir\fP is not available
after this call.
.SH "RETURN VALUE"
-The \fBclosedir()\fP function returns 0 on success or \-1 on failure.
+The \fBclosedir()\fP function returns 0 on success.
+On error, \-1 is returned, and
+.I errno
+is set appropriately.
.SH ERRORS
.TP
.B EBADF
diff --git a/man3/initgroups.3 b/man3/initgroups.3
index 94f76a412..4b50201c8 100644
--- a/man3/initgroups.3
+++ b/man3/initgroups.3
@@ -47,8 +47,10 @@ The
.I user
argument must be non-NULL.
.SH "RETURN VALUE"
-The \fBinitgroups()\fP function returns 0 on success, or \-1 if an error
-occurs.
+The \fBinitgroups()\fP function returns 0 on success.
+On error, \-1 is returned, and
+.I errno
+is set appropriately.
.SH ERRORS
.TP
.B ENOMEM
diff --git a/man3/mkstemp.3 b/man3/mkstemp.3
index e4a5b8de8..03aebcb38 100644
--- a/man3/mkstemp.3
+++ b/man3/mkstemp.3
@@ -50,8 +50,11 @@ The file is opened with the O_EXCL flag, guaranteeing that when
.B mkstemp
returns successfully we are the only user.
.SH "RETURN VALUE"
-The \fBmkstemp()\fP function returns the file descriptor fd of the
-temporary file or \-1 on error.
+On success, the \fBmkstemp()\fP function returns the file descriptor
+of the temporary file.
+On error, \-1 is returned, and
+.I errno
+is set appropriately.
.SH ERRORS
.TP
.B EEXIST
diff --git a/man3/opendir.3 b/man3/opendir.3
index c67782706..0e67ceefe 100644
--- a/man3/opendir.3
+++ b/man3/opendir.3
@@ -42,8 +42,10 @@ The \fBopendir()\fP function opens a directory stream corresponding to the
directory \fIname\fP, and returns a pointer to the directory stream. The
stream is positioned at the first entry in the directory.
.SH "RETURN VALUE"
-The \fBopendir()\fP function returns a pointer to the directory stream or
-NULL if an error occurred.
+The \fBopendir()\fP function returns a pointer to the directory stream.
+On error, NULL is returned, and
+.I errno
+is set appropriately.
.SH ERRORS
.TP
.B EACCES
diff --git a/man3/readdir.3 b/man3/readdir.3
index 95ba9c3a6..13b3c040d 100644
--- a/man3/readdir.3
+++ b/man3/readdir.3
@@ -62,6 +62,9 @@ calls to \fBreaddir()\fP for the same directory stream.
.SH "RETURN VALUE"
The \fBreaddir()\fP function returns a pointer to a dirent structure, or
NULL if an error occurs or end-of-file is reached.
+On error,
+.I errno
+is set appropriately.
.SH ERRORS
.TP
.B EBADF
diff --git a/man3/telldir.3 b/man3/telldir.3
index 73f094120..a11e8335a 100644
--- a/man3/telldir.3
+++ b/man3/telldir.3
@@ -38,8 +38,11 @@ telldir \- return current location in directory stream
The \fBtelldir()\fP function returns the current location associated with
the directory stream \fIdir\fP.
.SH "RETURN VALUE"
-The \fBtelldir()\fP function returns the current location in the directory
-stream or \-1 if an error occurs.
+On success, the \fBtelldir()\fP function returns the current location
+in the directory stream.
+On error, \-1 is returned, and
+.I errno
+is set appropriately.
.SH ERRORS
.TP
.B EBADF