mirror of https://github.com/mkerrisk/man-pages
Automated addition of parentheses by add_parens_for_own_funcs.sh
This commit is contained in:
parent
ce9cb96e16
commit
e511ffb6bc
|
@ -48,7 +48,7 @@ access \- check user's permissions for a file
|
|||
.BI "int access(const char *" pathname ", int " mode );
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.B access
|
||||
.BR access ()
|
||||
checks whether the process would be allowed to read,
|
||||
write or test for existence of the file (or other file system
|
||||
object) whose name is
|
||||
|
@ -101,7 +101,7 @@ asked for a permission that is denied, or some other error occurred),
|
|||
.I errno
|
||||
is set appropriately.
|
||||
.SH ERRORS
|
||||
.B access
|
||||
.BR access ()
|
||||
shall fail if:
|
||||
.TP
|
||||
.B EACCES
|
||||
|
@ -133,7 +133,7 @@ is not, in fact, a directory.
|
|||
.B EROFS
|
||||
Write permission was requested for a file on a read-only filesystem.
|
||||
.PP
|
||||
.B access
|
||||
.BR access ()
|
||||
may fail if:
|
||||
.TP
|
||||
.B EFAULT
|
||||
|
@ -154,17 +154,17 @@ Insufficient kernel memory was available.
|
|||
Write access was requested to an executable which is being
|
||||
executed.
|
||||
.SH RESTRICTIONS
|
||||
.B access
|
||||
.BR access ()
|
||||
returns an error if any of the access types in the requested call
|
||||
fails, even if other types might be successful.
|
||||
.PP
|
||||
.B access
|
||||
.BR access ()
|
||||
may not work correctly on NFS file systems with UID mapping enabled,
|
||||
because UID mapping is done on the server and hidden from the client,
|
||||
which checks permissions.
|
||||
.PP
|
||||
Using
|
||||
.B access
|
||||
.BR access ()
|
||||
to check if a user is authorized to e.g. open a file before actually
|
||||
doing so using
|
||||
.BR open (2)
|
||||
|
|
|
@ -36,7 +36,7 @@ adjtimex \- tune kernel clock
|
|||
.SH DESCRIPTION
|
||||
Linux uses David L. Mills' clock adjustment algorithm (see RFC\ 1305).
|
||||
The system call
|
||||
.B adjtimex
|
||||
.BR adjtimex ()
|
||||
reads and optionally sets adjustment parameters for this algorithm.
|
||||
It takes a pointer to a
|
||||
.I timex
|
||||
|
@ -90,7 +90,7 @@ Only the superuser may set any parameters.
|
|||
.ne 12v
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B adjtimex
|
||||
.BR adjtimex ()
|
||||
returns the clock state:
|
||||
.PP
|
||||
.RS
|
||||
|
@ -105,7 +105,7 @@ returns the clock state:
|
|||
.RE
|
||||
.PP
|
||||
On failure,
|
||||
.B adjtimex
|
||||
.BR adjtimex ()
|
||||
returns \-1 and sets
|
||||
.IR errno .
|
||||
.SH ERRORS
|
||||
|
@ -138,7 +138,7 @@ Under Linux the
|
|||
.B CAP_SYS_TIME
|
||||
capability is required.
|
||||
.SH "CONFORMING TO"
|
||||
\fBadjtimex\fP is Linux specific and should not be used in programs
|
||||
\fBadjtimex\fP() is Linux specific and should not be used in programs
|
||||
intended to be portable. There is a similar but less general call
|
||||
\fBadjtime\fR in SVr4.
|
||||
.SH "SEE ALSO"
|
||||
|
|
|
@ -45,14 +45,14 @@ seconds.
|
|||
If
|
||||
.I seconds
|
||||
is zero, no new
|
||||
.B alarm
|
||||
.BR alarm ()
|
||||
is scheduled.
|
||||
|
||||
In any event any previously set
|
||||
.B alarm
|
||||
.BR alarm ()
|
||||
is cancelled.
|
||||
.SH "RETURN VALUE"
|
||||
.B alarm
|
||||
.BR alarm ()
|
||||
returns the number of seconds remaining until any previously scheduled
|
||||
alarm was due to be delivered, or zero if there was no previously
|
||||
scheduled alarm.
|
||||
|
|
|
@ -34,9 +34,9 @@ alloc_hugepages, free_hugepages \- allocate or free huge pages
|
|||
.\" asmlinkage int sys_free_hugepages(unsigned long addr);
|
||||
.SH DESCRIPTION
|
||||
The system calls
|
||||
.B alloc_hugepages
|
||||
.BR alloc_hugepages ()
|
||||
and
|
||||
.B free_hugepages
|
||||
.BR free_hugepages ()
|
||||
were introduced in Linux 2.5.36 and removed again in 2.5.54.
|
||||
They existed only on i386 and ia64 (when built with CONFIG_HUGETLB_PAGE).
|
||||
In Linux 2.4.20 the syscall numbers exist, but the calls return ENOSYS.
|
||||
|
@ -92,9 +92,9 @@ is returned when no segment with the given key exists.
|
|||
.IR
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B alloc_hugepages
|
||||
.BR alloc_hugepages ()
|
||||
returns the allocated virtual address, and
|
||||
.B free_hugepages
|
||||
.BR free_hugepages ()
|
||||
returns zero. On error, \-1 is returned, and
|
||||
.I errno
|
||||
is set appropriately.
|
||||
|
|
|
@ -32,7 +32,7 @@ arch_prctl \- set architecture specific thread state
|
|||
.BI "int arch_prctl(int code, unsigned long addr)"
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B arch_prctl
|
||||
.BR arch_prctl ()
|
||||
function sets architecture specific process or thread state.
|
||||
.I code
|
||||
selects a subfunction
|
||||
|
@ -87,7 +87,7 @@ an LDT with
|
|||
or using the
|
||||
.BR set_thread_area (2)
|
||||
system call in a 2.5 kernel.
|
||||
.B arch_prctl
|
||||
.BR arch_prctl ()
|
||||
is only needed when you want to set bases that are larger than 4GB.
|
||||
Memory in the first 2GB of address space can be allocated by using
|
||||
.BR mmap (2)
|
||||
|
|
|
@ -34,17 +34,17 @@ bdflush \- start, flush, or tune buffer-dirty-flush daemon
|
|||
.BI "int bdflush(int " func ", long " data );
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.B bdflush
|
||||
.BR bdflush ()
|
||||
starts, flushes, or tunes the buffer-dirty-flush daemon.
|
||||
Only a privileged process (one with the
|
||||
.B CAP_SYS_ADMIN
|
||||
capability) may call
|
||||
.BR bdflush .
|
||||
.BR bdflush ().
|
||||
.PP
|
||||
If
|
||||
.I func
|
||||
is negative or 0, and no daemon has been started, then
|
||||
.B bdflush
|
||||
.BR bdflush ()
|
||||
enters the daemon code and never returns.
|
||||
.PP
|
||||
If
|
||||
|
@ -77,7 +77,7 @@ are defined in the kernel source file
|
|||
If
|
||||
.I func
|
||||
is negative or 0 and the daemon successfully starts,
|
||||
.B bdflush
|
||||
.BR bdflush ()
|
||||
never returns.
|
||||
Otherwise, the return value is 0 on success and \-1 on failure, with
|
||||
.I errno
|
||||
|
@ -101,7 +101,7 @@ Caller does not have the
|
|||
.B CAP_SYS_ADMIN
|
||||
capability.
|
||||
.SH "CONFORMING TO"
|
||||
\fBbdflush\fP is Linux specific and should not be used in programs
|
||||
\fBbdflush\fP() is Linux specific and should not be used in programs
|
||||
intended to be portable.
|
||||
.SH "SEE ALSO"
|
||||
.BR fsync (2),
|
||||
|
|
12
man2/brk.2
12
man2/brk.2
|
@ -37,28 +37,28 @@ brk, sbrk \- change data segment size
|
|||
.sp
|
||||
.BI "void *sbrk(intptr_t " increment );
|
||||
.SH DESCRIPTION
|
||||
.B brk
|
||||
.BR brk ()
|
||||
sets the end of the data segment to the value specified by
|
||||
.IR end_data_segment ,
|
||||
when that value is reasonable, the system does have enough memory
|
||||
and the process does not exceed its max data size (see
|
||||
.BR setrlimit (2)).
|
||||
|
||||
.B sbrk
|
||||
.BR sbrk ()
|
||||
increments the program's data space by
|
||||
.I increment
|
||||
bytes.
|
||||
.B sbrk
|
||||
.BR sbrk ()
|
||||
isn't a system call, it is just a C library wrapper.
|
||||
Calling
|
||||
.B sbrk
|
||||
.BR sbrk ()
|
||||
with an increment of 0 can be used to find the current
|
||||
location of the program break.
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B brk
|
||||
.BR brk ()
|
||||
returns zero, and
|
||||
.B sbrk
|
||||
.BR sbrk ()
|
||||
returns a pointer to the start of the new area. On error, \-1 is returned,
|
||||
and
|
||||
.I errno
|
||||
|
|
|
@ -31,7 +31,7 @@ cacheflush \- flush contents of instruction and/or data cache
|
|||
.BI "int cacheflush(char *" addr ", int "nbytes ", int "cache );
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.B cacheflush
|
||||
.BR cacheflush ()
|
||||
flushes contents of indicated cache(s) for user addresses in the range
|
||||
addr to (addr+nbytes-1). Cache may be one of:
|
||||
.TP
|
||||
|
@ -46,7 +46,7 @@ Same as
|
|||
.BR (ICACHE|DCACHE) .
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
.B cacheflush
|
||||
.BR cacheflush ()
|
||||
returns 0 on success or \-1 on error. If errors are detected,
|
||||
errno will indicate the error.
|
||||
.SH ERRORS
|
||||
|
|
16
man2/chdir.2
16
man2/chdir.2
|
@ -40,13 +40,13 @@ chdir, fchdir \- change working directory
|
|||
.br
|
||||
.BI "int fchdir(int " fd );
|
||||
.SH DESCRIPTION
|
||||
.B chdir
|
||||
.BR chdir ()
|
||||
changes the current directory to that specified in
|
||||
.IR path .
|
||||
.PP
|
||||
.B fchdir
|
||||
.BR fchdir ()
|
||||
is identical to
|
||||
.BR chdir ;
|
||||
.BR chdir ();
|
||||
the only difference is that the directory is given as an
|
||||
open file descriptor.
|
||||
.SH "RETURN VALUE"
|
||||
|
@ -56,7 +56,7 @@ is set appropriately.
|
|||
.SH ERRORS
|
||||
Depending on the file system, other errors can be returned. The more
|
||||
general errors for
|
||||
.B chdir
|
||||
.BR chdir ()
|
||||
are listed below:
|
||||
.TP
|
||||
.B EACCES
|
||||
|
@ -92,7 +92,7 @@ A component of
|
|||
is not a directory.
|
||||
.PP
|
||||
The general errors for
|
||||
.B fchdir
|
||||
.BR fchdir ()
|
||||
are listed below:
|
||||
.TP
|
||||
.B EACCES
|
||||
|
@ -104,21 +104,21 @@ Search permission was denied on the directory open on
|
|||
is not a valid file descriptor.
|
||||
.SH NOTES
|
||||
The prototype for
|
||||
.B fchdir
|
||||
.BR fchdir ()
|
||||
is only available if
|
||||
.B _BSD_SOURCE
|
||||
is defined (either explicitly, or implicitly, by not defining
|
||||
_POSIX_SOURCE or compiling with the \-ansi flag).
|
||||
.SH "CONFORMING TO"
|
||||
The
|
||||
.B chdir
|
||||
.BR chdir ()
|
||||
call is compatible with SVr4, SVID, POSIX, X/OPEN, 4.4BSD. SVr4 documents
|
||||
additional EINTR, ENOLINK, and EMULTIHOP error conditions but has
|
||||
no ENOMEM. POSIX.1 does not have ENOMEM or ELOOP error conditions.
|
||||
X/OPEN does not have EFAULT, ENOMEM or EIO error conditions.
|
||||
|
||||
The
|
||||
.B fchdir
|
||||
.BR fchdir ()
|
||||
call is compatible with SVr4, 4.4BSD and X/OPEN.
|
||||
SVr4 documents additional EIO, EINTR, and ENOLINK error conditions.
|
||||
X/OPEN documents additional EINTR and EIO error conditions.
|
||||
|
|
10
man2/chmod.2
10
man2/chmod.2
|
@ -125,7 +125,7 @@ is set appropriately.
|
|||
.SH ERRORS
|
||||
Depending on the file system, other errors can be returned. The more
|
||||
general errors for
|
||||
.B chmod
|
||||
.BR chmod ()
|
||||
are listed below:
|
||||
|
||||
.TP
|
||||
|
@ -168,7 +168,7 @@ capability).
|
|||
The named file resides on a read-only file system.
|
||||
.PP
|
||||
The general errors for
|
||||
.B fchmod
|
||||
.BR fchmod ()
|
||||
are listed below:
|
||||
.TP
|
||||
.B EBADF
|
||||
|
@ -186,18 +186,18 @@ See above.
|
|||
See above.
|
||||
.SH "CONFORMING TO"
|
||||
The
|
||||
.B chmod
|
||||
.BR chmod ()
|
||||
call conforms to SVr4, SVID, POSIX, X/OPEN, 4.4BSD.
|
||||
SVr4 documents EINTR, ENOLINK and EMULTIHOP returns, but no
|
||||
ENOMEM. POSIX.1 does not document EFAULT, ENOMEM, ELOOP or EIO error
|
||||
conditions, or the macros \fBS_IREAD\fP, \fBS_IWRITE\fP and \fBS_IEXEC\fP.
|
||||
.PP
|
||||
The
|
||||
.B fchmod
|
||||
.BR fchmod ()
|
||||
call conforms to 4.4BSD and SVr4.
|
||||
SVr4 documents additional EINTR and ENOLINK error conditions.
|
||||
POSIX requires the
|
||||
.B fchmod
|
||||
.BR fchmod ()
|
||||
function if at least one of
|
||||
.B _POSIX_MAPPED_FILES
|
||||
and
|
||||
|
|
20
man2/chown.2
20
man2/chown.2
|
@ -83,7 +83,7 @@ is set appropriately.
|
|||
.SH ERRORS
|
||||
Depending on the file system, other errors can be returned. The more
|
||||
general errors for
|
||||
.B chown
|
||||
.BR chown ()
|
||||
are listed below.
|
||||
.TP
|
||||
.B EACCES
|
||||
|
@ -120,7 +120,7 @@ The calling process did not have the required permissions
|
|||
The named file resides on a read-only file system.
|
||||
.PP
|
||||
The general errors for
|
||||
.B fchown
|
||||
.BR fchown ()
|
||||
are listed below:
|
||||
.TP
|
||||
.B EBADF
|
||||
|
@ -139,36 +139,36 @@ See above.
|
|||
See above.
|
||||
.SH NOTES
|
||||
In versions of Linux prior to 2.1.81 (and distinct from 2.1.46),
|
||||
.B chown
|
||||
.BR chown ()
|
||||
did not follow symbolic links.
|
||||
Since Linux 2.1.81,
|
||||
.B chown
|
||||
.BR chown ()
|
||||
does follow symbolic links, and there is a new system call
|
||||
.B lchown
|
||||
.BR lchown ()
|
||||
that does not follow symbolic links.
|
||||
Since Linux 2.1.86, this new call (that has the same semantics
|
||||
as the old
|
||||
.BR chown )
|
||||
.BR chown ())
|
||||
has got the same syscall number, and
|
||||
.B chown
|
||||
.BR chown ()
|
||||
got the newly introduced number.
|
||||
.LP
|
||||
The prototype for
|
||||
.B fchown
|
||||
.BR fchown ()
|
||||
is only available if
|
||||
.B _BSD_SOURCE
|
||||
is defined (either explicitly, or implicitly, by not defining
|
||||
_POSIX_SOURCE or compiling with the \-ansi flag).
|
||||
.SH "CONFORMING TO"
|
||||
The
|
||||
.B chown
|
||||
.BR chown ()
|
||||
call conforms to SVr4, SVID, POSIX, X/OPEN. The 4.4BSD version can only be
|
||||
used by the superuser (that is, ordinary users cannot give away files).
|
||||
SVr4 documents EINVAL, EINTR, ENOLINK and EMULTIHOP returns, but no
|
||||
ENOMEM. POSIX.1 does not document ENOMEM or ELOOP error conditions.
|
||||
.PP
|
||||
The
|
||||
.B fchown
|
||||
.BR fchown ()
|
||||
call conforms to 4.4BSD and SVr4.
|
||||
SVr4 documents additional EINVAL, EIO, EINTR, and ENOLINK error conditions.
|
||||
.SH RESTRICTIONS
|
||||
|
|
|
@ -38,7 +38,7 @@ chroot \- change root directory
|
|||
.sp
|
||||
.BI "int chroot(const char *" path );
|
||||
.SH DESCRIPTION
|
||||
.B chroot
|
||||
.BR chroot ()
|
||||
changes the root directory to that specified in
|
||||
.IR path .
|
||||
This directory will be used for path names beginning with /. The root
|
||||
|
|
|
@ -54,7 +54,7 @@ creates a new process, in a manner similar to
|
|||
.BR clone ()
|
||||
is a library function layered on top
|
||||
of the underlying
|
||||
.BR clone
|
||||
.BR clone ()
|
||||
system call, hereinafter referred to as
|
||||
.BR sys_clone .
|
||||
A description of
|
||||
|
@ -254,7 +254,7 @@ It is not permitted to specify both
|
|||
and
|
||||
.B CLONE_FS
|
||||
in the same
|
||||
.BR clone
|
||||
.BR clone ()
|
||||
call.
|
||||
.TP
|
||||
.B CLONE_SIGHAND
|
||||
|
|
|
@ -87,7 +87,7 @@ serious programming error. It is quite possible that errors on a
|
|||
previous
|
||||
.BR write (2)
|
||||
operation are first reported at the final
|
||||
.BR close .
|
||||
.BR close ().
|
||||
Not checking the return value when closing the file may lead to
|
||||
silent loss of data. This can especially be observed with NFS
|
||||
and with disk quota.
|
||||
|
|
|
@ -36,7 +36,7 @@ fdatasync \- synchronize a file's in-core data with that on disk
|
|||
.sp
|
||||
.BI "int fdatasync(int " fd );
|
||||
.SH DESCRIPTION
|
||||
.B fdatasync
|
||||
.BR fdatasync ()
|
||||
flushes all data buffers of a file to disk (before the system
|
||||
call returns). It resembles
|
||||
.B fsync
|
||||
|
@ -52,7 +52,7 @@ will always initiate two write operations: one for the newly written
|
|||
data and another one in order to update the modification time stored
|
||||
in the inode. If the modification time is not a part of the transaction
|
||||
concept
|
||||
.B fdatasync
|
||||
.BR fdatasync ()
|
||||
can be used to avoid unnecessary inode disk write operations.
|
||||
.SH "RETURN VALUE"
|
||||
On success, zero is returned. On error, \-1 is returned, and
|
||||
|
@ -72,12 +72,12 @@ An error occurred during synchronization.
|
|||
is bound to a special file which does not support synchronization.
|
||||
.SH BUGS
|
||||
Currently (Linux 2.2)
|
||||
.B fdatasync
|
||||
.BR fdatasync ()
|
||||
is equivalent to
|
||||
.BR fsync .
|
||||
.SH AVAILABILITY
|
||||
On POSIX systems on which
|
||||
.B fdatasync
|
||||
.BR fdatasync ()
|
||||
is available,
|
||||
.B _POSIX_SYNCHRONIZED_IO
|
||||
is defined in <unistd.h> to a value greater than 0. (See also
|
||||
|
|
10
man2/fork.2
10
man2/fork.2
|
@ -41,13 +41,13 @@ fork \- create a child process
|
|||
.sp
|
||||
.B pid_t fork(void);
|
||||
.SH DESCRIPTION
|
||||
.B fork
|
||||
.BR fork ()
|
||||
creates a child process that differs from the parent process only in its
|
||||
PID and PPID, and in the fact that resource utilizations are set to 0.
|
||||
File locks and pending signals are not inherited.
|
||||
.PP
|
||||
Under Linux,
|
||||
.B fork
|
||||
.BR fork ()
|
||||
is implemented using copy-on-write pages, so the only penalty incurred by
|
||||
fork is the time and memory required to duplicate the parent's page tables,
|
||||
and to create a unique task structure for the child.
|
||||
|
@ -61,7 +61,7 @@ will be set appropriately.
|
|||
.SH ERRORS
|
||||
.TP
|
||||
.B EAGAIN
|
||||
.B fork
|
||||
.BR fork ()
|
||||
cannot allocate sufficient memory to copy the parent's page tables and
|
||||
allocate a task structure for the child.
|
||||
.TP
|
||||
|
@ -76,11 +76,11 @@ or the
|
|||
capability.
|
||||
.TP
|
||||
.B ENOMEM
|
||||
.B fork
|
||||
.BR fork ()
|
||||
failed to allocate the necessary kernel structures because memory is tight.
|
||||
.SH "CONFORMING TO"
|
||||
The
|
||||
.B fork
|
||||
.BR fork ()
|
||||
call conforms to SVr4, SVID, POSIX, X/OPEN, 4.3BSD.
|
||||
.SH "SEE ALSO"
|
||||
.BR clone (2),
|
||||
|
|
14
man2/fsync.2
14
man2/fsync.2
|
@ -42,18 +42,18 @@ fsync, fdatasync \- synchronize a file's complete in-core state with that on dis
|
|||
.sp
|
||||
.BI "int fdatasync(int " fd );
|
||||
.SH DESCRIPTION
|
||||
.B fsync
|
||||
.BR fsync ()
|
||||
copies all in-core parts of a file to disk, and waits until the
|
||||
device reports that all parts are on stable storage.
|
||||
It also updates metadata stat information. It does not necessarily ensure
|
||||
that the entry in the directory containing the file has also reached disk.
|
||||
For that an explicit
|
||||
.B fsync
|
||||
.BR fsync ()
|
||||
on the file descriptor of the directory is also needed.
|
||||
|
||||
.B fdatasync
|
||||
.BR fdatasync ()
|
||||
does the same as
|
||||
.B fsync
|
||||
.BR fsync ()
|
||||
but only flushes user data, not the meta data like the st_atime or
|
||||
st_mtime
|
||||
(respectively, time of last access and
|
||||
|
@ -78,7 +78,7 @@ is bound to a special file which does not support synchronization.
|
|||
.SH NOTES
|
||||
In case the hard disk has write cache enabled,
|
||||
the data may not really be on permanent storage when
|
||||
.BR fsync / fdatasync
|
||||
.BR fsync ()/ fdatasync
|
||||
return.
|
||||
.\" See
|
||||
.\" .BR hdparm (8)
|
||||
|
@ -87,10 +87,10 @@ return.
|
|||
When an ext2 file system is mounted with the
|
||||
.I sync
|
||||
option, directory entries are also implicitly synced by
|
||||
.BR fsync .
|
||||
.BR fsync ().
|
||||
.LP
|
||||
On kernels before 2.4,
|
||||
.B fsync
|
||||
.BR fsync ()
|
||||
on big files can be inefficient.
|
||||
An alternative might be to use the
|
||||
.I O_SYNC
|
||||
|
|
|
@ -22,14 +22,14 @@ futex \- Fast Userspace Locking system call
|
|||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
The
|
||||
.B futex
|
||||
.BR futex ()
|
||||
system call provides a method for
|
||||
a program to wait for a value at a given address to change, and a
|
||||
method to wake up anyone waiting on a particular address (while the
|
||||
addresses for the same memory in separate processes may not be
|
||||
equal, the kernel maps them internally so the same memory mapped in
|
||||
different locations will correspond for
|
||||
.B futex
|
||||
.BR futex ()
|
||||
calls). It is typically used to
|
||||
implement the contended case of a lock in shared memory, as
|
||||
described in
|
||||
|
|
|
@ -14,7 +14,7 @@ get_thread_area \- Get a Thread Local Storage (TLS) area
|
|||
.BI "int get_thread_area (struct user_desc *" u_info );
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
.B get_thread_area
|
||||
.BR get_thread_area ()
|
||||
returns an entry in the current thread's Thread Local Storage (TLS) array.
|
||||
The index of the entry corresponds to the value
|
||||
of \fIu_info->\fR\fIentry_number\fR, passed in by the user.
|
||||
|
@ -22,7 +22,7 @@ If the value is in bounds, \fBget_thread_info\fR copies the corresponding
|
|||
TLS entry into the area pointed to by \fIu_info\fR.
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
.B get_thread_area
|
||||
.BR get_thread_area ()
|
||||
returns 0 on success.
|
||||
Otherwise, it returns \-1 and sets
|
||||
.I errno
|
||||
|
@ -36,13 +36,13 @@ appropriately.
|
|||
.B EINVAL
|
||||
\fIu_info->\fR\fIentry_number\fR is out of bounds.
|
||||
.SH "CONFORMING TO"
|
||||
.B get_thread_area
|
||||
.BR get_thread_area ()
|
||||
is Linux specific and should not be used in programs
|
||||
that are intended to be portable.
|
||||
|
||||
.SH AVAILABILITY
|
||||
A version of
|
||||
.B get_thread_area
|
||||
.BR get_thread_area ()
|
||||
first appeared in Linux 2.5.32.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
|
|
|
@ -47,7 +47,7 @@ for the POSIX conforming C library interface.
|
|||
This page documents the bare kernel system call interface.
|
||||
.PP
|
||||
The system call
|
||||
.B getdents
|
||||
.BR getdents ()
|
||||
reads several
|
||||
.I dirent
|
||||
structures from the directory
|
||||
|
|
|
@ -38,7 +38,7 @@ getdomainname, setdomainname \- get/set domain name
|
|||
These functions are used to access or to change the domain name of the
|
||||
current processor.
|
||||
If the NUL-terminated domain name requires more than \fIlen\fP bytes,
|
||||
.B getdomainname
|
||||
.BR getdomainname ()
|
||||
returns the first \fIlen\fP bytes (glibc) or returns an error (libc).
|
||||
.SH "RETURN VALUE"
|
||||
On success, zero is returned. On error, \-1 is returned, and
|
||||
|
@ -48,13 +48,13 @@ is set appropriately.
|
|||
.TP
|
||||
.B EFAULT
|
||||
For
|
||||
.BR setdomainname :
|
||||
.BR setdomainname ():
|
||||
.I name
|
||||
pointed outside of user address space.
|
||||
.TP
|
||||
.B EINVAL
|
||||
For
|
||||
.BR getdomainname
|
||||
.BR getdomainname ()
|
||||
under libc:
|
||||
.I name
|
||||
is
|
||||
|
@ -67,13 +67,13 @@ bytes.
|
|||
.TP
|
||||
.B EINVAL
|
||||
For
|
||||
.BR setdomainname :
|
||||
.BR setdomainname ():
|
||||
.I len
|
||||
was negative or too large.
|
||||
.TP
|
||||
.B EPERM
|
||||
For
|
||||
.BR setdomainname :
|
||||
.BR setdomainname ():
|
||||
the caller is unprivileged (Linux: does not have the
|
||||
.B CAP_SYS_ADMIN
|
||||
capability).
|
||||
|
|
|
@ -32,13 +32,13 @@ getdtablesize \- get descriptor table size
|
|||
.sp
|
||||
.B int getdtablesize(void);
|
||||
.SH DESCRIPTION
|
||||
.B getdtablesize
|
||||
.BR getdtablesize ()
|
||||
returns the maximum number of files a process can have open,
|
||||
one more than the largest possible value for a file descriptor.
|
||||
.SH "RETURN VALUE"
|
||||
The current limit on the number of open files per process.
|
||||
.SH NOTES
|
||||
.B getdtablesize
|
||||
.BR getdtablesize ()
|
||||
is implemented as a libc library function. The glibc version calls
|
||||
.BR getrlimit (2)
|
||||
and returns the current
|
||||
|
@ -51,7 +51,7 @@ The libc4 and libc5 versions return
|
|||
(set to 256 since Linux 0.98.4).
|
||||
.SH "CONFORMING TO"
|
||||
SVr4, 4.4BSD (the
|
||||
.B getdtablesize
|
||||
.BR getdtablesize ()
|
||||
function first appeared in 4.2BSD).
|
||||
.SH "SEE ALSO"
|
||||
.BR close (2),
|
||||
|
|
|
@ -34,10 +34,10 @@ getgid, getegid \- get group identity
|
|||
.br
|
||||
.B gid_t getegid(void);
|
||||
.SH DESCRIPTION
|
||||
.B getgid
|
||||
.BR getgid ()
|
||||
returns the real group ID of the current process.
|
||||
|
||||
.B getegid
|
||||
.BR getegid ()
|
||||
returns the effective group ID of the current process.
|
||||
.SH ERRORS
|
||||
These functions are always successful.
|
||||
|
|
|
@ -41,7 +41,7 @@ getgroups, setgroups \- get/set list of supplementary group IDs
|
|||
.BI "int setgroups(size_t " size ", const gid_t *" list );
|
||||
.SH DESCRIPTION
|
||||
.TP
|
||||
.B getgroups
|
||||
.BR getgroups ()
|
||||
Up to
|
||||
.I size
|
||||
supplementary group IDs (of the calling process) are returned in
|
||||
|
@ -57,20 +57,20 @@ is zero,
|
|||
is not modified, but the total number of supplementary group IDs for the
|
||||
process is returned.
|
||||
.TP
|
||||
.B setgroups
|
||||
.BR setgroups ()
|
||||
Sets the supplementary group IDs for the process.
|
||||
Appropriate privileges (Linux: the
|
||||
.B CAP_SETGID
|
||||
capability) are required.
|
||||
.SH "RETURN VALUE"
|
||||
.TP
|
||||
.B getgroups
|
||||
.BR getgroups ()
|
||||
On success, the number of supplementary group IDs is returned.
|
||||
On error, \-1 is returned, and
|
||||
.I errno
|
||||
is set appropriately.
|
||||
.TP
|
||||
.B setgroups
|
||||
.BR setgroups ()
|
||||
On success, zero is returned. On error, \-1 is returned, and
|
||||
.I errno
|
||||
is set appropriately.
|
||||
|
@ -82,24 +82,24 @@ has an invalid address.
|
|||
.TP
|
||||
.B EINVAL
|
||||
For
|
||||
.BR setgroups ,
|
||||
.BR setgroups (),
|
||||
.I size
|
||||
is greater than
|
||||
.B NGROUPS
|
||||
(32 for Linux 2.0.32).
|
||||
For
|
||||
.BR getgroups ,
|
||||
.BR getgroups (),
|
||||
.I size
|
||||
is less than the number of supplementary group IDs, but is not zero.
|
||||
.TP
|
||||
.B EPERM
|
||||
The calling process has insufficient privilege to call
|
||||
.BR setgroups .
|
||||
.BR setgroups ().
|
||||
.SH NOTES
|
||||
A process can have up to at least NGROUPS_MAX supplementary group IDs
|
||||
in addition to the effective group ID. The set of supplementary group IDs
|
||||
is inherited from the parent process and may be changed using
|
||||
.BR setgroups .
|
||||
.BR setgroups ().
|
||||
The maximum number of supplementary group IDs can be found using
|
||||
.BR sysconf (3):
|
||||
.nf
|
||||
|
@ -107,11 +107,11 @@ The maximum number of supplementary group IDs can be found using
|
|||
ngroups_max = sysconf(_SC_NGROUPS_MAX);
|
||||
.fi
|
||||
The maximal return value of
|
||||
.B getgroups
|
||||
.BR getgroups ()
|
||||
cannot be larger than one more than the value obtained this way.
|
||||
.LP
|
||||
The prototype for
|
||||
.B setgroups
|
||||
.BR setgroups ()
|
||||
is only available if
|
||||
.B _BSD_SOURCE
|
||||
is defined (either explicitly, or implicitly, by not defining
|
||||
|
@ -119,9 +119,9 @@ _POSIX_SOURCE or compiling with the \-ansi flag).
|
|||
.SH "CONFORMING TO"
|
||||
SVr4, SVID (issue 4 only; these calls were not present in SVr3),
|
||||
X/OPEN, 4.3BSD. The
|
||||
.B getgroups
|
||||
.BR getgroups ()
|
||||
function is in POSIX.1. Since
|
||||
.B setgroups
|
||||
.BR setgroups ()
|
||||
requires privilege, it is not covered by POSIX.1.
|
||||
.SH "SEE ALSO"
|
||||
.BR getgid (2),
|
||||
|
|
|
@ -44,7 +44,7 @@ machine, as returned by
|
|||
and thus usually never needs to be set.
|
||||
|
||||
The
|
||||
.B sethostid
|
||||
.BR sethostid ()
|
||||
call is restricted to the superuser.
|
||||
|
||||
The
|
||||
|
@ -52,16 +52,16 @@ The
|
|||
argument is stored in the file
|
||||
.IR /etc/hostid .
|
||||
.SH "RETURN VALUE"
|
||||
.B gethostid
|
||||
.BR gethostid ()
|
||||
returns the 32-bit identifier for the current host as set by
|
||||
.BR sethostid (2).
|
||||
.SH "CONFORMING TO"
|
||||
4.2BSD. These functions were dropped in 4.4BSD.
|
||||
POSIX.1 does not define these functions, but ISO/IEC 9945-1:1990 mentions
|
||||
them in B.4.4.1. SVr4 includes
|
||||
.B gethostid
|
||||
.BR gethostid ()
|
||||
but not
|
||||
.BR sethostid .
|
||||
.BR sethostid ().
|
||||
.SH FILES
|
||||
.I /etc/hostid
|
||||
.SH "SEE ALSO"
|
||||
|
|
|
@ -61,11 +61,11 @@ is an invalid address.
|
|||
.B EINVAL
|
||||
.I len
|
||||
is negative or, for
|
||||
.BR sethostname ,
|
||||
.BR sethostname (),
|
||||
.I len
|
||||
is larger than the maximum allowed size,
|
||||
or, for
|
||||
.BR gethostname
|
||||
.BR gethostname ()
|
||||
on Linux/i386,
|
||||
.I len
|
||||
is smaller than the actual size.
|
||||
|
@ -73,19 +73,19 @@ is smaller than the actual size.
|
|||
.TP
|
||||
.B EPERM
|
||||
For
|
||||
.BR sethostname ,
|
||||
.BR sethostname (),
|
||||
the caller did not have the
|
||||
.B CAP_SYS_ADMIN
|
||||
capability.
|
||||
.SH "CONFORMING TO"
|
||||
SVr4, 4.4BSD (this function first appeared in 4.2BSD).
|
||||
POSIX 1003.1-2001 specifies
|
||||
.B gethostname
|
||||
.BR gethostname ()
|
||||
but not
|
||||
.BR sethostname .
|
||||
.BR sethostname ().
|
||||
.SH BUGS
|
||||
For many Linux kernel / libc combinations
|
||||
.B gethostname
|
||||
.BR gethostname ()
|
||||
will return an error instead of returning a truncated hostname.
|
||||
.SH NOTES
|
||||
SUSv2 guarantees that `Host names are limited to 255 bytes'.
|
||||
|
|
|
@ -85,11 +85,11 @@ The argument
|
|||
is a file, not a socket.
|
||||
.SH "CONFORMING TO"
|
||||
SVr4, 4.4BSD (the
|
||||
.B getpeername
|
||||
.BR getpeername ()
|
||||
function call first appeared in 4.2BSD).
|
||||
.SH NOTE
|
||||
The third argument of
|
||||
.B getpeername
|
||||
.BR getpeername ()
|
||||
is in reality an `int *' (and this is what 4.x BSD and libc4 and libc5 have).
|
||||
Some POSIX confusion resulted in the present socklen_t, also used by glibc.
|
||||
See also
|
||||
|
|
|
@ -32,11 +32,11 @@ getpid, getppid \- get process identification
|
|||
.br
|
||||
.B pid_t getppid(void);
|
||||
.SH DESCRIPTION
|
||||
.B getpid
|
||||
.BR getpid ()
|
||||
returns the process ID of the current process. (This is often used by
|
||||
routines that generate unique temporary file names.)
|
||||
|
||||
.B getppid
|
||||
.BR getppid ()
|
||||
returns the process ID of the parent of the current process.
|
||||
.SH "CONFORMING TO"
|
||||
POSIX, 4.3BSD, SVID
|
||||
|
|
|
@ -58,9 +58,9 @@ indicated by
|
|||
and
|
||||
.I who
|
||||
is obtained with the
|
||||
.B getpriority
|
||||
.BR getpriority ()
|
||||
call and set with the
|
||||
.B setpriority
|
||||
.BR setpriority ()
|
||||
call.
|
||||
|
||||
The value
|
||||
|
@ -91,15 +91,15 @@ The default priority is 0;
|
|||
lower priorities cause more favorable scheduling.
|
||||
|
||||
The
|
||||
.B getpriority
|
||||
.BR getpriority ()
|
||||
call returns the highest priority (lowest numerical value)
|
||||
enjoyed by any of the specified processes. The
|
||||
.B setpriority
|
||||
.BR setpriority ()
|
||||
call sets the priorities of all of the specified processes
|
||||
to the specified value. Only the superuser may lower priorities.
|
||||
.SH "RETURN VALUE"
|
||||
Since
|
||||
.B getpriority
|
||||
.BR getpriority ()
|
||||
can legitimately return the value \-1, it is necessary
|
||||
to clear the external variable
|
||||
.I errno
|
||||
|
@ -107,7 +107,7 @@ prior to the
|
|||
call, then check it afterwards to determine
|
||||
if a \-1 is an error or a legitimate value.
|
||||
The
|
||||
.B setpriority
|
||||
.BR setpriority ()
|
||||
call returns 0 if there is no error, or
|
||||
\-1 if there is.
|
||||
.SH ERRORS
|
||||
|
@ -128,7 +128,7 @@ and
|
|||
values specified.
|
||||
.PP
|
||||
In addition to the errors indicated above,
|
||||
.B setpriority
|
||||
.BR setpriority ()
|
||||
may fail if:
|
||||
.TP
|
||||
.B EPERM
|
||||
|
@ -171,9 +171,9 @@ Within the kernel, nice values are actually represented
|
|||
using the corresponding range 40..1
|
||||
(since negative numbers are error codes) and these are the values
|
||||
employed by the
|
||||
.B setpriority
|
||||
.BR setpriority ()
|
||||
and
|
||||
.B getpriority
|
||||
.BR getpriority ()
|
||||
system calls.
|
||||
The glibc wrapper functions for these system calls handle the
|
||||
translations between the user-land and kernel representations
|
||||
|
|
|
@ -35,9 +35,9 @@ getresuid, getresgid \- get real, effective and saved user or group ID
|
|||
.br
|
||||
.BI "int getresgid(gid_t *" rgid ", gid_t *" egid ", gid_t *" sgid );
|
||||
.SH DESCRIPTION
|
||||
.B getresuid
|
||||
.BR getresuid ()
|
||||
and
|
||||
.B getresgid
|
||||
.BR getresgid ()
|
||||
(both introduced in Linux 2.1.44)
|
||||
get the real UID, effective UID, and saved set-user-ID (resp. group ID's)
|
||||
of the current process.
|
||||
|
|
|
@ -82,12 +82,12 @@ The argument
|
|||
is a file, not a socket.
|
||||
.SH "CONFORMING TO"
|
||||
SVr4, 4.4BSD (the
|
||||
.B getsockname
|
||||
.BR getsockname ()
|
||||
function call appeared in 4.2BSD). SVr4 documents additional ENOMEM
|
||||
and ENOSR error codes.
|
||||
.SH NOTE
|
||||
The third argument of
|
||||
.B getsockname
|
||||
.BR getsockname ()
|
||||
is in reality an `int *' (and this is what 4.x BSD and libc4 and libc5 have).
|
||||
Some POSIX confusion resulted in the present socklen_t, also used by glibc.
|
||||
See also
|
||||
|
|
|
@ -55,7 +55,7 @@ getsockopt, setsockopt \- get and set options on sockets
|
|||
.SH DESCRIPTION
|
||||
.B Getsockopt
|
||||
and
|
||||
.B setsockopt
|
||||
.BR setsockopt ()
|
||||
manipulate the
|
||||
.I options
|
||||
associated with a socket. Options may exist at multiple
|
||||
|
@ -86,12 +86,12 @@ The parameters
|
|||
and
|
||||
.I optlen
|
||||
are used to access option values for
|
||||
.BR setsockopt .
|
||||
.BR setsockopt ().
|
||||
For
|
||||
.B getsockopt
|
||||
.BR getsockopt ()
|
||||
they identify a buffer in which the value for the
|
||||
requested option(s) are to be returned. For
|
||||
.BR getsockopt ,
|
||||
.BR getsockopt (),
|
||||
.I optlen
|
||||
is a value-result parameter, initially containing the
|
||||
size of the buffer pointed to by
|
||||
|
@ -115,7 +115,7 @@ Most socket-level options utilize an
|
|||
parameter for
|
||||
.IR optval .
|
||||
For
|
||||
.BR setsockopt ,
|
||||
.BR setsockopt (),
|
||||
the parameter should be non-zero to enable a boolean option, or zero if the
|
||||
option is to be disabled.
|
||||
|
||||
|
@ -139,7 +139,7 @@ is not a valid descriptor.
|
|||
The address pointed to by
|
||||
.I optval
|
||||
is not in a valid part of the process address space. For
|
||||
.BR getsockopt ,
|
||||
.BR getsockopt (),
|
||||
this error may also be returned if
|
||||
.I optlen
|
||||
is not in a valid part of the process address space.
|
||||
|
|
|
@ -35,7 +35,7 @@ gettid \- get thread identification
|
|||
.sp
|
||||
.B pid_t gettid(void);
|
||||
.SH DESCRIPTION
|
||||
\fBgettid\fP returns the thread ID of the current process. This is equal
|
||||
\fBgettid\fP() returns the thread ID of the current process. This is equal
|
||||
to the process ID (as returned by
|
||||
.BR getpid (2)),
|
||||
unless the process is part of a thread group (created by specifying
|
||||
|
@ -48,7 +48,7 @@ On success, returns the thread ID of the current process.
|
|||
.SH ERRORS
|
||||
This call is always successful.
|
||||
.SH "CONFORMING TO"
|
||||
\fBgettid\fP is Linux specific and should not be used in programs that
|
||||
\fBgettid\fP() is Linux specific and should not be used in programs that
|
||||
are intended to be portable.
|
||||
.SH "SEE ALSO"
|
||||
.BR clone (2),
|
||||
|
|
|
@ -49,9 +49,9 @@ gettimeofday, settimeofday \- get / set time
|
|||
.BI ", const struct timezone *" tz );
|
||||
.SH DESCRIPTION
|
||||
The functions
|
||||
.B gettimeofday
|
||||
.BR gettimeofday ()
|
||||
and
|
||||
.B settimeofday
|
||||
.BR settimeofday ()
|
||||
can get and set the time as well as a timezone.
|
||||
The
|
||||
.I tv
|
||||
|
@ -131,14 +131,14 @@ by a simple algorithm, one per country; indeed,
|
|||
this period is determined by unpredictable political
|
||||
decisions. So this method of representing time zones
|
||||
has been abandoned. Under Linux, in a call to
|
||||
.B settimeofday
|
||||
.BR settimeofday ()
|
||||
the
|
||||
.I tz_dsttime
|
||||
field should be zero.
|
||||
.PP
|
||||
Under Linux there is some peculiar `warp clock' semantics associated
|
||||
to the
|
||||
.B settimeofday
|
||||
.BR settimeofday ()
|
||||
system call if on the very first call (after booting)
|
||||
that has a non-NULL
|
||||
.I tz
|
||||
|
@ -175,11 +175,11 @@ or
|
|||
is null, the corresponding structure is not set or returned.
|
||||
.PP
|
||||
Only the superuser may use
|
||||
.BR settimeofday .
|
||||
.BR settimeofday ().
|
||||
.SH "RETURN VALUE"
|
||||
.B gettimeofday
|
||||
.BR gettimeofday ()
|
||||
and
|
||||
.B settimeofday
|
||||
.BR settimeofday ()
|
||||
return 0 for success, or \-1 for failure (in which case
|
||||
.I errno
|
||||
is set appropriately).
|
||||
|
@ -197,13 +197,13 @@ Timezone (or something else) is invalid.
|
|||
.TP
|
||||
.B EPERM
|
||||
The calling process has insufficient privilege to call
|
||||
.BR settimeofday ;
|
||||
.BR settimeofday ();
|
||||
under Linux the
|
||||
.B CAP_SYS_TIME
|
||||
capability is required.
|
||||
.SH NOTE
|
||||
The prototype for
|
||||
.B settimeofday
|
||||
.BR settimeofday ()
|
||||
and the defines for
|
||||
.BR timercmp ,
|
||||
.BR timerisset ,
|
||||
|
|
|
@ -35,10 +35,10 @@ getuid, geteuid \- get user identity
|
|||
.br
|
||||
.B uid_t geteuid(void);
|
||||
.SH DESCRIPTION
|
||||
.B getuid
|
||||
.BR getuid ()
|
||||
returns the real user ID of the current process.
|
||||
|
||||
.B geteuid
|
||||
.BR geteuid ()
|
||||
returns the effective user ID of the current process.
|
||||
.SH ERRORS
|
||||
These functions are always successful.
|
||||
|
|
|
@ -53,7 +53,7 @@ data).
|
|||
A complete overview of extended attributes concepts can be found in
|
||||
.BR attr (5).
|
||||
.PP
|
||||
.B getxattr
|
||||
.BR getxattr ()
|
||||
retrieves the
|
||||
.I value
|
||||
of the extended attribute identified by
|
||||
|
@ -65,15 +65,15 @@ The length of the attribute
|
|||
.I value
|
||||
is returned.
|
||||
.PP
|
||||
.B lgetxattr
|
||||
.BR lgetxattr ()
|
||||
is identical to
|
||||
.BR getxattr ,
|
||||
.BR getxattr (),
|
||||
except in the case of a symbolic link, where the link itself is
|
||||
interrogated, not the file that it refers to.
|
||||
.PP
|
||||
.B fgetxattr
|
||||
.BR fgetxattr ()
|
||||
is identical to
|
||||
.BR getxattr ,
|
||||
.BR getxattr (),
|
||||
only the open file pointed to by
|
||||
.I filedes
|
||||
(as returned by
|
||||
|
|
|
@ -37,20 +37,20 @@ idle \- make process 0 idle
|
|||
.sp
|
||||
.B int idle(void);
|
||||
.SH DESCRIPTION
|
||||
.B idle
|
||||
.BR idle ()
|
||||
is an internal system call used during bootstrap.
|
||||
It marks the process's pages as swappable, lowers its priority,
|
||||
and enters the main scheduling loop.
|
||||
.B idle
|
||||
.BR idle ()
|
||||
never returns.
|
||||
.PP
|
||||
Only process 0 may call
|
||||
.BR idle .
|
||||
.BR idle ().
|
||||
Any user process, even a process with superuser permission,
|
||||
will receive
|
||||
.BR EPERM .
|
||||
.SH "RETURN VALUE"
|
||||
.B idle
|
||||
.BR idle ()
|
||||
never returns for process 0, and always returns \-1 for a user process.
|
||||
.SH ERRORS
|
||||
.TP
|
||||
|
|
|
@ -37,7 +37,7 @@ long\ \fBio_cancel\fR\ (aio_context_t\ \fIctx_id\fR, struct\ iocb\ \fI*iocb\fR,
|
|||
.SH "DESCRIPTION"
|
||||
|
||||
.PP
|
||||
\fBio_cancel\fR attempts to cancel an asynchronous I/O operation
|
||||
\fBio_cancel\fR() attempts to cancel an asynchronous I/O operation
|
||||
previously submitted with the \fBio_submit\fR system call.
|
||||
\fIctx_id\fR is the AIO context ID of the operation to be cancelled.
|
||||
If the AIO context is found, the event will be cancelled and then copied
|
||||
|
@ -47,7 +47,7 @@ into the completion queue.
|
|||
.SH "RETURN VALUE"
|
||||
|
||||
.PP
|
||||
\fBio_cancel\fR returns 0 on success; otherwise, it returns one of the
|
||||
\fBio_cancel\fR() returns 0 on success; otherwise, it returns one of the
|
||||
errors listed in the "Errors" section.
|
||||
|
||||
.SH "ERRORS"
|
||||
|
@ -66,7 +66,7 @@ The \fIiocb\fR specified was not cancelled.
|
|||
|
||||
.TP
|
||||
ENOSYS
|
||||
\fBio_cancel\fR is not implemented on this architecture.
|
||||
\fBio_cancel\fR() is not implemented on this architecture.
|
||||
|
||||
.SH "VERSIONS"
|
||||
|
||||
|
@ -76,7 +76,7 @@ The asynchronous I/O system calls first appeared in Linux 2.5, August 2002.
|
|||
.SH "CONFORMING TO"
|
||||
|
||||
.PP
|
||||
\fBio_cancel\fR is Linux specific and should not be used in programs that are intended to be portable.
|
||||
\fBio_cancel\fR() is Linux specific and should not be used in programs that are intended to be portable.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
|
||||
|
|
|
@ -37,15 +37,15 @@ long\ \fBio_destroy\fR\ (aio_context_t\ \fIctx\fR);
|
|||
.SH "DESCRIPTION"
|
||||
|
||||
.PP
|
||||
\fBio_destroy\fR removes the asynchronous I/O context from the list of
|
||||
\fBio_destroy\fR() removes the asynchronous I/O context from the list of
|
||||
I/O contexts and then destroys it.
|
||||
\fBio_destroy\fR can also cancel any outstanding asynchronous I/O
|
||||
\fBio_destroy\fR() can also cancel any outstanding asynchronous I/O
|
||||
actions on \fIctx\fR and block on completion.
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
|
||||
.PP
|
||||
\fBio_destroy\fR returns 0 on success.
|
||||
\fBio_destroy\fR() returns 0 on success.
|
||||
|
||||
.SH "ERRORS"
|
||||
|
||||
|
@ -59,12 +59,12 @@ The context pointed to is invalid.
|
|||
|
||||
.TP
|
||||
ENOSYS
|
||||
\fBio_destroy\fR is not implemented on this architecture.
|
||||
\fBio_destroy\fR() is not implemented on this architecture.
|
||||
|
||||
.SH "CONFORMING TO"
|
||||
|
||||
.PP
|
||||
\fBio_destroy\fR is Linux specific and should not be used in programs
|
||||
\fBio_destroy\fR() is Linux specific and should not be used in programs
|
||||
that are intended to be portable.
|
||||
|
||||
.SH "VERSIONS"
|
||||
|
|
|
@ -42,7 +42,7 @@ long\ \fBio_getevents\fR\ (aio_context_t\ \fIctx_id\fR, long\ \fImin_nr\fR, long
|
|||
.SH "DESCRIPTION"
|
||||
|
||||
.PP
|
||||
\fBio_getevents\fR attempts to read at least \fImin_nr\fR events and
|
||||
\fBio_getevents\fR() attempts to read at least \fImin_nr\fR events and
|
||||
up to \fInr\fR events from the completion queue of the AIO context
|
||||
specified by \fIctx_id\fR.
|
||||
\fItimeout\fR specifies the amount of time to wait for events,
|
||||
|
@ -53,7 +53,7 @@ and the operation blocks.
|
|||
.SH "RETURN VALUE"
|
||||
|
||||
.PP
|
||||
\fBio_getevents\fR returns the number of events read: 0 if no events are
|
||||
\fBio_getevents\fR() returns the number of events read: 0 if no events are
|
||||
available or < \fImin_nr\fR if the \fItimeout\fR has elapsed.
|
||||
|
||||
.SH "ERRORS"
|
||||
|
@ -69,12 +69,12 @@ Either \fIevents\fR or \fItimeout\fR is an invalid pointer.
|
|||
|
||||
.TP
|
||||
ENOSYS
|
||||
\fBio_getevents\fR is not implemented on this architecture.
|
||||
\fBio_getevents\fR() is not implemented on this architecture.
|
||||
|
||||
.SH "CONFORMING TO"
|
||||
|
||||
.PP
|
||||
\fBio_getevents\fR is Linux specific and should not be used in programs that are intended to be portable.
|
||||
\fBio_getevents\fR() is Linux specific and should not be used in programs that are intended to be portable.
|
||||
|
||||
.SH "VERSIONS"
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ long\ \fBio_setup\fR\ (unsigned\ \fInr_events\fR, aio_context_t\ \fI*ctxp\fR);
|
|||
.SH "DESCRIPTION"
|
||||
|
||||
.PP
|
||||
\fBio_setup\fR creates an asynchronous I/O context capable of receiving
|
||||
\fBio_setup\fR() creates an asynchronous I/O context capable of receiving
|
||||
at least \fInr_events\fR.
|
||||
\fIctxp\fR must not point to an AIO context that already exists, and must
|
||||
be initialized to 0 prior to the call.
|
||||
|
@ -47,7 +47,7 @@ with the resulting handle.
|
|||
.SH "RETURN VALUE"
|
||||
|
||||
.PP
|
||||
\fBio_setup\fR returns 0 on success; otherwise, one of the errors
|
||||
\fBio_setup\fR() returns 0 on success; otherwise, one of the errors
|
||||
listed in the "Errors" section is returned.
|
||||
|
||||
.SH "ERRORS"
|
||||
|
@ -71,12 +71,12 @@ The specified \fInr_events\fR exceeds the user's limit of available events.
|
|||
|
||||
.TP
|
||||
ENOSYS
|
||||
\fBio_setup\fR is not implemented on this architecture.
|
||||
\fBio_setup\fR() is not implemented on this architecture.
|
||||
|
||||
.SH "CONFORMING TO"
|
||||
|
||||
.PP
|
||||
\fBio_setup\fR is Linux specific and should not be used in programs
|
||||
\fBio_setup\fR() is Linux specific and should not be used in programs
|
||||
that are intended to be portable.
|
||||
|
||||
.SH "VERSIONS"
|
||||
|
|
|
@ -37,14 +37,14 @@ long\ \fBio_submit\fR\ (aio_context_t\ \fIctx_id\fR, long\ \fInr\fR, struct\ ioc
|
|||
.SH "DESCRIPTION"
|
||||
|
||||
.PP
|
||||
\fBio_submit\fR queues \fInr\fR I/O request blocks for processing in
|
||||
\fBio_submit\fR() queues \fInr\fR I/O request blocks for processing in
|
||||
the AIO context \fIctx_id\fR. \fIiocbpp\fR should be an array of
|
||||
\fInr\fR AIO request blocks, which will be submitted to context \fIctx_id\fR.
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
|
||||
.PP
|
||||
\fBio_submit\fR returns the number of \fIiocb\fRs submitted and
|
||||
\fBio_submit\fR() returns the number of \fIiocb\fRs submitted and
|
||||
0 if \fInr\fR is zero.
|
||||
|
||||
.SH "ERRORS"
|
||||
|
@ -70,12 +70,12 @@ Insufficient resources are available to queue any \fIiocb\fRs.
|
|||
|
||||
.TP
|
||||
ENOSYS
|
||||
\fBio_submit\fR is not implemented on this architecture.
|
||||
\fBio_submit\fR() is not implemented on this architecture.
|
||||
|
||||
.SH "CONFORMING TO"
|
||||
|
||||
.PP
|
||||
\fBio_submit\fR is Linux specific and should not be used in programs that are intended to be portable.
|
||||
\fBio_submit\fR() is Linux specific and should not be used in programs that are intended to be portable.
|
||||
|
||||
.SH "VERSIONS"
|
||||
|
||||
|
|
|
@ -45,11 +45,11 @@ ioctl \- control device
|
|||
.BI "int ioctl(int " d ", int " request ", ...);"
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B ioctl
|
||||
.BR 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
|
||||
.B ioctl
|
||||
.BR ioctl ()
|
||||
requests. The argument
|
||||
.I d
|
||||
must be an open file descriptor.
|
||||
|
@ -119,9 +119,9 @@ catch-all for operations that don't cleanly fit the Unix stream I/O
|
|||
model). See
|
||||
.BR ioctl_list (2)
|
||||
for a list of many of the known
|
||||
.B ioctl
|
||||
.BR ioctl ()
|
||||
calls. The
|
||||
.B ioctl
|
||||
.BR ioctl ()
|
||||
function call appeared in Version 7 AT&T Unix.
|
||||
.SH "SEE ALSO"
|
||||
.BR execve (2),
|
||||
|
|
|
@ -46,7 +46,7 @@ ioperm \- set port input/output permissions
|
|||
.SH DESCRIPTION
|
||||
\fBIoperm\fP sets the port access permission bits for the process for
|
||||
\fInum\fP bytes starting from port address \fBfrom\fP to the value
|
||||
\fBturn_on\fP. The use of \fBioperm\fP requires root privileges.
|
||||
\fBturn_on\fP. The use of \fBioperm\fP() requires root privileges.
|
||||
|
||||
Only the first 0x3ff I/O ports can be specified in this manner. For more
|
||||
ports, the
|
||||
|
@ -75,12 +75,12 @@ or
|
|||
.TP
|
||||
.B EPERM
|
||||
The calling process has insufficient privilege to call
|
||||
.BR ioperm ;
|
||||
.BR ioperm ();
|
||||
the
|
||||
.B CAP_SYS_RAWIO
|
||||
capability is required.
|
||||
.SH "CONFORMING TO"
|
||||
\fBioperm\fP is Linux specific and should not be used in programs
|
||||
\fBioperm\fP() is Linux specific and should not be used in programs
|
||||
intended to be portable.
|
||||
.SH NOTES
|
||||
Libc5 treats it as a system call and has a prototype in
|
||||
|
|
|
@ -38,7 +38,7 @@ iopl \- change I/O privilege level
|
|||
.sp
|
||||
.BI "int iopl(int " level );
|
||||
.SH DESCRIPTION
|
||||
.B iopl
|
||||
.BR iopl ()
|
||||
changes the I/O privilege level of the current process, as specified in
|
||||
.IR level .
|
||||
|
||||
|
@ -73,12 +73,12 @@ This call is unimplemented.
|
|||
.TP
|
||||
.B EPERM
|
||||
The calling process has insufficient privilege to call
|
||||
.BR iopl ;
|
||||
.BR iopl ();
|
||||
the
|
||||
.B CAP_SYS_RAWIO
|
||||
capability is required.
|
||||
.SH "CONFORMING TO"
|
||||
\fBiopl\fP is Linux specific and should not be used in processes
|
||||
\fBiopl\fP() is Linux specific and should not be used in processes
|
||||
intended to be portable.
|
||||
.SH NOTES
|
||||
Libc5 treats it as a system call and has a prototype in
|
||||
|
|
|
@ -54,7 +54,7 @@ kill \- send signal to a process
|
|||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B kill
|
||||
.BR kill ()
|
||||
system call
|
||||
can be used to send any signal to any process group or process.
|
||||
.PP
|
||||
|
|
|
@ -56,7 +56,7 @@ for a list of signals.
|
|||
If
|
||||
.I pgrp
|
||||
is 0,
|
||||
.B killpg
|
||||
.BR killpg ()
|
||||
sends the signal to the sending process's process group.
|
||||
|
||||
(POSIX says: If
|
||||
|
@ -102,7 +102,7 @@ while POSIX documents EPERM only when the permission check failed
|
|||
for all target processes.
|
||||
.SH "CONFORMING TO"
|
||||
SVr4, 4.4BSD (The
|
||||
.B killpg
|
||||
.BR killpg ()
|
||||
function call first appeared in 4.0BSD).
|
||||
.SH "SEE ALSO"
|
||||
.BR getpgrp (2),
|
||||
|
|
|
@ -36,7 +36,7 @@ link \- make a new name for a file
|
|||
.sp
|
||||
.BI "int link(const char *" oldpath ", const char *" newpath );
|
||||
.SH DESCRIPTION
|
||||
.B link
|
||||
.BR link ()
|
||||
creates a new link (also known as a hard link) to an existing file.
|
||||
|
||||
If
|
||||
|
@ -126,13 +126,13 @@ does not work across different mount points,
|
|||
even if the same filesystem is mounted on both.)
|
||||
.SH NOTES
|
||||
Hard links, as created by
|
||||
.BR link ,
|
||||
.BR link (),
|
||||
cannot span filesystems. Use
|
||||
.B symlink
|
||||
if this is required.
|
||||
|
||||
POSIX.1-2001 says that
|
||||
.BR link
|
||||
.BR link ()
|
||||
should dereference
|
||||
.I oldpath
|
||||
if it is a symbolic link.
|
||||
|
|
|
@ -51,7 +51,7 @@ data).
|
|||
A complete overview of extended attributes concepts can be found in
|
||||
.BR attr (5).
|
||||
.PP
|
||||
.B listxattr
|
||||
.BR listxattr ()
|
||||
retrieves the
|
||||
.I list
|
||||
of extended attribute names associated with the given
|
||||
|
@ -64,16 +64,16 @@ The length of the attribute name
|
|||
.I list
|
||||
is returned.
|
||||
.PP
|
||||
.B llistxattr
|
||||
.BR llistxattr ()
|
||||
is identical to
|
||||
.BR listxattr ,
|
||||
.BR listxattr (),
|
||||
except in the case of a symbolic link, where the list of names of
|
||||
extended attributes associated with the link itself is retrieved,
|
||||
not the file that it refers to.
|
||||
.PP
|
||||
.B flistxattr
|
||||
.BR flistxattr ()
|
||||
is identical to
|
||||
.BR listxattr ,
|
||||
.BR listxattr (),
|
||||
only the open file pointed to by
|
||||
.I filedes
|
||||
(as returned by
|
||||
|
|
|
@ -41,7 +41,7 @@ _llseek \- reposition read/write file offset
|
|||
.BI "unsigned long " offset_low ", loff_t *" result ", unsigned int " whence );
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B _llseek
|
||||
.BR _llseek ()
|
||||
function repositions the offset of the open file associated
|
||||
with the file descriptor
|
||||
.I fd
|
||||
|
@ -61,7 +61,7 @@ It returns the resulting file position in the argument
|
|||
|
||||
.SH "RETURN VALUE"
|
||||
Upon successful completion,
|
||||
.B _llseek
|
||||
.BR _llseek ()
|
||||
returns 0. Otherwise, a value of \-1 is returned and
|
||||
.I errno
|
||||
is set to indicate the error.
|
||||
|
|
|
@ -39,12 +39,12 @@ entry. The buffer given is filled in with the full path of the directory
|
|||
entry.
|
||||
|
||||
For
|
||||
.B lookup_dcookie
|
||||
.BR lookup_dcookie ()
|
||||
to return successfully,
|
||||
the kernel must still hold a cookie reference to the directory entry.
|
||||
|
||||
.SH "NOTES"
|
||||
.B lookup_dcookie
|
||||
.BR lookup_dcookie ()
|
||||
is a special-purpose system call, currently used only by the oprofile profiler.
|
||||
It relies on a kernel driver to register cookies for directory entries.
|
||||
|
||||
|
@ -53,7 +53,7 @@ entry has been removed.
|
|||
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B lookup_dcookie
|
||||
.BR lookup_dcookie ()
|
||||
returns the length of the path string copied into the buffer.
|
||||
On error, \-1 is returned, and
|
||||
.I errno
|
||||
|
@ -82,7 +82,7 @@ required to look up cookie values.
|
|||
.B ERANGE
|
||||
The buffer was not large enough to hold the path of the directory entry.
|
||||
.SH "CONFORMING TO"
|
||||
.B lookup_dcookie
|
||||
.BR lookup_dcookie ()
|
||||
is Linux-specific.
|
||||
.SH AVAILABILITY
|
||||
Since Linux 2.5.43.
|
||||
|
|
|
@ -51,7 +51,7 @@ lseek \- reposition read/write file offset
|
|||
.BI "off_t lseek(int " fildes ", off_t " offset ", int " whence );
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B lseek
|
||||
.BR lseek ()
|
||||
function repositions the offset of the open file associated with the
|
||||
file descriptor
|
||||
.I fildes
|
||||
|
@ -77,7 +77,7 @@ The offset is set to the size of the file plus
|
|||
bytes.
|
||||
.PP
|
||||
The
|
||||
.B lseek
|
||||
.BR lseek ()
|
||||
function allows the file offset to be set beyond the end of the existing
|
||||
end-of-file of the file (but this does not change the size of the file).
|
||||
If data is later written at this point, subsequent reads of the data
|
||||
|
@ -85,7 +85,7 @@ in the gap return bytes of zeros (until data is actually written into
|
|||
the gap).
|
||||
.SH "RETURN VALUE"
|
||||
Upon successful completion,
|
||||
.B lseek
|
||||
.BR lseek ()
|
||||
returns the resulting offset location as measured in bytes from the
|
||||
beginning of the file. Otherwise, a value of (off_t)\-1 is returned and
|
||||
.I errno
|
||||
|
@ -115,7 +115,7 @@ SVr4, POSIX, 4.3BSD
|
|||
Some devices are incapable of seeking and POSIX does not specify which
|
||||
devices must support it.
|
||||
|
||||
Linux specific restrictions: using \fBlseek\fP on a tty device returns
|
||||
Linux specific restrictions: using \fBlseek\fP() on a tty device returns
|
||||
\fBESPIPE\fP.
|
||||
.\" Other systems return the number of written characters,
|
||||
.\" using SEEK_SET to set the counter. (Of written characters.)
|
||||
|
|
|
@ -36,7 +36,7 @@ madvise \- give advice about use of memory
|
|||
.BI "int madvise(void *" start ", size_t " length ", int " advice );
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B madvise
|
||||
.BR madvise ()
|
||||
system call advises the kernel about how to handle paging input/output in
|
||||
the address range beginning at address
|
||||
.I start
|
||||
|
@ -81,7 +81,7 @@ either in re-loading of the memory contents from the underlying mapped file
|
|||
without an underlying file.
|
||||
.SH "RETURN VALUE"
|
||||
On success
|
||||
.B madvise
|
||||
.BR madvise ()
|
||||
returns zero. On error, it returns \-1 and
|
||||
.I errno
|
||||
is set appropriately.
|
||||
|
@ -129,13 +129,13 @@ be page-aligned, and allows
|
|||
.I length
|
||||
to be zero. If there are some parts of the specified address range
|
||||
that are not mapped, the Linux version of
|
||||
.B madvise
|
||||
.BR madvise ()
|
||||
ignores them and applies the call to the rest (but returns
|
||||
.B ENOMEM
|
||||
from the system call, as it should).
|
||||
.SH HISTORY
|
||||
The
|
||||
.B madvise
|
||||
.BR madvise ()
|
||||
function first appeared in 4.4BSD.
|
||||
.SH "CONFORMING TO"
|
||||
POSIX.1b (POSIX.4).
|
||||
|
|
|
@ -40,7 +40,7 @@ mincore \- get information on whether pages are in core
|
|||
.BI "int mincore(void *" start ", size_t " length ", unsigned char *" vec );
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B mincore
|
||||
.BR mincore ()
|
||||
function requests a vector describing which pages of a file are in core and
|
||||
can be read without disk access. The kernel will supply data for
|
||||
.I length
|
||||
|
@ -57,7 +57,7 @@ locked in core can come and go any moment, and the contents of
|
|||
may be stale already when this call returns.
|
||||
|
||||
For
|
||||
.B mincore
|
||||
.BR mincore ()
|
||||
to return successfully,
|
||||
.I start
|
||||
must lie on a page boundary. It is the caller's responsibility to
|
||||
|
@ -71,7 +71,7 @@ One may obtain the page size from
|
|||
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B mincore
|
||||
.BR mincore ()
|
||||
returns zero.
|
||||
On error, \-1 is returned, and
|
||||
.I errno
|
||||
|
@ -109,7 +109,7 @@ to
|
|||
contained unmapped memory, or memory not part of a file.
|
||||
.SH BUGS
|
||||
Up to now (Linux 2.6.5),
|
||||
.B mincore
|
||||
.BR mincore ()
|
||||
does not return correct information for MAP_PRIVATE mappings.
|
||||
|
||||
.\" Linux (up to now, 2.6.5),
|
||||
|
@ -128,7 +128,7 @@ does not return correct information for MAP_PRIVATE mappings.
|
|||
.\" always fails with the error
|
||||
.\" .BR ENOMEM .
|
||||
.SH "CONFORMING TO"
|
||||
.B mincore
|
||||
.BR mincore ()
|
||||
is not specified in POSIX.1-2001,
|
||||
and it is not available on all Unix implementations.
|
||||
.SH HISTORY
|
||||
|
|
|
@ -18,7 +18,7 @@ mkdir \- create a directory
|
|||
.BI "int mkdir(const char *" pathname ", mode_t " mode );
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.B mkdir
|
||||
.BR mkdir ()
|
||||
attempts to create a directory named
|
||||
.IR pathname .
|
||||
|
||||
|
@ -41,7 +41,7 @@ If the parent directory has the set-group-ID bit set then so will the
|
|||
newly created directory.
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
.BR mkdir
|
||||
.BR mkdir ()
|
||||
returns zero on success, or \-1 if an error occurred (in which case,
|
||||
.I errno
|
||||
is set appropriately).
|
||||
|
@ -114,7 +114,7 @@ See also
|
|||
.PP
|
||||
There are many infelicities in the protocol underlying NFS. Some
|
||||
of these affect
|
||||
.BR mkdir .
|
||||
.BR mkdir ().
|
||||
.SH "SEE ALSO"
|
||||
.BR mkdir (1),
|
||||
.BR chmod (2),
|
||||
|
|
|
@ -24,7 +24,7 @@ mknod \- create a special or ordinary file
|
|||
.fi
|
||||
.SH DESCRIPTION
|
||||
The system call
|
||||
.B mknod
|
||||
.BR mknod ()
|
||||
creates a filesystem node (file, device special file or
|
||||
named pipe) named
|
||||
.IR pathname ,
|
||||
|
@ -75,7 +75,7 @@ bit set, or if the filesystem is mounted with BSD group semantics, the
|
|||
new node will inherit the group ownership from its parent directory;
|
||||
otherwise it will be owned by the effective group ID of the process.
|
||||
.SH "RETURN VALUE"
|
||||
.BR mknod
|
||||
.BR mknod ()
|
||||
returns zero on success, or \-1 if an error occurred (in which case,
|
||||
.I errno
|
||||
is set appropriately).
|
||||
|
@ -168,7 +168,7 @@ and FIFOs with
|
|||
|
||||
There are many infelicities in the protocol underlying NFS. Some
|
||||
of these affect
|
||||
.BR mknod .
|
||||
.BR mknod ().
|
||||
.SH "SEE ALSO"
|
||||
.BR fcntl (2),
|
||||
.BR mkdir (2),
|
||||
|
|
|
@ -159,7 +159,7 @@ or
|
|||
will be unlocked by a single call to
|
||||
.BR munlock ()
|
||||
for the corresponding range or by
|
||||
.BR munlockall .
|
||||
.BR munlockall ().
|
||||
Pages which are mapped to several locations or by several processes stay
|
||||
locked into RAM as long as they are locked at least at one location or by
|
||||
at least one process.
|
||||
|
@ -225,7 +225,7 @@ soft resource limit was 0.
|
|||
.B EPERM
|
||||
(Linux 2.6.8 and earlier)
|
||||
The calling process has insufficient privilege to call
|
||||
.BR munlockall .
|
||||
.BR munlockall ().
|
||||
Under Linux the
|
||||
.B CAP_IPC_LOCK
|
||||
capability is required.
|
||||
|
|
|
@ -43,7 +43,7 @@ mmap2 \- map files or devices into memory
|
|||
.BI "int " flags ", int " fd ", off_t " pgoffset );
|
||||
.SH DESCRIPTION
|
||||
The function
|
||||
.B mmap2
|
||||
.BR mmap2 ()
|
||||
operates in exactly the same way as
|
||||
.BR mmap (2),
|
||||
except that the final argument specifies the offset into the
|
||||
|
@ -54,7 +54,7 @@ to map
|
|||
larger files (typically up to 2^44 bytes).
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B mmap2
|
||||
.BR mmap2 ()
|
||||
returns a pointer to the mapped area. On error \-1 is returned
|
||||
and
|
||||
.I errno
|
||||
|
@ -66,7 +66,7 @@ Problem with getting the
|
|||
data from userspace.
|
||||
.SH NOTES
|
||||
The function
|
||||
.B mmap2
|
||||
.BR mmap2 ()
|
||||
is available since Linux 2.3.31.
|
||||
It is Linux specific, and should be avoided in portable applications.
|
||||
See also the
|
||||
|
|
|
@ -36,7 +36,7 @@ modify_ldt \- get or set ldt
|
|||
.sp
|
||||
.BI "int modify_ldt(int " "func" ", void *" "ptr" ", unsigned long " "bytecount" );
|
||||
.SH DESCRIPTION
|
||||
.B modify_ldt
|
||||
.BR modify_ldt ()
|
||||
reads or writes the local descriptor table (ldt) for a process.
|
||||
The ldt is a per-process memory management table used by the i386 processor.
|
||||
For more information on this table, see an Intel 386 processor handbook.
|
||||
|
@ -44,7 +44,7 @@ For more information on this table, see an Intel 386 processor handbook.
|
|||
When
|
||||
.I func
|
||||
is 0,
|
||||
.B modify_ldt
|
||||
.BR modify_ldt ()
|
||||
reads the ldt into the memory pointed to by
|
||||
.IR ptr .
|
||||
The number of bytes read is the smaller of
|
||||
|
@ -54,7 +54,7 @@ and the actual size of the ldt.
|
|||
When
|
||||
.I func
|
||||
is 1,
|
||||
.B modify_ldt
|
||||
.BR modify_ldt ()
|
||||
modifies one ldt entry.
|
||||
.I ptr
|
||||
points to a
|
||||
|
@ -70,11 +70,11 @@ must equal the size of this structure.
|
|||
.\" at the paging layer.
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B modify_ldt
|
||||
.BR modify_ldt ()
|
||||
returns either the actual number of bytes read (for reading)
|
||||
or 0 (for writing).
|
||||
On failure,
|
||||
.B modify_ldt
|
||||
.BR modify_ldt ()
|
||||
returns \-1 and sets
|
||||
.IR errno .
|
||||
.SH ERRORS
|
||||
|
|
|
@ -49,7 +49,7 @@ mount, umount \- mount and unmount filesystems
|
|||
.sp
|
||||
.BI "int umount2(const char *" target ", int " flags );
|
||||
.SH DESCRIPTION
|
||||
.B mount
|
||||
.BR mount ()
|
||||
attaches the filesystem specified by
|
||||
.I source
|
||||
(which is often a device name, but can also be a directory name
|
||||
|
@ -336,7 +336,7 @@ These functions are Linux-specific and should not be used in
|
|||
programs intended to be portable.
|
||||
.SH HISTORY
|
||||
The original
|
||||
.B umount
|
||||
.BR umount ()
|
||||
function was called as \fIumount(device)\fP and would return ENOTBLK
|
||||
when called with something other than a block device.
|
||||
In Linux 0.98p4 a call \fIumount(dir)\fP was added, in order to
|
||||
|
|
|
@ -38,7 +38,7 @@ mprotect \- control allowable accesses to a region of memory
|
|||
.fi
|
||||
.SH DESCRIPTION
|
||||
The function
|
||||
.B mprotect
|
||||
.BR mprotect ()
|
||||
specifies the desired protection for the memory page(s) containing
|
||||
part or all of the interval [\fIaddr\fP,\fIaddr\fP+\fIlen\fP-1].
|
||||
If an access is disallowed by the protection given it, the program receives a
|
||||
|
@ -60,12 +60,12 @@ The memory can be written to.
|
|||
The memory can contain executing code.
|
||||
.PP
|
||||
The new protection replaces any existing protection. For example, if the
|
||||
memory had previously been marked \fBPROT_READ\fR, and \fBmprotect\fR
|
||||
memory had previously been marked \fBPROT_READ\fR, and \fBmprotect\fR()
|
||||
is then called with \fIprot\fR \fBPROT_WRITE\fR, it will no longer
|
||||
be readable.
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B mprotect
|
||||
.BR mprotect ()
|
||||
returns zero. On error, \-1 is returned, and
|
||||
.I errno
|
||||
is set appropriately.
|
||||
|
@ -76,7 +76,7 @@ The memory cannot be given the specified access. This can happen,
|
|||
for example, if you
|
||||
.BR mmap (2)
|
||||
a file to which you have read-only access, then ask
|
||||
.B mprotect
|
||||
.BR mprotect ()
|
||||
to mark it
|
||||
.BR PROT_WRITE .
|
||||
.TP
|
||||
|
@ -141,12 +141,12 @@ main(void)
|
|||
SVr4, POSIX.1b (formerly POSIX.4). SVr4 defines an additional error
|
||||
code EAGAIN. The SVr4 error conditions don't map neatly onto Linux's.
|
||||
POSIX says that
|
||||
.B mprotect
|
||||
.BR mprotect ()
|
||||
can be used only on regions of memory obtained from
|
||||
.BR mmap (2).
|
||||
.SH NOTES
|
||||
On Linux it is always legal to call
|
||||
.B mprotect
|
||||
.BR mprotect ()
|
||||
on any address in a process' address space (except for the
|
||||
kernel vsyscall area). In particular it can be used
|
||||
to change existing code mappings to be writable.
|
||||
|
|
|
@ -30,7 +30,7 @@ msync \- synchronize a file with a memory map
|
|||
.sp
|
||||
.BI "int msync(void *" start ", size_t " length ", int " flags );
|
||||
.SH DESCRIPTION
|
||||
.B msync
|
||||
.BR msync ()
|
||||
flushes changes made to the in-core copy of a file that was mapped
|
||||
into memory using
|
||||
.BR mmap (2)
|
||||
|
@ -67,7 +67,7 @@ MS_ASYNC | MS_INVALIDATE | MS_SYNC is set in
|
|||
The indicated memory (or part of it) was not mapped.
|
||||
.SH AVAILABILITY
|
||||
On POSIX systems on which
|
||||
.B msync
|
||||
.BR msync ()
|
||||
is available, both
|
||||
.B _POSIX_MAPPED_FILES
|
||||
and
|
||||
|
|
|
@ -35,7 +35,7 @@ nanosleep \- pause execution for a specified time
|
|||
\fBint nanosleep(const struct timespec *\fIreq\fB, struct timespec *\fIrem\fB);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.B nanosleep
|
||||
.BR nanosleep ()
|
||||
delays the execution of the program for at least the time specified in
|
||||
.IR *req .
|
||||
The function can return earlier if a signal has been delivered to the
|
||||
|
@ -51,7 +51,7 @@ is
|
|||
The value of
|
||||
.I *rem
|
||||
can then be used to call
|
||||
.B nanosleep
|
||||
.BR nanosleep ()
|
||||
again and complete the specified pause.
|
||||
|
||||
The structure
|
||||
|
@ -80,13 +80,13 @@ Compared to
|
|||
.BR sleep (3)
|
||||
and
|
||||
.BR usleep (3),
|
||||
.B nanosleep
|
||||
.BR nanosleep ()
|
||||
has the advantage of not affecting any signals, it is standardized by
|
||||
POSIX, it provides higher timing resolution, and it allows to continue
|
||||
a sleep that has been interrupted by a signal more easily.
|
||||
.SH ERRORS
|
||||
In case of an error or exception, the
|
||||
.B nanosleep
|
||||
.BR nanosleep ()
|
||||
system call returns \-1 instead of 0 and sets
|
||||
.I errno
|
||||
to one of the following values:
|
||||
|
@ -98,7 +98,7 @@ Problem with copying information from user space.
|
|||
The pause has been interrupted by a non-blocked signal that was
|
||||
delivered to the process. The remaining sleep time has been written
|
||||
into *\fIrem\fR so that the process can easily call
|
||||
.B nanosleep
|
||||
.BR nanosleep ()
|
||||
again and continue with the pause.
|
||||
.TP
|
||||
.B EINVAL
|
||||
|
@ -109,11 +109,11 @@ field was not in the range 0 to 999999999 or
|
|||
was negative.
|
||||
.SH BUGS
|
||||
The current implementation of
|
||||
.B nanosleep
|
||||
.BR nanosleep ()
|
||||
is based on the normal kernel timer mechanism, which has a resolution
|
||||
of 1/\fIHZ\fR\ s (i.e, 10\ ms on Linux/i386 and 1\ ms on Linux/Alpha).
|
||||
Therefore,
|
||||
.B nanosleep
|
||||
.BR nanosleep ()
|
||||
pauses always for at least the specified time, however it can take up
|
||||
to 10 ms longer than specified until the process becomes runnable
|
||||
again. For the same reason, the value returned in case of a delivered
|
||||
|
@ -123,7 +123,7 @@ signal in *\fIrem\fR is usually rounded to the next larger multiple of
|
|||
.SS "Old behaviour"
|
||||
In order to support applications requiring much more precise pauses
|
||||
(e.g., in order to control some time-critical hardware),
|
||||
.B nanosleep
|
||||
.BR nanosleep ()
|
||||
would handle pauses of up to 2\ ms by busy waiting with microsecond
|
||||
precision when called from a process scheduled under a real-time policy
|
||||
like
|
||||
|
|
|
@ -56,7 +56,7 @@ I/O ports in question. Failure to do this will cause the application
|
|||
to receive a segmentation fault.
|
||||
|
||||
.SH "CONFORMING TO"
|
||||
\fBoutb\fP and friends are hardware specific. The
|
||||
\fBoutb\fP() and friends are hardware specific. The
|
||||
.I value
|
||||
argument is passed first and the
|
||||
.I port
|
||||
|
|
|
@ -36,7 +36,7 @@ pause \- wait for signal
|
|||
.B int pause(void);
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B pause
|
||||
.BR pause ()
|
||||
library function causes the invoking process (or thread) to sleep
|
||||
until a signal is received that either terminates it or causes it
|
||||
to call a signal-catching function.
|
||||
|
|
|
@ -20,7 +20,7 @@ pciconfig_read, pciconfig_write, pciconfig_iobase \- pci device information hand
|
|||
.TP
|
||||
Most of the interaction with PCI devices is already handled by the kernel PCI layer, and thus these calls should not normally need to be accessed from userspace.
|
||||
.TP
|
||||
.BR pciconfig_read
|
||||
.BR pciconfig_read ()
|
||||
Reads to
|
||||
.I
|
||||
buf
|
||||
|
@ -32,7 +32,7 @@ at offset
|
|||
off
|
||||
value.
|
||||
.TP
|
||||
.BR pciconfig_write
|
||||
.BR pciconfig_write ()
|
||||
Writes from
|
||||
.I
|
||||
buf
|
||||
|
@ -44,17 +44,17 @@ at offset
|
|||
off
|
||||
value.
|
||||
.TP
|
||||
.BR pciconfig_iobase
|
||||
.BR pciconfig_iobase ()
|
||||
You pass it a bus/devfn pair and get a physical address for either the memory offset (for things like prep, this is 0xc0000000), the IO base for PIO cycles, or the ISA holes if any.
|
||||
.SH "RETURN VALUE"
|
||||
.TP
|
||||
.BR pciconfig_read
|
||||
.BR pciconfig_read ()
|
||||
On success zero is returned. On error, \-1 is returned and errno is set appropriately.
|
||||
.TP
|
||||
.BR pciconfig_write
|
||||
.BR pciconfig_write ()
|
||||
On success zero is returned. On error, \-1 is returned and errno is set appropriately.
|
||||
.TP
|
||||
.BR pciconfig_iobase
|
||||
.BR pciconfig_iobase ()
|
||||
Returns information on locations of various I/O regions in physical memory according to the
|
||||
.I which
|
||||
value. Values for
|
||||
|
|
|
@ -42,7 +42,7 @@ Linux to provide limited support for binaries compiled under other
|
|||
Unix-like operating systems.
|
||||
|
||||
This function will return the current
|
||||
.B personality
|
||||
.BR personality ()
|
||||
when
|
||||
.I persona
|
||||
equals 0xffffffff. Otherwise, it will make the execution domain
|
||||
|
@ -60,5 +60,5 @@ is set appropriately.
|
|||
.B EINVAL
|
||||
The kernel was unable to change the personality.
|
||||
.SH "CONFORMING TO"
|
||||
.B personality
|
||||
.BR personality ()
|
||||
is Linux-specific and should not be used in programs intended to be portable.
|
||||
|
|
|
@ -35,7 +35,7 @@ pipe \- create pipe
|
|||
.sp
|
||||
.BI "int pipe(int " filedes "[2]);"
|
||||
.SH DESCRIPTION
|
||||
.B pipe
|
||||
.BR pipe ()
|
||||
creates a pair of file descriptors, pointing to a pipe inode, and places
|
||||
them in the array pointed to by
|
||||
.IR filedes .
|
||||
|
|
|
@ -16,7 +16,7 @@ pivot_root \- change the root file system
|
|||
.sp
|
||||
.BI "int pivot_root(const char *" new_root ", const char *" put_old );
|
||||
.SH DESCRIPTION
|
||||
\fBpivot_root\fP moves the root file system of the current process to the
|
||||
\fBpivot_root\fP() moves the root file system of the current process to the
|
||||
directory \fIput_old\fP and makes \fInew_root\fP the new root file system
|
||||
of the current process.
|
||||
.\"
|
||||
|
@ -24,32 +24,32 @@ of the current process.
|
|||
.\" .B CAP_SYS_ADMIN
|
||||
.\" capability is required.
|
||||
|
||||
The typical use of \fBpivot_root\fP is during system startup, when the
|
||||
The typical use of \fBpivot_root\fP() is during system startup, when the
|
||||
system mounts a temporary root file system (e.g. an \fBinitrd\fP), then
|
||||
mounts the real root file system, and eventually turns the latter into
|
||||
the current root of all relevant processes or threads.
|
||||
|
||||
\fBpivot_root\fP may or may not change the current root and the current
|
||||
\fBpivot_root\fP() may or may not change the current root and the current
|
||||
working directory (cwd) of any processes or threads which use the old
|
||||
root directory. The caller of \fBpivot_root\fP
|
||||
root directory. The caller of \fBpivot_root\fP()
|
||||
must ensure that processes with root or cwd at the old root operate
|
||||
correctly in either case. An easy way to ensure this is to change their
|
||||
root and cwd to \fInew_root\fP before invoking \fBpivot_root\fP.
|
||||
root and cwd to \fInew_root\fP before invoking \fBpivot_root\fP().
|
||||
|
||||
The paragraph above is intentionally vague because the implementation
|
||||
of \fBpivot_root\fP may change in the future. At the time of writing,
|
||||
\fBpivot_root\fP changes root and cwd of each process or
|
||||
of \fBpivot_root\fP() may change in the future. At the time of writing,
|
||||
\fBpivot_root\fP() changes root and cwd of each process or
|
||||
thread to \fInew_root\fP if they point to the old root directory. This
|
||||
is necessary in order to prevent kernel threads from keeping the old
|
||||
root directory busy with their root and cwd, even if they never access
|
||||
the file system in any way. In the future, there may be a mechanism for
|
||||
kernel threads to explicitly relinquish any access to the file system,
|
||||
such that this fairly intrusive mechanism can be removed from
|
||||
\fBpivot_root\fP.
|
||||
\fBpivot_root\fP().
|
||||
|
||||
Note that this also applies to the current process: \fBpivot_root\fP may
|
||||
Note that this also applies to the current process: \fBpivot_root\fP() may
|
||||
or may not affect its cwd. It is therefore recommended to call
|
||||
\fBchdir("/")\fP immediately after \fBpivot_root\fP.
|
||||
\fBchdir("/")\fP immediately after \fBpivot_root\fP().
|
||||
|
||||
The following restrictions apply to \fInew_root\fP and \fIput_old\fP:
|
||||
.IP \- 3
|
||||
|
@ -67,7 +67,7 @@ No other file system may be mounted on \fIput_old\fP.
|
|||
See also \fBpivot_root(8)\fP for additional usage examples.
|
||||
|
||||
If the current root is not a mount point (e.g. after \fBchroot(2)\fP or
|
||||
\fBpivot_root\fP, see also below), not the old root directory, but the
|
||||
\fBpivot_root\fP(), see also below), not the old root directory, but the
|
||||
mount point of that file system is mounted on \fIput_old\fP.
|
||||
.SH NOTES
|
||||
\fInew_root\fP does not have to be a mount point. In this case,
|
||||
|
@ -77,7 +77,7 @@ mount point of that file system is mounted on \fIput_old\fP.
|
|||
On success, zero is returned. On error, \-1 is returned, and
|
||||
\fIerrno\fP is set appropriately.
|
||||
.SH ERRORS
|
||||
\fBpivot_root\fP may return (in \fIerrno\fP) any of the errors returned by
|
||||
\fBpivot_root\fP() may return (in \fIerrno\fP) any of the errors returned by
|
||||
\fBstat(2)\fP. Additionally, it may return:
|
||||
|
||||
.TP
|
||||
|
@ -96,15 +96,15 @@ The current process does not have the
|
|||
.B CAP_SYS_ADMIN
|
||||
capability.
|
||||
.SH BUGS
|
||||
\fBpivot_root\fP should not have to change root and cwd of all other
|
||||
\fBpivot_root\fP() should not have to change root and cwd of all other
|
||||
processes in the system.
|
||||
|
||||
Some of the more obscure uses of \fBpivot_root\fP may quickly lead to
|
||||
Some of the more obscure uses of \fBpivot_root\fP() may quickly lead to
|
||||
insanity.
|
||||
.SH "CONFORMING TO"
|
||||
\fBpivot_root\fP is Linux-specific and hence is not portable.
|
||||
\fBpivot_root\fP() is Linux-specific and hence is not portable.
|
||||
.SH HISTORY
|
||||
\fBpivot_root\fP was introduced in Linux 2.3.41.
|
||||
\fBpivot_root\fP() was introduced in Linux 2.3.41.
|
||||
.SH "SEE ALSO"
|
||||
.BR chdir (2),
|
||||
.BR chroot (2),
|
||||
|
|
|
@ -33,7 +33,7 @@ posix_fadvise \- predeclare an access pattern for file data
|
|||
.BI "int posix_fadvise(int " fd ", off_t " offset ", off_t " len ", int " advice ");"
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
Programs can use \fBposix_fadvise\fP to announce an intention to access
|
||||
Programs can use \fBposix_fadvise\fP() to announce an intention to access
|
||||
file data in a specific pattern in the future, thus allowing the kernel
|
||||
to perform appropriate optimisations.
|
||||
|
||||
|
@ -80,7 +80,7 @@ An invalid value was specified for \fIadvice\fP.
|
|||
The specified file descriptor refers to a pipe or FIFO. (Linux actually
|
||||
returns EINVAL in this case.)
|
||||
.SH NOTES
|
||||
.BR posix_fadvise
|
||||
.BR posix_fadvise ()
|
||||
appeared in kernel 2.5.60.
|
||||
.\" Actually as fadvise64() -- MTK
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ prctl \- operations on a process
|
|||
.BI "int prctl(int " option ", unsigned long " arg2 ", unsigned long " arg3
|
||||
.BI ", unsigned long " arg4 ", unsigned long " arg5 );
|
||||
.SH DESCRIPTION
|
||||
.B prctl
|
||||
.BR prctl ()
|
||||
is called with a first argument describing what to do
|
||||
(with values defined in <\fIlinux/prctl.h\fP>), and further
|
||||
parameters with a significance depending on the first one.
|
||||
|
|
|
@ -60,24 +60,24 @@ The file referenced by
|
|||
must be capable of seeking.
|
||||
.SH "RETURN VALUE"
|
||||
On success, the number of bytes read or written is returned (zero
|
||||
indicates that nothing was written, in the case of \fBpwrite\fR, or
|
||||
indicates that nothing was written, in the case of \fBpwrite\fR(), or
|
||||
end of file, in the case of \fBpread\fR), or \-1 on error, in which
|
||||
case
|
||||
.I errno
|
||||
is set to indicate the error.
|
||||
.SH ERRORS
|
||||
.B pread
|
||||
.BR pread ()
|
||||
can fail and set
|
||||
.I errno
|
||||
to any error specified for \fBread\fR(2) or \fBlseek\fR(2).
|
||||
.B pwrite
|
||||
.BR pwrite ()
|
||||
can fail and set
|
||||
.I errno
|
||||
to any error specified for \fBwrite\fR(2) or \fBlseek\fR(2).
|
||||
.SH "CONFORMING TO"
|
||||
Unix98
|
||||
.SH HISTORY
|
||||
The \fBpread\fR and \fBpwrite\fR system calls were added to Linux in
|
||||
The \fBpread\fR() and \fBpwrite\fR() system calls were added to Linux in
|
||||
version 2.1.60; the entries in the i386 system call table were added
|
||||
in 2.1.69. The libc support (including emulation on older kernels
|
||||
without the system calls) was added in glibc 2.1.
|
||||
|
|
|
@ -44,7 +44,7 @@ ptrace \- process trace
|
|||
.BI "long ptrace(enum __ptrace_request " request ", pid_t " pid ", void *" addr ", void *" data );
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B ptrace
|
||||
.BR ptrace ()
|
||||
system call provides a means by which a parent process may observe and control
|
||||
the execution of another process, and examine and change its core image and
|
||||
registers. It is primarily used to implement breakpoint debugging and system
|
||||
|
@ -92,7 +92,7 @@ PTRACE_PEEKTEXT, PTRACE_PEEKDATA
|
|||
Reads a word at the location
|
||||
.IR addr
|
||||
in the child's memory, returning the word as the result of the
|
||||
.B ptrace
|
||||
.BR ptrace ()
|
||||
call. Linux does not have separate text and data address spaces, so the two
|
||||
requests are currently equivalent. (The argument \fIdata\fP is ignored.)
|
||||
.TP
|
||||
|
@ -103,7 +103,7 @@ in the child's
|
|||
.B USER
|
||||
area, which holds the registers and other information about the process (see
|
||||
<linux/user.h> and <sys/user.h>). The word is returned as the result of the
|
||||
.B ptrace
|
||||
.BR ptrace ()
|
||||
call. Typically the offset must be word-aligned, though this might vary by
|
||||
architecture. (\fIdata\fP is ignored.)
|
||||
.TP
|
||||
|
@ -181,9 +181,9 @@ can be detached in this way regardless of which method was used to initiate
|
|||
tracing. (\fIaddr\fP is ignored.)
|
||||
.SH NOTES
|
||||
Although arguments to
|
||||
.B ptrace
|
||||
.BR ptrace ()
|
||||
are interpreted according to the prototype given, GNU libc currently declares
|
||||
.B ptrace
|
||||
.BR ptrace ()
|
||||
as a variadic function with only the \fIrequest\fP argument fixed. This means
|
||||
that unneeded trailing arguments may be omitted, though doing so makes use of
|
||||
undocumented
|
||||
|
@ -207,17 +207,17 @@ when it stops, and there is no way for the new parent to effectively simulate
|
|||
this notification.
|
||||
.LP
|
||||
This page documents the way the
|
||||
.B ptrace
|
||||
.BR ptrace ()
|
||||
call works currently in Linux. Its behavior differs noticeably on other
|
||||
flavors of Unix. In any case, use of
|
||||
.B ptrace
|
||||
.BR ptrace ()
|
||||
is highly OS- and architecture-specific.
|
||||
.LP
|
||||
The SunOS man page describes
|
||||
.B ptrace
|
||||
.BR ptrace ()
|
||||
as "unique and arcane", which it is. The proc-based debugging interface
|
||||
present in Solaris 2 implements a superset of
|
||||
.B ptrace
|
||||
.BR ptrace ()
|
||||
functionality in a more powerful and uniform way.
|
||||
.SH "RETURN VALUE"
|
||||
On success, PTRACE_PEEK* requests return the requested data, while other requests
|
||||
|
|
|
@ -48,7 +48,7 @@ the user cannot be above the soft limit for more than one week (by default)
|
|||
at a time: after this week the soft limit counts as hard limit.
|
||||
|
||||
The
|
||||
.B quotactl
|
||||
.BR quotactl ()
|
||||
system call manipulates these quota. Its first argument is
|
||||
of the form
|
||||
.BI QCMD( subcmd , type )
|
||||
|
@ -115,7 +115,7 @@ Get collected stats.
|
|||
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B quotactl
|
||||
.BR quotactl ()
|
||||
returns 0. On error, \-1 is returned, and
|
||||
.I errno
|
||||
is set appropriately.
|
||||
|
|
|
@ -112,7 +112,7 @@ refers to a directory.
|
|||
Other errors may occur, depending on the object connected to
|
||||
.IR fd .
|
||||
POSIX allows a
|
||||
.B read
|
||||
.BR read ()
|
||||
that is interrupted after reading some data
|
||||
to return \-1 (with
|
||||
.I errno
|
||||
|
|
|
@ -73,7 +73,7 @@ is not a valid file descriptor or is not open for reading.
|
|||
.B EINVAL
|
||||
.I fd
|
||||
does not refer to a file type to which
|
||||
.B readahead
|
||||
.BR readahead ()
|
||||
can be applied.
|
||||
.SH "CONFORMING TO"
|
||||
The
|
||||
|
|
|
@ -51,7 +51,7 @@ This page documents the bare kernel system call interface,
|
|||
which can change, and which is superseded by
|
||||
.BR getdents (2).
|
||||
.PP
|
||||
.B readdir
|
||||
.BR readdir ()
|
||||
reads one
|
||||
.I dirent
|
||||
structure from the directory
|
||||
|
|
|
@ -43,14 +43,14 @@ readlink \- read value of a symbolic link
|
|||
.sp
|
||||
.BI "int readlink(const char *" path ", char *" buf ", size_t " bufsiz );
|
||||
.SH DESCRIPTION
|
||||
.B readlink
|
||||
.BR readlink ()
|
||||
places the contents of the symbolic link
|
||||
.I path
|
||||
in the buffer
|
||||
.IR buf ,
|
||||
which has size
|
||||
.IR bufsiz .
|
||||
.B readlink
|
||||
.BR readlink ()
|
||||
does not append a
|
||||
.B NUL
|
||||
character to
|
||||
|
@ -100,7 +100,7 @@ Insufficient kernel memory was available.
|
|||
A component of the path prefix is not a directory.
|
||||
.SH "CONFORMING TO"
|
||||
X/OPEN, 4.4BSD (the
|
||||
.B readlink
|
||||
.BR readlink ()
|
||||
function call appeared in 4.2BSD).
|
||||
.SH "SEE ALSO"
|
||||
.BR lstat (2),
|
||||
|
|
|
@ -47,7 +47,7 @@ system call:
|
|||
.BI "int reboot(int " flag );
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B reboot
|
||||
.BR reboot ()
|
||||
call reboots the system, or enables/disables the reboot keystroke
|
||||
(abbreviated CAD, since the default is Ctrl-Alt-Delete;
|
||||
it can be changed using
|
||||
|
@ -136,12 +136,12 @@ Bad magic numbers or \fIflag\fP.
|
|||
.TP
|
||||
.B EPERM
|
||||
The calling process has insufficient privilege to call
|
||||
.BR reboot ;
|
||||
.BR reboot ();
|
||||
the
|
||||
.B CAP_SYS_BOOT
|
||||
capability is required.
|
||||
.SH "CONFORMING TO"
|
||||
.B reboot
|
||||
.BR reboot ()
|
||||
is Linux specific, and should not be used in programs intended to be portable.
|
||||
.SH "SEE ALSO"
|
||||
.BR sync (2),
|
||||
|
|
12
man2/recv.2
12
man2/recv.2
|
@ -54,9 +54,9 @@ recv, recvfrom, recvmsg \- receive a message from a socket
|
|||
.BI "ssize_t recvmsg(int " s ", struct msghdr *" msg ", int " flags );
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B recvfrom
|
||||
.BR recvfrom ()
|
||||
and
|
||||
.B recvmsg
|
||||
.BR recvmsg ()
|
||||
calls are used to receive messages from a socket, and may be used
|
||||
to receive data on a socket whether or not it is connection-oriented.
|
||||
.PP
|
||||
|
@ -81,13 +81,13 @@ and modified on return to indicate the actual size of the address stored
|
|||
there.
|
||||
.PP
|
||||
The
|
||||
.B recv
|
||||
.BR recv ()
|
||||
call is normally used only on a
|
||||
.I connected
|
||||
socket (see
|
||||
.BR connect (2))
|
||||
and is identical to
|
||||
.B recvfrom
|
||||
.BR recvfrom ()
|
||||
with a NULL
|
||||
.I from
|
||||
parameter.
|
||||
|
@ -235,7 +235,7 @@ is regenerated based on the next queued error and will be passed
|
|||
on the next socket operation.
|
||||
.PP
|
||||
The
|
||||
.B recvmsg
|
||||
.BR recvmsg ()
|
||||
call uses a
|
||||
.I msghdr
|
||||
structure to minimize the number of directly supplied parameters. This
|
||||
|
@ -277,7 +277,7 @@ which has length
|
|||
.IR msg_controllen ,
|
||||
points to a buffer for other protocol control related messages or
|
||||
miscellaneous ancillary data. When
|
||||
.B recvmsg
|
||||
.BR recvmsg ()
|
||||
is called,
|
||||
.I msg_controllen
|
||||
should contain the length of the available buffer in
|
||||
|
|
|
@ -49,22 +49,22 @@ data).
|
|||
A complete overview of extended attributes concepts can be found in
|
||||
.BR attr (5).
|
||||
.PP
|
||||
.B removexattr
|
||||
.BR removexattr ()
|
||||
removes the extended attribute identified by
|
||||
.I name
|
||||
and associated with the given
|
||||
.I path
|
||||
in the filesystem.
|
||||
.PP
|
||||
.B lremovexattr
|
||||
.BR lremovexattr ()
|
||||
is identical to
|
||||
.BR removexattr ,
|
||||
.BR removexattr (),
|
||||
except in the case of a symbolic link, where the extended attribute is
|
||||
removed from the link itself, not the file that it refers to.
|
||||
.PP
|
||||
.B fremovexattr
|
||||
.BR fremovexattr ()
|
||||
is identical to
|
||||
.BR removexattr ,
|
||||
.BR removexattr (),
|
||||
only the extended attribute is removed from the open file pointed to by
|
||||
.I filedes
|
||||
(as returned by
|
||||
|
|
|
@ -36,7 +36,7 @@ rename \- change the name or location of a file
|
|||
.sp
|
||||
.BI "int rename(const char *" oldpath ", const char *" newpath );
|
||||
.SH DESCRIPTION
|
||||
.B rename
|
||||
.BR rename ()
|
||||
renames a file, moving it between directories if required.
|
||||
|
||||
Any other hard links to the file (as created using
|
||||
|
@ -54,7 +54,7 @@ will find it missing.
|
|||
If
|
||||
.I newpath
|
||||
exists but the operation fails for some reason
|
||||
.B rename
|
||||
.BR rename ()
|
||||
guarantees to leave an instance of
|
||||
.I newpath
|
||||
in place.
|
||||
|
|
|
@ -35,7 +35,7 @@ rmdir \- delete a directory
|
|||
.sp
|
||||
.BI "int rmdir(const char *" pathname );
|
||||
.SH DESCRIPTION
|
||||
.B rmdir
|
||||
.BR rmdir ()
|
||||
deletes a directory, which must be empty.
|
||||
.SH "RETURN VALUE"
|
||||
On success, zero is returned. On error, \-1 is returned, and
|
||||
|
|
|
@ -38,10 +38,10 @@ sched_get_priority_max, sched_get_priority_min \- get static priority range
|
|||
\fBint sched_get_priority_min(int \fIpolicy\fB);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.B sched_get_priority_max
|
||||
.BR sched_get_priority_max ()
|
||||
returns the maximum priority value that can be used with the
|
||||
scheduling algorithm identified by \fIpolicy\fR.
|
||||
.B sched_get_priority_min
|
||||
.BR sched_get_priority_min ()
|
||||
returns the minimum priority value that can be used with the
|
||||
scheduling algorithm identified by \fIpolicy\fR. Supported \fIpolicy\fR
|
||||
values are
|
||||
|
@ -52,8 +52,8 @@ and
|
|||
|
||||
Processes with numerically higher priority values are scheduled before
|
||||
processes with numerically lower priority values. Thus, the value
|
||||
returned by \fBsched_get_priority_max\fR will be greater than the
|
||||
value returned by \fBsched_get_priority_min\fR.
|
||||
returned by \fBsched_get_priority_max\fR() will be greater than the
|
||||
value returned by \fBsched_get_priority_min\fR().
|
||||
|
||||
Linux allows the static priority value range 1 to 99 for
|
||||
\fISCHED_FIFO\fR and \fISCHED_RR\fR and the priority 0 for
|
||||
|
@ -63,23 +63,23 @@ are not alterable.
|
|||
The range of scheduling priorities may vary on other POSIX systems,
|
||||
thus it is a good idea for portable applications to use a virtual
|
||||
priority range and map it to the interval given by
|
||||
\fBsched_get_priority_max\fR and \fBsched_get_priority_min\fR.
|
||||
\fBsched_get_priority_max\fR() and \fBsched_get_priority_min\fR().
|
||||
POSIX.1b requires a spread of at least 32 between the maximum and the
|
||||
minimum values for \fISCHED_FIFO\fR and \fISCHED_RR\fR.
|
||||
|
||||
POSIX systems on which
|
||||
.B sched_get_priority_max
|
||||
.BR sched_get_priority_max ()
|
||||
and
|
||||
.B sched_get_priority_min
|
||||
.BR sched_get_priority_min ()
|
||||
are available define
|
||||
.I _POSIX_PRIORITY_SCHEDULING
|
||||
in <unistd.h>.
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B sched_get_priority_max
|
||||
.BR sched_get_priority_max ()
|
||||
and
|
||||
.B sched_get_priority_min
|
||||
.BR sched_get_priority_min ()
|
||||
return the maximum/minimum priority value for the named scheduling
|
||||
policy.
|
||||
On error, \-1 is returned,
|
||||
|
|
|
@ -44,7 +44,7 @@ sched_rr_get_interval \- get the SCHED_RR interval for the named process
|
|||
.ta
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.B sched_rr_get_interval
|
||||
.BR sched_rr_get_interval ()
|
||||
writes into the \fItimespec\fR structure pointed to by \fItp\fR the
|
||||
round robin time quantum for the process identified by \fIpid\fR. If
|
||||
\fIpid\fR is zero, the time quantum for the calling process is written
|
||||
|
@ -56,14 +56,14 @@ The round robin time quantum value is not alterable under Linux
|
|||
1.3.81.
|
||||
|
||||
POSIX systems on which
|
||||
.B sched_rr_get_interval
|
||||
.BR sched_rr_get_interval ()
|
||||
is available define
|
||||
.I _POSIX_PRIORITY_SCHEDULING
|
||||
in <unistd.h>.
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B sched_rr_get_interval
|
||||
.BR sched_rr_get_interval ()
|
||||
returns 0.
|
||||
On error, \-1 is returned, and
|
||||
.I errno
|
||||
|
@ -84,7 +84,7 @@ The process whose ID is \fIpid\fR could not be found.
|
|||
.SH "CONFORMING TO"
|
||||
POSIX.1b (formerly POSIX.4)
|
||||
.SH BUGS
|
||||
As of Linux 1.3.81 \fBsched_rr_get_interval\fR returns with error
|
||||
As of Linux 1.3.81 \fBsched_rr_get_interval\fR() returns with error
|
||||
ENOSYS, because SCHED_RR has not yet been fully implemented and tested
|
||||
properly.
|
||||
.SH "SEE ALSO"
|
||||
|
|
|
@ -41,7 +41,7 @@ affinity mask
|
|||
.BI "int sched_getaffinity(pid_t " pid ", unsigned int " len ,
|
||||
.BI "unsigned long *" mask );
|
||||
.SH DESCRIPTION
|
||||
.B sched_setaffinity
|
||||
.BR sched_setaffinity ()
|
||||
sets the CPU affinity mask of the process denoted by
|
||||
.IR pid .
|
||||
If
|
||||
|
@ -75,7 +75,7 @@ future versions of the Linux kernel, since this size can change, the bitmask
|
|||
supplied must be at least as large as the affinity mask stored in the kernel.
|
||||
.sp
|
||||
The function
|
||||
.B sched_getaffinity
|
||||
.BR sched_getaffinity ()
|
||||
writes into the pointer supplied by
|
||||
.I mask
|
||||
that has size
|
||||
|
@ -88,14 +88,14 @@ is zero, then the mask of the current process is returned.
|
|||
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B sched_setaffinity
|
||||
.BR sched_setaffinity ()
|
||||
returns 0.
|
||||
On error, \-1 is returned, and
|
||||
.I errno
|
||||
is set appropriately.
|
||||
|
||||
On success,
|
||||
.B sched_getaffinity
|
||||
.BR sched_getaffinity ()
|
||||
always returns the size (in bytes) of the affinity mask used by the kernel.
|
||||
On error, \-1 is returned, and
|
||||
.I errno
|
||||
|
@ -116,7 +116,7 @@ is smaller than the size of the affinity mask used by the kernel.
|
|||
.B EPERM
|
||||
The calling process does not have appropriate privileges.
|
||||
The process calling
|
||||
.BR sched_setaffinity
|
||||
.BR sched_setaffinity ()
|
||||
needs an effective user ID equal to the user ID or effective user ID
|
||||
of the process identified by
|
||||
.IR pid ,
|
||||
|
|
|
@ -48,7 +48,7 @@ sched_setparam, sched_getparam \- set and get scheduling parameters
|
|||
.ta
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.B sched_setparam
|
||||
.BR sched_setparam ()
|
||||
sets the scheduling parameters associated with the scheduling policy
|
||||
for the process identified by \fIpid\fR. If \fIpid\fR is zero, then
|
||||
the parameters of the current process are set. The interpretation of
|
||||
|
@ -59,12 +59,12 @@ following three scheduling policies are supported under Linux:
|
|||
and
|
||||
.IR SCHED_OTHER .
|
||||
|
||||
.B sched_getparam
|
||||
.BR sched_getparam ()
|
||||
retrieves the scheduling parameters for the
|
||||
process identified by \fIpid\fR. If \fIpid\fR is zero, then the parameters
|
||||
of the current process are retrieved.
|
||||
|
||||
.B sched_setparam
|
||||
.BR sched_setparam ()
|
||||
checks the validity of \fIp\fR for the scheduling policy of the
|
||||
process. The parameter \fIp->sched_priority\fR must lie within the
|
||||
range given by \fBsched_get_priority_min\fR and
|
||||
|
@ -75,18 +75,18 @@ scheduling priority and policy, see
|
|||
.BR sched_setscheduler (2).
|
||||
|
||||
POSIX systems on which
|
||||
.B sched_setparam
|
||||
.BR sched_setparam ()
|
||||
and
|
||||
.B sched_getparam
|
||||
.BR sched_getparam ()
|
||||
are available define
|
||||
.I _POSIX_PRIORITY_SCHEDULING
|
||||
in <unistd.h>.
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.BR sched_setparam
|
||||
.BR sched_setparam ()
|
||||
and
|
||||
.BR sched_getparam
|
||||
.BR sched_getparam ()
|
||||
return 0.
|
||||
On error, \-1 is returned,
|
||||
.I errno
|
||||
|
|
|
@ -55,7 +55,7 @@ set and get scheduling algorithm/parameters
|
|||
.ta
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.B sched_setscheduler
|
||||
.BR sched_setscheduler ()
|
||||
sets both the scheduling policy and the associated parameters for the
|
||||
process identified by \fIpid\fP. If \fIpid\fP equals zero, the
|
||||
scheduler of the calling process will be set. The interpretation of
|
||||
|
@ -67,7 +67,7 @@ and
|
|||
.IR SCHED_OTHER ;
|
||||
their respective semantics are described below.
|
||||
|
||||
.B sched_getscheduler
|
||||
.BR sched_getscheduler ()
|
||||
queries the scheduling policy currently applied to the process
|
||||
identified by \fIpid\fP. If \fIpid\fP equals zero, the policy of the
|
||||
calling process will be retrieved.
|
||||
|
@ -118,7 +118,7 @@ higher priority will stay at the head of the list for its priority and
|
|||
will resume execution as soon as all processes of higher priority are
|
||||
blocked again. When a \fISCHED_FIFO\fP process becomes runnable, it
|
||||
will be inserted at the end of the list for its priority. A call to
|
||||
\fBsched_setscheduler\fP or \fBsched_setparam\fP will put the
|
||||
\fBsched_setscheduler\fP() or \fBsched_setparam\fP will put the
|
||||
\fISCHED_FIFO\fP (or \fISCHED_RR\fP) process identified by
|
||||
\fIpid\fP at the start of the list if it was runnable.
|
||||
As a consequence, it may preempt the currently running process if
|
||||
|
@ -177,7 +177,7 @@ processes can set a non-zero static priority.
|
|||
The only change that an unprivileged process can make is to set the
|
||||
.B SCHED_OTHER
|
||||
policy, and this can only be done if the effective user ID of the caller of
|
||||
.BR sched_setscheduler
|
||||
.BR sched_setscheduler ()
|
||||
matches the real or effective user ID of the target process
|
||||
(i.e., the process specified by
|
||||
.IR pid )
|
||||
|
@ -240,19 +240,19 @@ tested application. This will allow an emergency kill of tested
|
|||
real-time applications that do not block or terminate as expected.
|
||||
|
||||
POSIX systems on which
|
||||
.B sched_setscheduler
|
||||
.BR sched_setscheduler ()
|
||||
and
|
||||
.B sched_getscheduler
|
||||
.BR sched_getscheduler ()
|
||||
are available define
|
||||
.I _POSIX_PRIORITY_SCHEDULING
|
||||
in <unistd.h>.
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.BR sched_setscheduler
|
||||
.BR sched_setscheduler ()
|
||||
returns zero.
|
||||
On success,
|
||||
.BR sched_getscheduler
|
||||
.BR sched_getscheduler ()
|
||||
returns the policy for the process (a non-negative integer).
|
||||
On error, \-1 is returned,
|
||||
.I errno
|
||||
|
|
|
@ -37,24 +37,24 @@ sched_yield \- yield the processor
|
|||
.fi
|
||||
.SH DESCRIPTION
|
||||
A process can relinquish the processor voluntarily without blocking by calling
|
||||
.BR sched_yield .
|
||||
.BR sched_yield ().
|
||||
The process will then be moved to the end of the queue for its static
|
||||
priority and a new process gets to run.
|
||||
|
||||
Note: If the current process is the only process in the highest
|
||||
priority list at that time, this process will continue to run after a
|
||||
call to
|
||||
.BR sched_yield .
|
||||
.BR sched_yield ().
|
||||
|
||||
POSIX systems on which
|
||||
.B sched_yield
|
||||
.BR sched_yield ()
|
||||
is available define
|
||||
.I _POSIX_PRIORITY_SCHEDULING
|
||||
in <unistd.h>.
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B sched_yield
|
||||
.BR sched_yield ()
|
||||
returns 0.
|
||||
On error, \-1 is returned, and
|
||||
.I errno
|
||||
|
|
|
@ -67,40 +67,40 @@ const struct timespec *\fItimeout\fB, const sigset_t *\fIsigmask\fB);
|
|||
.fi
|
||||
.SH DESCRIPTION
|
||||
The functions
|
||||
.B select
|
||||
.BR select ()
|
||||
and
|
||||
.B pselect
|
||||
.BR pselect ()
|
||||
wait for a number of file descriptors to change status.
|
||||
.PP
|
||||
Their function is identical, with three differences:
|
||||
.TP
|
||||
(i)
|
||||
The
|
||||
.B select
|
||||
.BR select ()
|
||||
function uses a timeout that is a
|
||||
.I struct timeval
|
||||
(with seconds and microseconds), while
|
||||
.B pselect
|
||||
.BR pselect ()
|
||||
uses a
|
||||
.I struct timespec
|
||||
(with seconds and nanoseconds).
|
||||
.TP
|
||||
(ii)
|
||||
The
|
||||
.B select
|
||||
.BR select ()
|
||||
function may update the
|
||||
.I timeout
|
||||
parameter to indicate how much time was left. The
|
||||
.B pselect
|
||||
.BR pselect ()
|
||||
function does not change this parameter.
|
||||
.TP
|
||||
(iii)
|
||||
The
|
||||
.B select
|
||||
.BR select ()
|
||||
function has no
|
||||
.I sigmask
|
||||
parameter, and behaves as
|
||||
.B pselect
|
||||
.BR pselect ()
|
||||
called with NULL
|
||||
.IR sigmask .
|
||||
.PP
|
||||
|
@ -118,15 +118,15 @@ will be watched for exceptions. On exit, the sets are modified in place
|
|||
to indicate which descriptors actually changed status.
|
||||
.PP
|
||||
Four macros are provided to manipulate the sets.
|
||||
.B FD_ZERO
|
||||
.BR FD_ZERO ()
|
||||
will clear a set.
|
||||
.B FD_SET
|
||||
.BR FD_SET ()
|
||||
and
|
||||
.B FD_CLR
|
||||
.BR FD_CLR ()
|
||||
add or remove a given descriptor from a set.
|
||||
.B FD_ISSET
|
||||
.BR FD_ISSET ()
|
||||
tests to see if a descriptor is part of the set; this is useful after
|
||||
.B select
|
||||
.BR select ()
|
||||
returns.
|
||||
.PP
|
||||
.I n
|
||||
|
@ -134,27 +134,27 @@ is the highest-numbered descriptor in any of the three sets, plus 1.
|
|||
.PP
|
||||
.I timeout
|
||||
is an upper bound on the amount of time elapsed before
|
||||
.B select
|
||||
.BR select ()
|
||||
returns. It may be zero, causing
|
||||
.B select
|
||||
.BR select ()
|
||||
to return immediately. (This is useful for polling.) If
|
||||
.I timeout
|
||||
is NULL (no timeout),
|
||||
.B select
|
||||
.BR select ()
|
||||
can block indefinitely.
|
||||
.PP
|
||||
.I sigmask
|
||||
is a pointer to a signal mask (see
|
||||
.BR sigprocmask (2));
|
||||
if it is not NULL, then
|
||||
.B pselect
|
||||
.BR pselect ()
|
||||
first replaces the current signal mask by the one pointed to by
|
||||
.IR sigmask ,
|
||||
then does the `select' function, and then restores the original
|
||||
signal mask again.
|
||||
.PP
|
||||
The idea of
|
||||
.B pselect
|
||||
.BR pselect ()
|
||||
is that if one wants to wait for an event, either a signal
|
||||
or something on a file descriptor, an atomic test is needed to prevent
|
||||
race conditions. (Suppose the signal handler sets a global flag and
|
||||
|
@ -162,7 +162,7 @@ returns. Then a test of this global flag followed by a call of
|
|||
.BR select ()
|
||||
could hang indefinitely if the signal arrived just after the test
|
||||
but just before the call. On the other hand,
|
||||
.B pselect
|
||||
.BR pselect ()
|
||||
allows one to first block signals, handle the signals that have come in,
|
||||
then call
|
||||
.BR pselect ()
|
||||
|
@ -200,7 +200,7 @@ struct timespec {
|
|||
(However, see below on the POSIX 1003.1-2001 versions.)
|
||||
.PP
|
||||
Some code calls
|
||||
.B select
|
||||
.BR select ()
|
||||
with all three sets empty,
|
||||
.I n
|
||||
zero, and a non-null
|
||||
|
@ -208,7 +208,7 @@ zero, and a non-null
|
|||
as a fairly portable way to sleep with subsecond precision.
|
||||
.PP
|
||||
On Linux, the function
|
||||
.B select
|
||||
.BR select ()
|
||||
modifies
|
||||
.I timeout
|
||||
to reflect the amount of time not slept; most other implementations
|
||||
|
@ -216,11 +216,11 @@ do not do this. This causes problems both when Linux code which reads
|
|||
.I timeout
|
||||
is ported to other operating systems, and when code is ported to Linux
|
||||
that reuses a struct timeval for multiple
|
||||
.BR select s
|
||||
.BR select ()s
|
||||
in a loop without reinitializing it. Consider
|
||||
.I timeout
|
||||
to be undefined after
|
||||
.B select
|
||||
.BR select ()
|
||||
returns.
|
||||
.\" .PP - it is rumoured that:
|
||||
.\" On BSD, when a timeout occurs, the file descriptor bits are not changed.
|
||||
|
@ -228,9 +228,9 @@ returns.
|
|||
.\" Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
|
||||
.SH "RETURN VALUE"
|
||||
On success,
|
||||
.B select
|
||||
.BR select ()
|
||||
and
|
||||
.B pselect
|
||||
.BR pselect ()
|
||||
return the number of descriptors contained in the three returned
|
||||
descriptor sets (that is, the total number of one bits in
|
||||
.IR readfds ,
|
||||
|
@ -258,7 +258,7 @@ is negative or the value contained within
|
|||
is invalid.
|
||||
.TP
|
||||
.B ENOMEM
|
||||
.B select
|
||||
.BR select ()
|
||||
was unable to allocate memory for internal tables.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
|
@ -296,14 +296,14 @@ main(void) {
|
|||
.fi
|
||||
.SH "CONFORMING TO"
|
||||
4.4BSD (the
|
||||
.B select
|
||||
.BR select ()
|
||||
function first appeared in 4.2BSD). Generally portable to/from
|
||||
non-BSD systems supporting clones of the BSD socket layer (including
|
||||
System V variants). However, note that the System V variant typically
|
||||
sets the timeout variable before exit, but the BSD variant does not.
|
||||
.PP
|
||||
The
|
||||
.B pselect
|
||||
.BR pselect ()
|
||||
function is defined in IEEE Std 1003.1g-2000 (POSIX.1g), and part of
|
||||
POSIX 1003.1-2001.
|
||||
It is found in glibc2.1 and later.
|
||||
|
@ -342,20 +342,20 @@ Concerning prototypes, the classical situation is that one should
|
|||
include
|
||||
.I <time.h>
|
||||
for
|
||||
.BR select .
|
||||
.BR select ().
|
||||
The POSIX 1003.1-2001 situation is that one should include
|
||||
.I <sys/select.h>
|
||||
for
|
||||
.B select
|
||||
.BR select ()
|
||||
and
|
||||
.BR pselect .
|
||||
.BR pselect ().
|
||||
Libc4 and libc5 do not have a
|
||||
.I <sys/select.h>
|
||||
header; under glibc 2.0 and later this header exists.
|
||||
Under glibc 2.0 it unconditionally gives the wrong prototype for
|
||||
.BR pselect ,
|
||||
.BR pselect (),
|
||||
under glibc 2.1-2.2.1 it gives
|
||||
.B pselect
|
||||
.BR pselect ()
|
||||
when
|
||||
.B _GNU_SOURCE
|
||||
is defined, under glibc 2.2.2-2.2.4 it gives it when
|
||||
|
@ -363,14 +363,14 @@ is defined, under glibc 2.2.2-2.2.4 it gives it when
|
|||
is defined and has a value of 600 or larger.
|
||||
No doubt, since POSIX 1003.1-2001, it should give the prototype by default.
|
||||
.SH BUGS
|
||||
.B pselect
|
||||
.BR pselect ()
|
||||
is currently emulated with a user-space wrapper that has a race condition.
|
||||
For reliable (and more portable) signal trapping, use the self-pipe trick.
|
||||
(Where a signal handler writes to a pipe whose other end is read by the
|
||||
main loop.)
|
||||
|
||||
Under Linux,
|
||||
.B select
|
||||
.BR select ()
|
||||
may report a socket file descriptor as "ready for reading", while
|
||||
nevertheless a subsequent read blocks. This could for example
|
||||
happen when data has arrived but upon examination has wrong
|
||||
|
|
|
@ -52,11 +52,11 @@ select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- synchronous I/O multiplexi
|
|||
.fi
|
||||
.SH DESCRIPTION
|
||||
|
||||
\fBselect\fP (or \fBpselect\fP) is the pivot function of most C programs that
|
||||
\fBselect\fP() (or \fBpselect\fP) is the pivot function of most C programs that
|
||||
handle more than one simultaneous file descriptor (or socket handle) in an efficient
|
||||
manner. Its principal arguments are three arrays of file descriptors:
|
||||
\fIreadfds\fP, \fIwritefds\fP, and \fIexceptfds\fP. The way that
|
||||
\fBselect\fP is usually used is to block while waiting for a "change of
|
||||
\fBselect\fP() is usually used is to block while waiting for a "change of
|
||||
status" on one or more of the file descriptors. A "change of status" is
|
||||
when more characters become available from the file descriptor, \fIor\fP
|
||||
when space becomes available within the kernel's internal buffers for
|
||||
|
@ -64,34 +64,34 @@ more to be written to the file descriptor, \fIor\fP when a file
|
|||
descriptor goes into error (in the case of a socket or pipe this is
|
||||
when the other end of the connection is closed).
|
||||
|
||||
In summary, \fBselect\fP just watches multiple file descriptors,
|
||||
In summary, \fBselect\fP() just watches multiple file descriptors,
|
||||
and is the standard Unix call to do so.
|
||||
|
||||
The arrays of file descriptors are called \fIfile descriptor sets\fP.
|
||||
Each set is declared as type \fBfd_set\fP, and its contents can be
|
||||
altered with the macros \fBFD_CLR\fP, \fBFD_ISSET\fP, \fBFD_SET\fP, and
|
||||
\fBFD_ZERO\fP. \fBFD_ZERO\fP is usually the first function to be used on
|
||||
altered with the macros \fBFD_CLR\fP(), \fBFD_ISSET\fP(), \fBFD_SET\fP(), and
|
||||
\fBFD_ZERO\fP(). \fBFD_ZERO\fP() is usually the first function to be used on
|
||||
a newly declared set. Thereafter, the individual file descriptors that
|
||||
you are interested in can be added one by one with \fBFD_SET\fP.
|
||||
\fBselect\fP modifies the contents of the sets according to the rules
|
||||
described below; after calling \fBselect\fP you can test if your file
|
||||
descriptor is still present in the set with the \fBFD_ISSET\fP macro.
|
||||
\fBFD_ISSET\fP returns non-zero if the descriptor is present and zero if
|
||||
it is not. \fBFD_CLR\fP removes a file descriptor from the set although
|
||||
you are interested in can be added one by one with \fBFD_SET\fP().
|
||||
\fBselect\fP() modifies the contents of the sets according to the rules
|
||||
described below; after calling \fBselect\fP() you can test if your file
|
||||
descriptor is still present in the set with the \fBFD_ISSET\fP() macro.
|
||||
\fBFD_ISSET\fP() returns non-zero if the descriptor is present and zero if
|
||||
it is not. \fBFD_CLR\fP() removes a file descriptor from the set although
|
||||
I can't see the use for it in a clean program.
|
||||
|
||||
.SH ARGUMENTS
|
||||
.TP
|
||||
\fIreadfds\fP
|
||||
This set is watched to see if data is available for reading from any of
|
||||
its file descriptors. After \fBselect\fP has returned, \fIreadfds\fP will be
|
||||
its file descriptors. After \fBselect\fP() has returned, \fIreadfds\fP will be
|
||||
cleared of all file descriptors except for those file descriptors that
|
||||
are immediately available for reading with a \fBrecv()\fP (for sockets) or
|
||||
\fBread()\fP (for pipes, files, and sockets) call.
|
||||
.TP
|
||||
\fIwritefds\fP
|
||||
This set is watched to see if there is space to write data to any of
|
||||
its file descriptor. After \fBselect\fP has returned, \fIwritefds\fP will be
|
||||
its file descriptor. After \fBselect\fP() has returned, \fIwritefds\fP will be
|
||||
cleared of all file descriptors except for those file descriptors that
|
||||
are immediately available for writing with a \fBsend()\fP (for sockets) or
|
||||
\fBwrite()\fP (for pipes, files, and sockets) call.
|
||||
|
@ -102,7 +102,7 @@ descriptors. However, that is actually just a rumor. How you use
|
|||
\fIexceptfds\fP is to watch for \fIout\-of\-band\fP (OOB) data. OOB data
|
||||
is data sent on a socket using the \fBMSG_OOB\fP flag, and hence
|
||||
\fIexceptfds\fP only really applies to sockets. See \fBrecv\fP(2) and
|
||||
\fBsend\fP(2) about this. After \fBselect\fP has returned,
|
||||
\fBsend\fP(2) about this. After \fBselect\fP() has returned,
|
||||
\fIexceptfds\fP will be cleared of all file descriptors except for those
|
||||
descriptors that are available for reading OOB data. You can only ever
|
||||
read one byte of OOB data though (which is done with \fBrecv()\fP), and
|
||||
|
@ -115,14 +115,14 @@ This is an integer one more than the maximum of any file descriptor in
|
|||
any of the sets. In other words, while you are busy adding file descriptors
|
||||
to your sets, you must calculate the maximum integer value of all of
|
||||
them, then increment this value by one, and then pass this as \fInfds\fP to
|
||||
\fBselect\fP.
|
||||
\fBselect\fP().
|
||||
.TP
|
||||
\fIutimeout\fP
|
||||
.RS
|
||||
This is the longest time \fBselect\fP must wait before returning, even
|
||||
This is the longest time \fBselect\fP() must wait before returning, even
|
||||
if nothing interesting happened. If this value is passed as \fBNULL\fP,
|
||||
then \fBselect\fP blocks indefinitely waiting for an event.
|
||||
\fIutimeout\fP can be set to zero seconds, which causes \fBselect\fP to
|
||||
then \fBselect\fP() blocks indefinitely waiting for an event.
|
||||
\fIutimeout\fP can be set to zero seconds, which causes \fBselect\fP() to
|
||||
return immediately. The structure \fBstruct timeval\fP is defined as,
|
||||
.PP
|
||||
.nf
|
||||
|
@ -147,29 +147,29 @@ struct timespec {
|
|||
.RE
|
||||
.TP
|
||||
\fIsigmask\fP
|
||||
This argument holds a set of signals to allow while performing a \fBpselect\fP
|
||||
This argument holds a set of signals to allow while performing a \fBpselect\fP()
|
||||
call (see \fBsigaddset\fP(3) and \fBsigprocmask\fP(2)). It can be passed
|
||||
as NULL, in which case it does not modify the set of allowed signals on
|
||||
entry and exit to the function. It will then behave just like \fBselect\fP.
|
||||
entry and exit to the function. It will then behave just like \fBselect\fP().
|
||||
|
||||
.SH COMBINING SIGNAL AND DATA EVENTS
|
||||
\fBpselect\fP must be used if you are waiting for a signal as well as
|
||||
\fBpselect\fP() must be used if you are waiting for a signal as well as
|
||||
data from a file descriptor. Programs that receive signals as events
|
||||
normally use the signal handler only to raise a global flag. The global
|
||||
flag will indicate that the event must be processed in the main loop of
|
||||
the program. A signal will cause the \fBselect\fP (or \fBpselect\fP)
|
||||
the program. A signal will cause the \fBselect\fP() (or \fBpselect\fP)
|
||||
call to return with \fBerrno\fP set to \fBEINTR\fP. This behavior is
|
||||
essential so that signals can be processed in the main loop of the
|
||||
program, otherwise \fBselect\fP would block indefinitely. Now, somewhere
|
||||
program, otherwise \fBselect\fP() would block indefinitely. Now, somewhere
|
||||
in the main loop will be a conditional to check the global flag. So we
|
||||
must ask: what if a signal arrives after the conditional, but before the
|
||||
\fBselect\fP call? The answer is that \fBselect\fP would block
|
||||
\fBselect\fP() call? The answer is that \fBselect\fP() would block
|
||||
indefinitely, even though an event is actually pending. This race
|
||||
condition is solved by the \fBpselect\fP call. This call can be used to
|
||||
condition is solved by the \fBpselect\fP() call. This call can be used to
|
||||
mask out signals that are not to be received except within the
|
||||
\fBpselect\fP call. For instance, let us say that the event in question
|
||||
\fBpselect\fP() call. For instance, let us say that the event in question
|
||||
was the exit of a child process. Before the start of the main loop, we
|
||||
would block \fBSIGCHLD\fP using \fBsigprocmask\fP. Our \fBpselect\fP
|
||||
would block \fBSIGCHLD\fP using \fBsigprocmask\fP. Our \fBpselect\fP()
|
||||
call would enable \fBSIGCHLD\fP by using the virgin signal mask. Our
|
||||
program would look like:
|
||||
.PP
|
||||
|
@ -202,7 +202,7 @@ int main (int argc, char **argv) {
|
|||
}
|
||||
.fi
|
||||
.PP
|
||||
Note that the above \fBpselect\fP call can be replaced with:
|
||||
Note that the above \fBpselect\fP() call can be replaced with:
|
||||
.PP
|
||||
.nf
|
||||
sigprocmask (SIG_BLOCK, &orig_sigmask, 0);
|
||||
|
@ -212,10 +212,10 @@ Note that the above \fBpselect\fP call can be replaced with:
|
|||
.PP
|
||||
but then there is still the possibility that a signal
|
||||
could arrive after the first \fBsigprocmask\fP and before
|
||||
the \fBselect\fP. If you do do this, it is prudent to
|
||||
the \fBselect\fP(). If you do do this, it is prudent to
|
||||
at least put a finite timeout so that the process does
|
||||
not block. At present glibc probably works this way.
|
||||
The Linux kernel does not have a native \fBpselect\fP
|
||||
The Linux kernel does not have a native \fBpselect\fP()
|
||||
system call as yet so this is all probably much of a
|
||||
moot point.
|
||||
.PP
|
||||
|
@ -233,9 +233,9 @@ file descriptor where the data flow may be intermittent. If you were to
|
|||
merely create a sequence of \fBread\fP and \fBwrite\fP calls, you would
|
||||
find that one of your calls may block waiting for data from/to a file
|
||||
descriptor, while another file descriptor is unused though available
|
||||
for data. \fBselect\fP efficiently copes with this situation.
|
||||
for data. \fBselect\fP() efficiently copes with this situation.
|
||||
|
||||
A classic example of \fBselect\fP comes from the \fBselect\fP
|
||||
A classic example of \fBselect\fP() comes from the \fBselect\fP()
|
||||
man page:
|
||||
|
||||
.nf
|
||||
|
@ -276,7 +276,7 @@ main(void) {
|
|||
.SH PORT FORWARDING EXAMPLE
|
||||
|
||||
Here is an example that better demonstrates the true utility of
|
||||
\fBselect\fP.
|
||||
\fBselect\fP().
|
||||
The listing below is a TCP forwarding program that forwards
|
||||
from one TCP port to another.
|
||||
.PP
|
||||
|
@ -572,18 +572,18 @@ connections cause the current connection to be dropped.
|
|||
|
||||
.SH SELECT LAW
|
||||
|
||||
Many people who try to use \fBselect\fP come across behavior that is
|
||||
Many people who try to use \fBselect\fP() come across behavior that is
|
||||
difficult to understand and produces non-portable or borderline
|
||||
results. For instance, the above program is carefully written not to
|
||||
block at any point, even though it does not set its file descriptors to
|
||||
non-blocking mode at all (see \fBioctl\fP(2)). It is easy to introduce
|
||||
subtle errors that will remove the advantage of using \fBselect\fP,
|
||||
subtle errors that will remove the advantage of using \fBselect\fP(),
|
||||
hence I will present a list of essentials to watch for when using the
|
||||
\fBselect\fP call.
|
||||
\fBselect\fP() call.
|
||||
|
||||
.TP
|
||||
\fB1.\fP
|
||||
You should always try use \fBselect\fP without a timeout. Your program
|
||||
You should always try use \fBselect\fP() without a timeout. Your program
|
||||
should have nothing to do if there is no data available. Code that
|
||||
depends on timeouts is not usually portable and difficult to debug.
|
||||
.TP
|
||||
|
@ -593,11 +593,11 @@ explained above.
|
|||
.TP
|
||||
\fB3.\fP
|
||||
No file descriptor must be added to any set if you do not intend
|
||||
to check its result after the \fBselect\fP call, and respond
|
||||
to check its result after the \fBselect\fP() call, and respond
|
||||
appropriately. See next rule.
|
||||
.TP
|
||||
\fB4.\fP
|
||||
After \fBselect\fP returns, all file descriptors in all sets
|
||||
After \fBselect\fP() returns, all file descriptors in all sets
|
||||
\fImust\fP be checked. Any file descriptor that is available
|
||||
for writing \fImust\fP be written to, and any file descriptor
|
||||
available for reading \fImust\fP be read, etc.
|
||||
|
@ -645,13 +645,13 @@ I close the descriptor immediately, and then set it to \-1
|
|||
to prevent it being included in a set.
|
||||
.TP
|
||||
\fB10.\fP
|
||||
The timeout value must be initialized with each new call to \fBselect\fP,
|
||||
since some operating systems modify the structure. \fBpselect\fP
|
||||
The timeout value must be initialized with each new call to \fBselect\fP(),
|
||||
since some operating systems modify the structure. \fBpselect\fP()
|
||||
however does not modify its timeout structure.
|
||||
.TP
|
||||
\fB11.\fP
|
||||
I have heard that the Windows socket layer does not cope with OOB data
|
||||
properly. It also does not cope with \fBselect\fP calls when no file
|
||||
properly. It also does not cope with \fBselect\fP() calls when no file
|
||||
descriptors are set at all. Having no file descriptors set is a useful
|
||||
way to sleep the process with sub-second precision by using the timeout.
|
||||
(See further on.)
|
||||
|
@ -659,7 +659,7 @@ way to sleep the process with sub-second precision by using the timeout.
|
|||
.SH USLEEP EMULATION
|
||||
|
||||
On systems that do not have a \fBusleep\fP function, you can call
|
||||
\fBselect\fP with a finite timeout and no file descriptors as
|
||||
\fBselect\fP() with a finite timeout and no file descriptors as
|
||||
follows:
|
||||
.PP
|
||||
.nf
|
||||
|
@ -673,17 +673,17 @@ This is only guaranteed to work on Unix systems, however.
|
|||
|
||||
.SH RETURN VALUE
|
||||
|
||||
On success, \fBselect\fP returns the total number of file descriptors
|
||||
On success, \fBselect\fP() returns the total number of file descriptors
|
||||
still present in the file descriptor sets.
|
||||
|
||||
If \fBselect\fP timed out, then the file descriptors sets should be all
|
||||
If \fBselect\fP() timed out, then the file descriptors sets should be all
|
||||
empty (but may not be on some systems). However the return value will
|
||||
definitely be zero.
|
||||
|
||||
A return value of \-1 indicates an error, with \fBerrno\fP being
|
||||
set appropriately. In the case of an error, the returned sets and
|
||||
the timeout struct contents are undefined and should not be used.
|
||||
\fBpselect\fP however never modifies \fIntimeout\fP.
|
||||
\fBpselect\fP() however never modifies \fIntimeout\fP.
|
||||
|
||||
.SH ERRORS
|
||||
.TP
|
||||
|
@ -707,27 +707,27 @@ Internal memory allocation failure.
|
|||
|
||||
.SH NOTES
|
||||
Generally speaking, all operating systems that support sockets, also
|
||||
support \fBselect\fP. Some people consider \fBselect\fP to be an
|
||||
support \fBselect\fP(). Some people consider \fBselect\fP() to be an
|
||||
esoteric and rarely used function. Indeed, many types of programs become
|
||||
extremely complicated without it. \fBselect\fP can be used to solve
|
||||
extremely complicated without it. \fBselect\fP() can be used to solve
|
||||
many problems in a portable and efficient way that naive programmers try
|
||||
to solve with threads, forking, IPCs, signals, memory sharing and other
|
||||
dirty methods. \fBpselect\fP is a newer function that is less commonly
|
||||
dirty methods. \fBpselect\fP() is a newer function that is less commonly
|
||||
used.
|
||||
.PP
|
||||
The
|
||||
.BR poll (2)
|
||||
system call has the same functionality as \fBselect\fP,
|
||||
but with less subtle behavior. It is less portable than \fBselect\fP.
|
||||
system call has the same functionality as \fBselect\fP(),
|
||||
but with less subtle behavior. It is less portable than \fBselect\fP().
|
||||
|
||||
.SH CONFORMING TO
|
||||
4.4BSD (the \fBselect\fP function first appeared in 4.2BSD). Generally
|
||||
4.4BSD (the \fBselect\fP() function first appeared in 4.2BSD). Generally
|
||||
portable to/from non-BSD systems supporting clones of the BSD socket
|
||||
layer (including System V variants). However, note that the System V
|
||||
variant typically sets the timeout variable before exit, but the BSD
|
||||
variant does not.
|
||||
.PP
|
||||
The \fBpselect\fP function is defined in IEEE Std 1003.1g-2000 (POSIX.1g).
|
||||
The \fBpselect\fP() function is defined in IEEE Std 1003.1g-2000 (POSIX.1g).
|
||||
It is found in glibc2.1 and later. Glibc2.0 has a function with this name,
|
||||
that however does not take a \fIsigmask\fP parameter.
|
||||
|
||||
|
|
28
man2/send.2
28
man2/send.2
|
@ -53,19 +53,19 @@ send, sendto, sendmsg \- send a message on a socket
|
|||
.BI "int " flags );
|
||||
.SH DESCRIPTION
|
||||
The system calls
|
||||
.BR send ,
|
||||
.BR sendto ,
|
||||
.BR send (),
|
||||
.BR sendto (),
|
||||
and
|
||||
.B sendmsg
|
||||
.BR sendmsg ()
|
||||
are used to transmit a message to another socket.
|
||||
.PP
|
||||
The
|
||||
.B send
|
||||
.BR send ()
|
||||
call may be used only when the socket is in a
|
||||
.I connected
|
||||
state (so that the intended recipient is known).
|
||||
The only difference between
|
||||
.B send
|
||||
.BR send ()
|
||||
and
|
||||
.B write
|
||||
is the presence of
|
||||
|
@ -73,7 +73,7 @@ is the presence of
|
|||
With zero
|
||||
.I flags
|
||||
parameter,
|
||||
.B send
|
||||
.BR send ()
|
||||
is equivalent to
|
||||
.BR write .
|
||||
Also,
|
||||
|
@ -86,7 +86,7 @@ The parameter
|
|||
is the file descriptor of the sending socket.
|
||||
.PP
|
||||
If
|
||||
.B sendto
|
||||
.BR sendto ()
|
||||
is used on a connection-mode (SOCK_STREAM, SOCK_SEQPACKET) socket,
|
||||
the parameters
|
||||
.I to
|
||||
|
@ -100,7 +100,7 @@ with
|
|||
.I tolen
|
||||
specifying its size.
|
||||
For
|
||||
.BR sendmsg ,
|
||||
.BR sendmsg (),
|
||||
the address of the target is given by
|
||||
.IR msg.msg_name ,
|
||||
with
|
||||
|
@ -108,19 +108,19 @@ with
|
|||
specifying its size.
|
||||
.PP
|
||||
For
|
||||
.B send
|
||||
.BR send ()
|
||||
and
|
||||
.BR sendto ,
|
||||
.BR sendto (),
|
||||
the message is found in
|
||||
.I buf
|
||||
and has length
|
||||
.IR len .
|
||||
For
|
||||
.BR sendmsg ,
|
||||
.BR sendmsg (),
|
||||
the message is pointed to by the elements of the array
|
||||
.IR msg.msg_iov .
|
||||
The
|
||||
.B sendmsg
|
||||
.BR sendmsg ()
|
||||
call also allows sending ancillary data (also known as control information).
|
||||
.PP
|
||||
If the message is too long to pass atomically through the
|
||||
|
@ -129,11 +129,11 @@ underlying protocol, the error
|
|||
is returned, and the message is not transmitted.
|
||||
.PP
|
||||
No indication of failure to deliver is implicit in a
|
||||
.BR send .
|
||||
.BR send ().
|
||||
Locally detected errors are indicated by a return value of \-1.
|
||||
.PP
|
||||
When the message does not fit into the send buffer of the socket,
|
||||
.B send
|
||||
.BR send ()
|
||||
normally blocks, unless the socket has been placed in non-blocking I/O
|
||||
mode. In non-blocking mode it would return
|
||||
.B EAGAIN
|
||||
|
|
|
@ -14,30 +14,30 @@ set_thread_area \- Set a Thread Local Storage (TLS) area
|
|||
.sp
|
||||
.BI "int set_thread_area (struct user_desc *" u_info );
|
||||
.SH "DESCRIPTION"
|
||||
.B set_thread_area
|
||||
.BR set_thread_area ()
|
||||
sets an entry in the current thread's Thread Local Storage (TLS) array.
|
||||
The TLS array entry set by
|
||||
.B set_thread_area
|
||||
.BR set_thread_area ()
|
||||
corresponds to the value of
|
||||
.I u_info->entry_number
|
||||
passed in by the user. If this value is in bounds,
|
||||
.B set_thread_area
|
||||
.BR set_thread_area ()
|
||||
copies the TLS descriptor pointed to by
|
||||
.I u_info
|
||||
into the thread's TLS array.
|
||||
.PP
|
||||
When
|
||||
.B set_thread_area
|
||||
.BR set_thread_area ()
|
||||
is passed an
|
||||
.I entry_number
|
||||
of \-1, it uses a free TLS entry. If
|
||||
.B set_thread_area
|
||||
.BR set_thread_area ()
|
||||
finds a free TLS entry, the value of
|
||||
.I u_info->entry_number
|
||||
is set upon return to show which entry was changed.
|
||||
|
||||
.SH "RETURN VALUE"
|
||||
.B set_thread_area
|
||||
.BR set_thread_area ()
|
||||
returns 0 on success, and \-1 on failure, with
|
||||
.I errno
|
||||
set appropriately.
|
||||
|
@ -54,13 +54,13 @@ set appropriately.
|
|||
A free TLS entry could not be located.
|
||||
|
||||
.SH "CONFORMING TO"
|
||||
.B set_thread_area
|
||||
.BR set_thread_area ()
|
||||
is Linux specific and should not be used in programs that are intended
|
||||
to be portable.
|
||||
|
||||
.SH "VERSIONS"
|
||||
A version of
|
||||
.B set_thread_area
|
||||
.BR set_thread_area ()
|
||||
first appeared in Linux 2.5.29.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
|
|
|
@ -63,7 +63,7 @@ is set to
|
|||
the fifth parameter of that system call.
|
||||
.LP
|
||||
The system call
|
||||
.B set_tid_address
|
||||
.BR set_tid_address ()
|
||||
sets the
|
||||
.I clear_child_tid
|
||||
value for the calling process to
|
||||
|
@ -78,7 +78,7 @@ and a
|
|||
call is done. (That is, wake a single process waiting on this futex.)
|
||||
Errors are ignored.
|
||||
.SH "RETURN VALUE"
|
||||
.B set_tid_address
|
||||
.BR set_tid_address ()
|
||||
returns the PID of the current process.
|
||||
.SH HISTORY
|
||||
This call is present since Linux 2.5.48.
|
||||
|
|
|
@ -36,13 +36,13 @@ seteuid, setegid \- set effective user or group ID
|
|||
.br
|
||||
.BI "int setegid(gid_t " egid );
|
||||
.SH DESCRIPTION
|
||||
.B seteuid
|
||||
.BR seteuid ()
|
||||
sets the effective user ID of the current process.
|
||||
Unprivileged user processes may only set the effective user ID to the
|
||||
real user ID, the effective user ID or the saved set-user-ID.
|
||||
|
||||
Precisely the same holds for
|
||||
.B setegid
|
||||
.BR setegid ()
|
||||
with "group" instead of "user".
|
||||
|
||||
.\" When
|
||||
|
@ -86,7 +86,7 @@ Under glibc2.1 it is equivalent to
|
|||
.BI setresuid(\-1, " euid" ,\-1)
|
||||
and hence does not change the saved set-user-ID.
|
||||
Similar remarks hold for
|
||||
.BR setegid .
|
||||
.BR setegid ().
|
||||
.SH "CONFORMING TO"
|
||||
4.3BSD
|
||||
.SH "SEE ALSO"
|
||||
|
|
|
@ -36,7 +36,7 @@ setfsgid \- set group identity used for file system checks
|
|||
.BI "int setfsgid(uid_t " fsgid );
|
||||
.SH DESCRIPTION
|
||||
The system call
|
||||
.B setfsgid
|
||||
.BR setfsgid ()
|
||||
sets the group ID that the Linux kernel uses to check for all accesses
|
||||
to the file system. Normally, the value of
|
||||
.I fsgid
|
||||
|
@ -48,14 +48,14 @@ will also be changed to the new value of the effective group ID.
|
|||
Explicit calls to
|
||||
.B setfsuid
|
||||
and
|
||||
.B setfsgid
|
||||
.BR setfsgid ()
|
||||
are usually only used by programs such as the Linux NFS server that
|
||||
need to change what user and group ID is used for file access without a
|
||||
corresponding change in the real and effective user and group IDs.
|
||||
A change in the normal user IDs for a program such as the NFS server
|
||||
is a security hole that can expose it to unwanted signals. (But see below.)
|
||||
|
||||
.B setfsgid
|
||||
.BR setfsgid ()
|
||||
will only succeed if the caller is the superuser or if
|
||||
.I fsgid
|
||||
matches either the real group ID, effective group ID,
|
||||
|
@ -68,7 +68,7 @@ is returned. On error, the current value of
|
|||
.I fsgid
|
||||
is returned.
|
||||
.SH "CONFORMING TO"
|
||||
.B setfsgid
|
||||
.BR setfsgid ()
|
||||
is Linux specific and should not be used in programs intended to be portable.
|
||||
It is present since Linux 1.1.44 and in libc since libc 4.7.6.
|
||||
.SH BUGS
|
||||
|
|
|
@ -36,7 +36,7 @@ setfsuid \- set user identity used for file system checks
|
|||
.BI "int setfsuid(uid_t " fsuid );
|
||||
.SH DESCRIPTION
|
||||
The system call
|
||||
.B setfsuid
|
||||
.BR setfsuid ()
|
||||
sets the user ID that the Linux kernel uses to check for all accesses
|
||||
to the file system. Normally, the value of
|
||||
.I fsuid
|
||||
|
@ -46,7 +46,7 @@ effective user ID is changed,
|
|||
will also be changed to the new value of the effective user ID.
|
||||
|
||||
Explicit calls to
|
||||
.B setfsuid
|
||||
.BR setfsuid ()
|
||||
and
|
||||
.B setfsgid
|
||||
are usually only used by programs such as the Linux NFS server that
|
||||
|
@ -55,7 +55,7 @@ corresponding change in the real and effective user and group IDs.
|
|||
A change in the normal user IDs for a program such as the NFS server
|
||||
is a security hole that can expose it to unwanted signals. (But see below.)
|
||||
|
||||
.B setfsuid
|
||||
.BR setfsuid ()
|
||||
will only succeed if the caller is the superuser or if
|
||||
.I fsuid
|
||||
matches either the real user ID, effective user ID, saved set-user-ID, or
|
||||
|
@ -68,7 +68,7 @@ is returned. On error, the current value of
|
|||
.I fsuid
|
||||
is returned.
|
||||
.SH "CONFORMING TO"
|
||||
.B setfsuid
|
||||
.BR setfsuid ()
|
||||
is Linux specific and should not be used in programs intended to be portable.
|
||||
It is present since Linux 1.1.44 and in libc since libc 4.7.6.
|
||||
.SH BUGS
|
||||
|
|
|
@ -34,12 +34,12 @@ setgid \- set group identity
|
|||
.sp
|
||||
.BI "int setgid(gid_t " gid );
|
||||
.SH DESCRIPTION
|
||||
.B setgid
|
||||
.BR setgid ()
|
||||
sets the effective group ID of the current process. If the caller is the
|
||||
superuser, the real GID and saved set-group-ID are also set.
|
||||
|
||||
Under Linux,
|
||||
.B setgid
|
||||
.BR setgid ()
|
||||
is implemented like the POSIX version with the _POSIX_SAVED_IDS feature.
|
||||
This allows a set-group-ID program that is not set-user-ID-root
|
||||
to drop all of its group
|
||||
|
|
|
@ -54,7 +54,7 @@ setpgid, getpgid, setpgrp, getpgrp \- set/get process group
|
|||
.br
|
||||
.B pid_t getpgrp(void);
|
||||
.SH DESCRIPTION
|
||||
.B setpgid
|
||||
.BR setpgid ()
|
||||
sets the process group ID of the process specified by
|
||||
.I pid
|
||||
to
|
||||
|
@ -65,13 +65,13 @@ is zero, the process ID of the current process is used. If
|
|||
.I pgid
|
||||
is zero, the process ID of the process specified by
|
||||
.I pid
|
||||
is used. If \fBsetpgid\fP is used to move a process from one process
|
||||
is used. If \fBsetpgid\fP() is used to move a process from one process
|
||||
group to another (as is done by some shells when creating pipelines),
|
||||
both process groups must be part of the same session. In this case,
|
||||
the \fIpgid\fP specifies an existing process group to be joined and the
|
||||
session ID of that group must match the session ID of the joining process.
|
||||
|
||||
.B getpgid
|
||||
.BR getpgid ()
|
||||
returns the process group ID of the process specified by
|
||||
.IR pid .
|
||||
If
|
||||
|
@ -121,13 +121,13 @@ return zero. On error, \-1 is returned, and
|
|||
.I errno
|
||||
is set appropriately.
|
||||
|
||||
.B getpgid
|
||||
.BR getpgid ()
|
||||
returns a process group on success.
|
||||
On error, \-1 is returned, and
|
||||
.I errno
|
||||
is set appropriately.
|
||||
|
||||
.B getpgrp
|
||||
.BR getpgrp ()
|
||||
always returns the current process group.
|
||||
.SH ERRORS
|
||||
.TP
|
||||
|
@ -135,12 +135,12 @@ always returns the current process group.
|
|||
An attempt was made to change the process group ID
|
||||
of one of the children of the calling process and the child had
|
||||
already performed an \fBexecve\fP
|
||||
(\fBsetpgid\fP, \fBsetpgrp\fP).
|
||||
(\fBsetpgid\fP(), \fBsetpgrp\fP).
|
||||
.TP
|
||||
.B EINVAL
|
||||
.I pgid
|
||||
is less than 0
|
||||
(\fBsetpgid\fP, \fBsetpgrp\fP).
|
||||
(\fBsetpgid\fP(), \fBsetpgrp\fP).
|
||||
.TP
|
||||
.B EPERM
|
||||
An attempt was made to move a process into a process group in a
|
||||
|
@ -148,34 +148,34 @@ different session, or to change the process
|
|||
group ID of one of the children of the calling process and the
|
||||
child was in a different session, or to change the process group ID of
|
||||
a session leader
|
||||
(\fBsetpgid\fP, \fBsetpgrp\fP).
|
||||
(\fBsetpgid\fP(), \fBsetpgrp\fP).
|
||||
.TP
|
||||
.B ESRCH
|
||||
For
|
||||
.BR getpgid :
|
||||
.BR getpgid ():
|
||||
.I pid
|
||||
does not match any process.
|
||||
For
|
||||
.BR setpgid :
|
||||
.BR setpgid ():
|
||||
.I pid
|
||||
is not the current process and not a child of the current process.
|
||||
.SH "CONFORMING TO"
|
||||
The functions
|
||||
.B setpgid
|
||||
.BR setpgid ()
|
||||
and
|
||||
.B getpgrp
|
||||
.BR getpgrp ()
|
||||
conform to POSIX.1.
|
||||
The function
|
||||
.B setpgrp
|
||||
.BR setpgrp ()
|
||||
is from 4.2BSD.
|
||||
The function
|
||||
.B getpgid
|
||||
.BR getpgid ()
|
||||
conforms to SVr4.
|
||||
.SH NOTES
|
||||
POSIX took
|
||||
.B setpgid
|
||||
.BR setpgid ()
|
||||
from the BSD function
|
||||
.BR setpgrp .
|
||||
.BR setpgrp ().
|
||||
Also SysV has a function with the same name, but it is identical to
|
||||
.BR setsid (2).
|
||||
.LP
|
||||
|
|
|
@ -35,7 +35,7 @@ setresuid, setresgid \- set real, effective and saved user or group ID
|
|||
.br
|
||||
.BI "int setresgid(gid_t " rgid ", gid_t " egid ", gid_t " sgid );
|
||||
.SH DESCRIPTION
|
||||
.B setresuid
|
||||
.BR setresuid ()
|
||||
sets the real user ID, the effective user ID, and the
|
||||
saved set-user-ID of the current process.
|
||||
|
||||
|
@ -52,7 +52,7 @@ saved set-user-ID to arbitrary values.
|
|||
If one of the parameters equals \-1, the corresponding value is not changed.
|
||||
|
||||
Completely analogously,
|
||||
.B setresgid
|
||||
.BR setresgid ()
|
||||
sets the real GID, effective GID, and saved set-group-ID
|
||||
of the current process,
|
||||
with the same restrictions for non-privileged processes.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue