accept.2, access.2, getpriority.2, mlock.2: ERRORS: combine errors into a single list

These split out errors into separate lists (perhaps per API,
perhaps "may" vs "shall", perhaps "Linux-specific" vs
standard(??)), but there's no good reason to do this.  It makes
the error list harder to read, and is inconsistent with other
pages. So, combine the errors into a single list.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2021-08-18 00:35:06 +02:00
parent cfda555640
commit 18ce9c4a1b
4 changed files with 113 additions and 125 deletions

View File

@ -261,15 +261,11 @@ does not refer to a socket.
The referenced socket is not of type
.BR SOCK_STREAM .
.TP
.B EPROTO
Protocol error.
.PP
In addition, Linux
.BR accept ()
may fail if:
.TP
.B EPERM
Firewall rules forbid connection.
.TP
.B EPROTO
Protocol error.
.PP
In addition, network errors for the new socket and as defined
for the protocol may be returned.

View File

@ -218,10 +218,6 @@ and the file does not exist, or some other error occurred),
.I errno
is set to indicate the error.
.SH ERRORS
.BR access ()
and
.BR faccessat ()
shall fail if:
.TP
.B EACCES
The requested access would be denied to the file, or search permission
@ -230,6 +226,32 @@ is denied for one of the directories in the path prefix of
(See also
.BR path_resolution (7).)
.TP
.B EBADF
.RB ( faccessat ())
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
.RB ( faccessat ())
nor a valid file descriptor.
.TP
.B EFAULT
.I pathname
points outside your accessible address space.
.TP
.B EINVAL
.I mode
was incorrectly specified.
.TP
.B EINVAL
.RB ( faccessat ())
Invalid flag specified in
.IR flags .
.TP
.B EIO
An I/O error occurred.
.TP
.B ELOOP
Too many symbolic links were encountered in resolving
.IR pathname .
@ -243,57 +265,27 @@ A component of
.I pathname
does not exist or is a dangling symbolic link.
.TP
.B ENOMEM
Insufficient kernel memory was available.
.TP
.B ENOTDIR
A component used as a directory in
.I pathname
is not, in fact, a directory.
.TP
.B EROFS
Write permission was requested for a file on a read-only filesystem.
.PP
.BR access ()
and
.BR faccessat ()
may fail if:
.TP
.B EFAULT
.I pathname
points outside your accessible address space.
.TP
.B EINVAL
.I mode
was incorrectly specified.
.TP
.B EIO
An I/O error occurred.
.TP
.B ENOMEM
Insufficient kernel memory was available.
.TP
.B ETXTBSY
Write access was requested to an executable which is being
executed.
.PP
The following additional errors can occur for
.BR faccessat ():
.TP
.B EBADF
.I pathname
is relative but
.I dirfd
is neither
.B AT_FDCWD
nor a valid file descriptor.
.TP
.B EINVAL
Invalid flag specified in
.IR flags .
.TP
.B ENOTDIR
.RB ( faccessat ())
.I pathname
is relative and
.I dirfd
is a file descriptor referring to a file other than a directory.
.TP
.B EROFS
Write permission was requested for a file on a read-only filesystem.
.TP
.B ETXTBSY
Write access was requested to an executable which is being
executed.
.SH VERSIONS
.BR faccessat ()
was added to Linux in kernel 2.6.16;

View File

@ -142,6 +142,13 @@ On failure, it returns \-1 and sets
to indicate the error.
.SH ERRORS
.TP
.B EACCES
The caller attempted to set a lower nice value
(i.e., a higher process priority), but did not
have the required privilege (on Linux: did not have the
.B CAP_SYS_NICE
capability).
.TP
.B EINVAL
.I which
was not one of
@ -150,24 +157,6 @@ was not one of
or
.BR PRIO_USER .
.TP
.B ESRCH
No process was located using the
.I which
and
.I who
values specified.
.PP
In addition to the errors indicated above,
.BR setpriority ()
may fail if:
.TP
.B EACCES
The caller attempted to set a lower nice value
(i.e., a higher process priority), but did not
have the required privilege (on Linux: did not have the
.B CAP_SYS_NICE
capability).
.TP
.B EPERM
A process was located, but its effective user ID did not match
either the effective or the real user ID of the caller,
@ -175,6 +164,13 @@ and was not privileged (on Linux: did not have the
.B CAP_SYS_NICE
capability).
But see NOTES below.
.TP
.B ESRCH
No process was located using the
.I which
and
.I who
values specified.
.SH CONFORMING TO
POSIX.1-2001, POSIX.1-2008,
SVr4, 4.4BSD (these interfaces first appeared in 4.2BSD).

View File

@ -182,6 +182,64 @@ is set to indicate the error,
and no changes are made to any locks in the
address space of the process.
.SH ERRORS
.\"SVr4 documents an additional EAGAIN error code.
.TP
.B EAGAIN
.RB ( mlock (),
.BR mlock2 (),
and
.BR munlock ())
Some or all of the specified address range could not be locked.
.TP
.B EINVAL
.RB ( mlock (),
.BR mlock2 (),
and
.BR munlock ())
The result of the addition
.IR addr + len
was less than
.IR addr
(e.g., the addition may have resulted in an overflow).
.TP
.B EINVAL
.RB ( mlock2 ())
Unknown \fIflags\fP were specified.
.TP
.B EINVAL
.RB ( mlockall ())
Unknown \fIflags\fP were specified or
.B MCL_ONFAULT
was specified without either
.B MCL_FUTURE
or
.BR MCL_CURRENT .
.TP
.B EINVAL
(Not on Linux)
.I addr
was not a multiple of the page size.
.TP
.B ENOMEM
.RB ( mlock (),
.BR mlock2 (),
and
.BR munlock ())
Some of the specified address range does not correspond to mapped
pages in the address space of the process.
.TP
.B ENOMEM
.RB ( mlock (),
.BR mlock2 (),
and
.BR munlock ())
Locking or unlocking a region would result in the total number of
mappings with distinct attributes (e.g., locked versus unlocked)
exceeding the allowed maximum.
.\" I.e., the number of VMAs would exceed the 64kB maximum
(For example, unlocking a range in the middle of a currently locked
mapping would result in three mappings:
two locked mappings at each end and an unlocked mapping in the middle.)
.TP
.B ENOMEM
(Linux 2.6.9 and later) the caller had a nonzero
@ -207,63 +265,9 @@ half of RAM.
The caller is not privileged, but needs privilege
.RB ( CAP_IPC_LOCK )
to perform the requested operation.
.\"SVr4 documents an additional EAGAIN error code.
.PP
For
.BR mlock (),
.BR mlock2 (),
and
.BR munlock ():
.TP
.B EAGAIN
Some or all of the specified address range could not be locked.
.TP
.B EINVAL
The result of the addition
.IR addr + len
was less than
.IR addr
(e.g., the addition may have resulted in an overflow).
.TP
.B EINVAL
(Not on Linux)
.I addr
was not a multiple of the page size.
.TP
.B ENOMEM
Some of the specified address range does not correspond to mapped
pages in the address space of the process.
.TP
.B ENOMEM
Locking or unlocking a region would result in the total number of
mappings with distinct attributes (e.g., locked versus unlocked)
exceeding the allowed maximum.
.\" I.e., the number of VMAs would exceed the 64kB maximum
(For example, unlocking a range in the middle of a currently locked
mapping would result in three mappings:
two locked mappings at each end and an unlocked mapping in the middle.)
.PP
For
.BR mlock2 ():
.TP
.B EINVAL
Unknown \fIflags\fP were specified.
.PP
For
.BR mlockall ():
.TP
.B EINVAL
Unknown \fIflags\fP were specified or
.B MCL_ONFAULT
was specified without either
.B MCL_FUTURE
or
.BR MCL_CURRENT .
.PP
For
.BR munlockall ():
.TP
.B EPERM
.RB ( munlockall ())
(Linux 2.6.8 and earlier) The caller was not privileged
.RB ( CAP_IPC_LOCK ).
.SH VERSIONS