mirror of https://github.com/mkerrisk/man-pages
Formatted signal names
This commit is contained in:
parent
826bc5db80
commit
8bd58774dc
7
Changes
7
Changes
|
@ -9,6 +9,7 @@ Contributors
|
||||||
The following people contributed notes, ideas, or patches that have
|
The following people contributed notes, ideas, or patches that have
|
||||||
been incorporated in changes in this release:
|
been incorporated in changes in this release:
|
||||||
|
|
||||||
|
Stepan Kasal <kasal@ucw.cz>
|
||||||
|
|
||||||
Apologies if I missed anyone!
|
Apologies if I missed anyone!
|
||||||
|
|
||||||
|
@ -16,6 +17,12 @@ Apologies if I missed anyone!
|
||||||
Global changes
|
Global changes
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
Many many pages
|
||||||
|
mtk
|
||||||
|
Many many formatting fixes
|
||||||
|
|
||||||
|
Stepan Kasal
|
||||||
|
Add section number to .TH line for POSIX pages in man[013]p.
|
||||||
|
|
||||||
|
|
||||||
Changes to individual pages
|
Changes to individual pages
|
||||||
|
|
|
@ -180,7 +180,8 @@ The process name, as set by
|
||||||
.IR "ps \-o comm" ),
|
.IR "ps \-o comm" ),
|
||||||
is reset to the name of the new executable file.
|
is reset to the name of the new executable file.
|
||||||
.IP * 4
|
.IP * 4
|
||||||
The termination signal is reset to SIGCHLD
|
The termination signal is reset to
|
||||||
|
.B SIGCHLD
|
||||||
(see
|
(see
|
||||||
.BR clone (2)).
|
.BR clone (2)).
|
||||||
.PP
|
.PP
|
||||||
|
@ -195,7 +196,9 @@ is executed at program start-up.
|
||||||
.IP * 4
|
.IP * 4
|
||||||
POSIX.1-2001 specifies that the dispositions of any signals that
|
POSIX.1-2001 specifies that the dispositions of any signals that
|
||||||
are ignored or set to the default are left unchanged.
|
are ignored or set to the default are left unchanged.
|
||||||
POSIX.1-2001 specifies one exception: if SIGCHLD is being ignored,
|
POSIX.1-2001 specifies one exception: if
|
||||||
|
.B SIGCHLD
|
||||||
|
is being ignored,
|
||||||
then an implementation may leave the disposition unchanged or
|
then an implementation may leave the disposition unchanged or
|
||||||
reset it to the default; Linux does the former.
|
reset it to the default; Linux does the former.
|
||||||
.IP * 4
|
.IP * 4
|
||||||
|
|
128
man2/fcntl.2
128
man2/fcntl.2
|
@ -376,15 +376,21 @@ and
|
||||||
are used to manage I/O availability signals:
|
are used to manage I/O availability signals:
|
||||||
.TP
|
.TP
|
||||||
.B F_GETOWN
|
.B F_GETOWN
|
||||||
Get the process ID or process group currently receiving SIGIO
|
Get the process ID or process group currently receiving
|
||||||
and SIGURG signals for events on file descriptor
|
.B SIGIO
|
||||||
|
and
|
||||||
|
.B SIGURG
|
||||||
|
signals for events on file descriptor
|
||||||
.IR fd .
|
.IR fd .
|
||||||
Process IDs are returned as positive values;
|
Process IDs are returned as positive values;
|
||||||
process group IDs are returned as negative values (but see BUGS below).
|
process group IDs are returned as negative values (but see BUGS below).
|
||||||
.TP
|
.TP
|
||||||
.B F_SETOWN
|
.B F_SETOWN
|
||||||
Set the process ID or process group ID that will receive SIGIO
|
Set the process ID or process group ID that will receive
|
||||||
and SIGURG signals for events on file descriptor
|
.B SIGIO
|
||||||
|
and
|
||||||
|
.B SIGURG
|
||||||
|
signals for events on file descriptor
|
||||||
.IR fd .
|
.IR fd .
|
||||||
A process ID is specified as a positive value;
|
A process ID is specified as a positive value;
|
||||||
a process group ID is specified as a negative value.
|
a process group ID is specified as a negative value.
|
||||||
|
@ -401,10 +407,13 @@ status flag on a file descriptor by using the
|
||||||
.B F_SETFL
|
.B F_SETFL
|
||||||
command of
|
command of
|
||||||
.BR fcntl ()),
|
.BR fcntl ()),
|
||||||
a SIGIO signal is sent whenever input or output becomes possible
|
a
|
||||||
|
.B SIGIO
|
||||||
|
signal is sent whenever input or output becomes possible
|
||||||
on that file descriptor.
|
on that file descriptor.
|
||||||
.B F_SETSIG
|
.B F_SETSIG
|
||||||
can be used to obtain delivery of a signal other than SIGIO.
|
can be used to obtain delivery of a signal other than
|
||||||
|
.BR SIGIO .
|
||||||
If this permission check fails, then the signal is
|
If this permission check fails, then the signal is
|
||||||
silently discarded.
|
silently discarded.
|
||||||
|
|
||||||
|
@ -421,9 +430,12 @@ If the file descriptor
|
||||||
refers to a socket,
|
refers to a socket,
|
||||||
.B F_SETOWN
|
.B F_SETOWN
|
||||||
also selects
|
also selects
|
||||||
the recipient of SIGURG signals that are delivered when out-of-band
|
the recipient of
|
||||||
|
.B SIGURG
|
||||||
|
signals that are delivered when out-of-band
|
||||||
data arrives on that socket.
|
data arrives on that socket.
|
||||||
(SIGURG is sent in any situation where
|
.RB ( SIGURG
|
||||||
|
is sent in any situation where
|
||||||
.BR select (2)
|
.BR select (2)
|
||||||
would report the socket as having an "exceptional condition".)
|
would report the socket as having an "exceptional condition".)
|
||||||
.\" The following appears to be rubbish. It doesn't seem to
|
.\" The following appears to be rubbish. It doesn't seem to
|
||||||
|
@ -465,7 +477,9 @@ or
|
||||||
.BR getpid (2)
|
.BR getpid (2)
|
||||||
in this scenario.)
|
in this scenario.)
|
||||||
Note, however, that the statements in this paragraph do not apply
|
Note, however, that the statements in this paragraph do not apply
|
||||||
to the SIGURG signal generated for out-of-band data on a socket:
|
to the
|
||||||
|
.B SIGURG
|
||||||
|
signal generated for out-of-band data on a socket:
|
||||||
this signal is always sent to either a process or a process group,
|
this signal is always sent to either a process or a process group,
|
||||||
depending on the value given to
|
depending on the value given to
|
||||||
.BR F_SETOWN .
|
.BR F_SETOWN .
|
||||||
|
@ -480,23 +494,34 @@ process (see
|
||||||
and
|
and
|
||||||
.BR signal (7))
|
.BR signal (7))
|
||||||
and if this limit is reached, then the kernel reverts to
|
and if this limit is reached, then the kernel reverts to
|
||||||
delivering SIGIO, and this signal is delivered to the entire
|
delivering
|
||||||
|
.BR SIGIO ,
|
||||||
|
and this signal is delivered to the entire
|
||||||
process rather than to a specific thread.
|
process rather than to a specific thread.
|
||||||
.\" See fs/fcntl.c::send_sigio_to_task() (2.4/2.6) sources -- MTK, Apr 05
|
.\" See fs/fcntl.c::send_sigio_to_task() (2.4/2.6) sources -- MTK, Apr 05
|
||||||
.TP
|
.TP
|
||||||
.B F_GETSIG
|
.B F_GETSIG
|
||||||
Get the signal sent when input or output becomes possible.
|
Get the signal sent when input or output becomes possible.
|
||||||
A value of zero means SIGIO is sent.
|
A value of zero means
|
||||||
Any other value (including SIGIO) is the
|
.B SIGIO
|
||||||
|
is sent.
|
||||||
|
Any other value (including
|
||||||
|
.BR SIGIO )
|
||||||
|
is the
|
||||||
signal sent instead, and in this case additional info is available to
|
signal sent instead, and in this case additional info is available to
|
||||||
the signal handler if installed with SA_SIGINFO.
|
the signal handler if installed with
|
||||||
|
.BR SA_SIGINFO .
|
||||||
.TP
|
.TP
|
||||||
.B F_SETSIG
|
.B F_SETSIG
|
||||||
Sets the signal sent when input or output becomes possible.
|
Sets the signal sent when input or output becomes possible.
|
||||||
A value of zero means to send the default SIGIO signal.
|
A value of zero means to send the default
|
||||||
|
.B SIGIO
|
||||||
|
signal.
|
||||||
Any other value (including
|
Any other value (including
|
||||||
SIGIO) is the signal to send instead, and in this case additional info
|
.BR SIGIO )
|
||||||
is available to the signal handler if installed with SA_SIGINFO.
|
is the signal to send instead, and in this case additional info
|
||||||
|
is available to the signal handler if installed with
|
||||||
|
.BR SA_SIGINFO .
|
||||||
.sp
|
.sp
|
||||||
Additionally, passing a non-zero value to
|
Additionally, passing a non-zero value to
|
||||||
.B F_SETSIG
|
.B F_SETSIG
|
||||||
|
@ -508,7 +533,9 @@ for more details.
|
||||||
.sp
|
.sp
|
||||||
By using
|
By using
|
||||||
.B F_SETSIG
|
.B F_SETSIG
|
||||||
with a non-zero value, and setting SA_SIGINFO for the
|
with a non-zero value, and setting
|
||||||
|
.B SA_SIGINFO
|
||||||
|
for the
|
||||||
signal handler (see
|
signal handler (see
|
||||||
.BR sigaction (2)),
|
.BR sigaction (2)),
|
||||||
extra information about I/O events is passed to
|
extra information about I/O events is passed to
|
||||||
|
@ -517,7 +544,9 @@ the handler in a
|
||||||
structure.
|
structure.
|
||||||
If the
|
If the
|
||||||
.I si_code
|
.I si_code
|
||||||
field indicates the source is SI_SIGIO, the
|
field indicates the source is
|
||||||
|
.BR SI_SIGIO ,
|
||||||
|
the
|
||||||
.I si_fd
|
.I si_fd
|
||||||
field gives the file descriptor associated with the event.
|
field gives the file descriptor associated with the event.
|
||||||
Otherwise,
|
Otherwise,
|
||||||
|
@ -530,11 +559,14 @@ with
|
||||||
.B O_NONBLOCK
|
.B O_NONBLOCK
|
||||||
set etc.) to determine which file descriptors are available for I/O.
|
set etc.) to determine which file descriptors are available for I/O.
|
||||||
.sp
|
.sp
|
||||||
By selecting a real time signal (value >= SIGRTMIN), multiple
|
By selecting a real time signal (value >=
|
||||||
I/O events may be queued using the same signal numbers.
|
.BR SIGRTMIN ),
|
||||||
|
multiple I/O events may be queued using the same signal numbers.
|
||||||
(Queuing is dependent on available memory).
|
(Queuing is dependent on available memory).
|
||||||
Extra information is available
|
Extra information is available
|
||||||
if SA_SIGINFO is set for the signal handler, as above.
|
if
|
||||||
|
.B SA_SIGINFO
|
||||||
|
is set for the signal handler, as above.
|
||||||
.PP
|
.PP
|
||||||
Using these mechanisms, a program can implement fully asynchronous I/O
|
Using these mechanisms, a program can implement fully asynchronous I/O
|
||||||
without using
|
without using
|
||||||
|
@ -627,7 +659,8 @@ that conflicts with a lease established via
|
||||||
.BR F_SETLEASE ,
|
.BR F_SETLEASE ,
|
||||||
the system call is blocked by the kernel and
|
the system call is blocked by the kernel and
|
||||||
the kernel notifies the lease holder by sending it a signal
|
the kernel notifies the lease holder by sending it a signal
|
||||||
(SIGIO by default).
|
.RB ( SIGIO
|
||||||
|
by default).
|
||||||
The lease holder should respond to receipt of this signal by doing
|
The lease holder should respond to receipt of this signal by doing
|
||||||
whatever cleanup is required in preparation for the file to be
|
whatever cleanup is required in preparation for the file to be
|
||||||
accessed by another process (e.g., flushing cached buffers) and
|
accessed by another process (e.g., flushing cached buffers) and
|
||||||
|
@ -678,16 +711,20 @@ then the call immediately fails with the error
|
||||||
.BR EWOULDBLOCK ,
|
.BR EWOULDBLOCK ,
|
||||||
but the other steps still occur as described above.
|
but the other steps still occur as described above.
|
||||||
|
|
||||||
The default signal used to notify the lease holder is SIGIO,
|
The default signal used to notify the lease holder is
|
||||||
|
.BR SIGIO ,
|
||||||
but this can be changed using the
|
but this can be changed using the
|
||||||
.B F_SETSIG
|
.B F_SETSIG
|
||||||
command to
|
command to
|
||||||
.BR fcntl ().
|
.BR fcntl ().
|
||||||
If a
|
If a
|
||||||
.B F_SETSIG
|
.B F_SETSIG
|
||||||
command is performed (even one specifying SIGIO), and the signal
|
command is performed (even one specifying
|
||||||
handler is established using SA_SIGINFO, then the handler will
|
.BR SIGIO ),
|
||||||
receive a
|
and the signal
|
||||||
|
handler is established using
|
||||||
|
.BR SA_SIGINFO ,
|
||||||
|
then the handler will receive a
|
||||||
.I siginfo_t
|
.I siginfo_t
|
||||||
structure as its second argument, and the
|
structure as its second argument, and the
|
||||||
.I si_fd
|
.I si_fd
|
||||||
|
@ -747,14 +784,18 @@ call specifying
|
||||||
as 0.
|
as 0.
|
||||||
.sp
|
.sp
|
||||||
Notification occurs via delivery of a signal.
|
Notification occurs via delivery of a signal.
|
||||||
The default signal is SIGIO, but this can be changed using the
|
The default signal is
|
||||||
|
.BR SIGIO ,
|
||||||
|
but this can be changed using the
|
||||||
.B F_SETSIG
|
.B F_SETSIG
|
||||||
command to
|
command to
|
||||||
.BR fcntl ().
|
.BR fcntl ().
|
||||||
In the latter case, the signal handler receives a
|
In the latter case, the signal handler receives a
|
||||||
.I siginfo_t
|
.I siginfo_t
|
||||||
structure as its second argument (if the handler was
|
structure as its second argument (if the handler was
|
||||||
established using SA_SIGINFO) and the
|
established using
|
||||||
|
.BR SA_SIGINFO )
|
||||||
|
and the
|
||||||
.I si_fd
|
.I si_fd
|
||||||
field of this structure contains the file descriptor which
|
field of this structure contains the file descriptor which
|
||||||
generated the notification (useful when establishing notification
|
generated the notification (useful when establishing notification
|
||||||
|
@ -790,7 +831,9 @@ Value of descriptor owner.
|
||||||
.TP
|
.TP
|
||||||
.B F_GETSIG
|
.B F_GETSIG
|
||||||
Value of signal sent when read or write becomes possible, or zero
|
Value of signal sent when read or write becomes possible, or zero
|
||||||
for traditional SIGIO behavior.
|
for traditional
|
||||||
|
.B SIGIO
|
||||||
|
behavior.
|
||||||
.TP
|
.TP
|
||||||
All other commands
|
All other commands
|
||||||
Zero.
|
Zero.
|
||||||
|
@ -861,13 +904,30 @@ Attempted to clear the
|
||||||
flag on a file that has the append-only attribute set.
|
flag on a file that has the append-only attribute set.
|
||||||
.SH "CONFORMING TO"
|
.SH "CONFORMING TO"
|
||||||
SVr4, 4.3BSD, POSIX.1-2001.
|
SVr4, 4.3BSD, POSIX.1-2001.
|
||||||
Only the operations F_DUPFD,
|
Only the operations
|
||||||
F_GETFD, F_SETFD, F_GETFL, F_SETFL, F_GETLK, F_SETLK, F_SETLKW,
|
.BR F_DUPFD ,
|
||||||
F_GETOWN, and F_SETOWN are specified in POSIX.1-2001.
|
.BR F_GETFD ,
|
||||||
|
.BR F_SETFD ,
|
||||||
|
.BR F_GETFL ,
|
||||||
|
.BR F_SETFL ,
|
||||||
|
.BR F_GETLK ,
|
||||||
|
.BR F_SETLK ,
|
||||||
|
.BR F_SETLKW ,
|
||||||
|
.BR F_GETOWN ,
|
||||||
|
and
|
||||||
|
.BR F_SETOWN
|
||||||
|
are specified in POSIX.1-2001.
|
||||||
|
|
||||||
F_GETSIG, F_SETSIG, F_NOTIFY, F_GETLEASE, and F_SETLEASE
|
.BR F_GETSIG ,
|
||||||
|
.BR F_SETSIG ,
|
||||||
|
.BR F_NOTIFY ,
|
||||||
|
.BR F_GETLEASE ,
|
||||||
|
and
|
||||||
|
.BR F_SETLEASE
|
||||||
are Linux specific.
|
are Linux specific.
|
||||||
(Define the _GNU_SOURCE macro to obtain these definitions.)
|
(Define the
|
||||||
|
.BR _GNU_SOURCE
|
||||||
|
macro to obtain these definitions.)
|
||||||
.\" .PP
|
.\" .PP
|
||||||
.\" SVr4 documents additional EIO, ENOLINK and EOVERFLOW error conditions.
|
.\" SVr4 documents additional EIO, ENOLINK and EOVERFLOW error conditions.
|
||||||
.SH NOTES
|
.SH NOTES
|
||||||
|
|
|
@ -111,7 +111,8 @@ Memory mappings that have been marked with the
|
||||||
flag are not inherited across a
|
flag are not inherited across a
|
||||||
.BR fork (2).
|
.BR fork (2).
|
||||||
.IP * 4
|
.IP * 4
|
||||||
The termination signal of the child is always SIGCHLD
|
The termination signal of the child is always
|
||||||
|
.B SIGCHLD
|
||||||
(see
|
(see
|
||||||
.BR clone (2)).
|
.BR clone (2)).
|
||||||
.PP
|
.PP
|
||||||
|
|
|
@ -79,7 +79,9 @@ it must either be privileged (under Linux: have the
|
||||||
capability), or the real or effective
|
capability), or the real or effective
|
||||||
user ID of the sending process must equal the real or
|
user ID of the sending process must equal the real or
|
||||||
saved set-user-ID of the target process.
|
saved set-user-ID of the target process.
|
||||||
In the case of SIGCONT it suffices when the sending and receiving
|
In the case of
|
||||||
|
.B SIGCONT
|
||||||
|
it suffices when the sending and receiving
|
||||||
processes belong to the same session.
|
processes belong to the same session.
|
||||||
.SH "RETURN VALUE"
|
.SH "RETURN VALUE"
|
||||||
On success (at least one signal was sent), zero is returned.
|
On success (at least one signal was sent), zero is returned.
|
||||||
|
|
|
@ -69,7 +69,9 @@ it must either be privileged (under Linux: have the
|
||||||
capability), or the real or effective
|
capability), or the real or effective
|
||||||
user ID of the sending process must equal the real or
|
user ID of the sending process must equal the real or
|
||||||
saved set-user-ID of the target process.
|
saved set-user-ID of the target process.
|
||||||
In the case of SIGCONT it suffices when the sending and receiving
|
In the case of
|
||||||
|
.B SIGCONT
|
||||||
|
it suffices when the sending and receiving
|
||||||
processes belong to the same session.
|
processes belong to the same session.
|
||||||
.SH "RETURN VALUE"
|
.SH "RETURN VALUE"
|
||||||
On success, zero is returned.
|
On success, zero is returned.
|
||||||
|
|
|
@ -231,7 +231,9 @@ that are already present in RAM.
|
||||||
Do not reserve swap space for this mapping.
|
Do not reserve swap space for this mapping.
|
||||||
When swap space is reserved, one has the guarantee
|
When swap space is reserved, one has the guarantee
|
||||||
that it is possible to modify the mapping.
|
that it is possible to modify the mapping.
|
||||||
When swap space is not reserved one might get SIGSEGV upon a write
|
When swap space is not reserved one might get
|
||||||
|
.B SIGSEGV
|
||||||
|
upon a write
|
||||||
if no physical memory is available.
|
if no physical memory is available.
|
||||||
See also the discussion of the file
|
See also the discussion of the file
|
||||||
.I /proc/sys/vm/overcommit_memory
|
.I /proc/sys/vm/overcommit_memory
|
||||||
|
@ -285,7 +287,8 @@ The address
|
||||||
must be a multiple of the page size.
|
must be a multiple of the page size.
|
||||||
All pages containing a part
|
All pages containing a part
|
||||||
of the indicated range are unmapped, and subsequent references
|
of the indicated range are unmapped, and subsequent references
|
||||||
to these pages will generate SIGSEGV.
|
to these pages will generate
|
||||||
|
.BR SIGSEGV .
|
||||||
It is not an error if the
|
It is not an error if the
|
||||||
indicated range does not contain any mapped pages.
|
indicated range does not contain any mapped pages.
|
||||||
|
|
||||||
|
|
|
@ -139,10 +139,13 @@ current 2.4 kernels, but not in 2.6 kernels.
|
||||||
.PP
|
.PP
|
||||||
In Linux 2.4, if
|
In Linux 2.4, if
|
||||||
.BR nanosleep ()
|
.BR nanosleep ()
|
||||||
is stopped by a signal (e.g., SIGTSTP),
|
is stopped by a signal (e.g.,
|
||||||
|
.BR SIGTSTP ),
|
||||||
then the call fails with the error
|
then the call fails with the error
|
||||||
.BR EINTR
|
.BR EINTR
|
||||||
after the process is resumed by a SIGCONT signal.
|
after the process is resumed by a
|
||||||
|
.B SIGCONT
|
||||||
|
signal.
|
||||||
If the system call is subsequently restarted,
|
If the system call is subsequently restarted,
|
||||||
then the time that the process spent in the stopped state is
|
then the time that the process spent in the stopped state is
|
||||||
\fInot\fP counted against the sleep interval.
|
\fInot\fP counted against the sleep interval.
|
||||||
|
|
|
@ -131,7 +131,9 @@ can't be done without a race condition.
|
||||||
.TP
|
.TP
|
||||||
.B O_ASYNC
|
.B O_ASYNC
|
||||||
Enable signal-driven I/O:
|
Enable signal-driven I/O:
|
||||||
generate a signal (SIGIO by default, but this can be changed via
|
generate a signal
|
||||||
|
.RB ( SIGIO
|
||||||
|
by default, but this can be changed via
|
||||||
.BR fcntl (2))
|
.BR fcntl (2))
|
||||||
when input or output becomes possible on this file descriptor.
|
when input or output becomes possible on this file descriptor.
|
||||||
This feature is only available for terminals, pseudo-terminals,
|
This feature is only available for terminals, pseudo-terminals,
|
||||||
|
|
|
@ -152,7 +152,9 @@ or
|
||||||
Set unaligned access control bits to \fIarg2\fP.
|
Set unaligned access control bits to \fIarg2\fP.
|
||||||
Pass
|
Pass
|
||||||
\fBPR_UNALIGN_NOPRINT\fP to silently fix up unaligned user accesses,
|
\fBPR_UNALIGN_NOPRINT\fP to silently fix up unaligned user accesses,
|
||||||
or \fBPR_UNALIGN_SIGBUS\fP to generate SIGBUS on unaligned user access.
|
or \fBPR_UNALIGN_SIGBUS\fP to generate
|
||||||
|
.B SIGBUS
|
||||||
|
on unaligned user access.
|
||||||
.TP
|
.TP
|
||||||
.B PR_GET_UNALIGN
|
.B PR_GET_UNALIGN
|
||||||
(Since Linux 2.3.48, only on parisc and ia64)
|
(Since Linux 2.3.48, only on parisc and ia64)
|
||||||
|
@ -162,7 +164,9 @@ Get unaligned access control bits from \fIarg2\fP.
|
||||||
(Since Linux 2.4.18, 2.5.9, only on ia64)
|
(Since Linux 2.4.18, 2.5.9, only on ia64)
|
||||||
Set floating-point emulation control bits to \fIarg2\fP.
|
Set floating-point emulation control bits to \fIarg2\fP.
|
||||||
Pass \fBPR_FPEMU_NOPRINT\fP to silently emulate fp operations accesses, or
|
Pass \fBPR_FPEMU_NOPRINT\fP to silently emulate fp operations accesses, or
|
||||||
\fBPR_FPEMU_SIGFPE\fP to not emulate fp operations and send SIGFPE instead.
|
\fBPR_FPEMU_SIGFPE\fP to not emulate fp operations and send
|
||||||
|
.B SIGFPE
|
||||||
|
instead.
|
||||||
.TP
|
.TP
|
||||||
.B PR_GET_FPEMU
|
.B PR_GET_FPEMU
|
||||||
(Since Linux 2.4.18, 2.5.9, only on ia64)
|
(Since Linux 2.4.18, 2.5.9, only on ia64)
|
||||||
|
|
239
man2/ptrace.2
239
man2/ptrace.2
|
@ -61,15 +61,18 @@ call tracing.
|
||||||
.LP
|
.LP
|
||||||
The parent can initiate a trace by calling
|
The parent can initiate a trace by calling
|
||||||
.BR fork (2)
|
.BR fork (2)
|
||||||
and having the resulting child do a PTRACE_TRACEME,
|
and having the resulting child do a
|
||||||
|
.BR PTRACE_TRACEME ,
|
||||||
followed (typically) by an
|
followed (typically) by an
|
||||||
.BR exec (3).
|
.BR exec (3).
|
||||||
Alternatively, the parent may commence trace of an existing process using
|
Alternatively, the parent may commence trace of an existing process using
|
||||||
PTRACE_ATTACH.
|
.BR PTRACE_ATTACH .
|
||||||
.LP
|
.LP
|
||||||
While being traced, the child will stop each time a signal is delivered,
|
While being traced, the child will stop each time a signal is delivered,
|
||||||
even if the signal is being ignored.
|
even if the signal is being ignored.
|
||||||
(The exception is SIGKILL, which has its usual effect.)
|
(The exception is
|
||||||
|
.BR SIGKILL ,
|
||||||
|
which has its usual effect.)
|
||||||
The parent will be notified at its next
|
The parent will be notified at its next
|
||||||
.BR wait (2)
|
.BR wait (2)
|
||||||
and may inspect and modify the child process while it is stopped.
|
and may inspect and modify the child process while it is stopped.
|
||||||
|
@ -78,20 +81,26 @@ optionally ignoring the delivered signal
|
||||||
(or even delivering a different signal instead).
|
(or even delivering a different signal instead).
|
||||||
.LP
|
.LP
|
||||||
When the parent is finished tracing, it can terminate the child with
|
When the parent is finished tracing, it can terminate the child with
|
||||||
PTRACE_KILL or cause it to continue executing in a normal, untraced mode
|
.B PTRACE_KILL
|
||||||
via PTRACE_DETACH.
|
or cause it to continue executing in a normal, untraced mode
|
||||||
|
via
|
||||||
|
.BR PTRACE_DETACH .
|
||||||
.LP
|
.LP
|
||||||
The value of \fIrequest\fP determines the action to be performed:
|
The value of \fIrequest\fP determines the action to be performed:
|
||||||
.TP
|
.TP
|
||||||
PTRACE_TRACEME
|
.B PTRACE_TRACEME
|
||||||
Indicates that this process is to be traced by its parent.
|
Indicates that this process is to be traced by its parent.
|
||||||
Any signal
|
Any signal
|
||||||
(except SIGKILL) delivered to this process will cause it to stop and its
|
(except
|
||||||
|
.BR SIGKILL )
|
||||||
|
delivered to this process will cause it to stop and its
|
||||||
parent to be notified via
|
parent to be notified via
|
||||||
.BR wait (2).
|
.BR wait (2).
|
||||||
Also, all subsequent calls to
|
Also, all subsequent calls to
|
||||||
.BR execve (2)
|
.BR execve (2)
|
||||||
by this process will cause a SIGTRAP to be sent to it,
|
by this process will cause a
|
||||||
|
.B SIGTRAP
|
||||||
|
to be sent to it,
|
||||||
giving the parent a chance to gain control before the new program
|
giving the parent a chance to gain control before the new program
|
||||||
begins execution.
|
begins execution.
|
||||||
A process probably shouldn't make this request if its parent
|
A process probably shouldn't make this request if its parent
|
||||||
|
@ -102,10 +111,12 @@ The above request is used only by the child process;
|
||||||
the rest are used only by the parent.
|
the rest are used only by the parent.
|
||||||
In the following requests, \fIpid\fP specifies the child process
|
In the following requests, \fIpid\fP specifies the child process
|
||||||
to be acted on.
|
to be acted on.
|
||||||
For requests other than PTRACE_KILL, the child process must
|
For requests other than
|
||||||
|
.BR PTRACE_KILL ,
|
||||||
|
the child process must
|
||||||
be stopped.
|
be stopped.
|
||||||
.TP
|
.TP
|
||||||
PTRACE_PEEKTEXT, PTRACE_PEEKDATA
|
.BR PTRACE_PEEKTEXT ", " PTRACE_PEEKDATA
|
||||||
Reads a word at the location
|
Reads a word at the location
|
||||||
.IR addr
|
.IR addr
|
||||||
in the child's memory, returning the word as the result of the
|
in the child's memory, returning the word as the result of the
|
||||||
|
@ -115,12 +126,11 @@ Linux does not have separate text and data address spaces, so the two
|
||||||
requests are currently equivalent.
|
requests are currently equivalent.
|
||||||
(The argument \fIdata\fP is ignored.)
|
(The argument \fIdata\fP is ignored.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_PEEKUSR
|
.B PTRACE_PEEKUSR
|
||||||
Reads a word at offset
|
Reads a word at offset
|
||||||
.I addr
|
.I addr
|
||||||
in the child's
|
in the child's USER area,
|
||||||
.B USER
|
which holds the registers and other information about the process
|
||||||
area, which holds the registers and other information about the process
|
|
||||||
(see \fI<linux/user.h>\fP and <sys/user.h>).
|
(see \fI<linux/user.h>\fP and <sys/user.h>).
|
||||||
The word is returned as the result of the
|
The word is returned as the result of the
|
||||||
.BR ptrace ()
|
.BR ptrace ()
|
||||||
|
@ -128,7 +138,7 @@ call.
|
||||||
Typically the offset must be word-aligned, though this might vary by
|
Typically the offset must be word-aligned, though this might vary by
|
||||||
architecture. (\fIdata\fP is ignored.)
|
architecture. (\fIdata\fP is ignored.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_POKETEXT, PTRACE_POKEDATA
|
.BR PTRACE_POKETEXT ", " PTRACE_POKEDATA
|
||||||
Copies the word
|
Copies the word
|
||||||
.IR data
|
.IR data
|
||||||
to location
|
to location
|
||||||
|
@ -136,41 +146,39 @@ to location
|
||||||
in the child's memory.
|
in the child's memory.
|
||||||
As above, the two requests are currently equivalent.
|
As above, the two requests are currently equivalent.
|
||||||
.TP
|
.TP
|
||||||
PTRACE_POKEUSR
|
.B PTRACE_POKEUSR
|
||||||
Copies the word
|
Copies the word
|
||||||
.IR data
|
.IR data
|
||||||
to offset
|
to offset
|
||||||
.I addr
|
.I addr
|
||||||
in the child's
|
in the child's USER area.
|
||||||
.B USER
|
|
||||||
area.
|
|
||||||
As above, the offset must typically be word-aligned.
|
As above, the offset must typically be word-aligned.
|
||||||
In order to maintain the integrity of the kernel,
|
In order to maintain the integrity of the kernel,
|
||||||
some modifications to the
|
some modifications to the USER area are disallowed.
|
||||||
.B USER
|
|
||||||
area are disallowed.
|
|
||||||
.TP
|
.TP
|
||||||
PTRACE_GETREGS, PTRACE_GETFPREGS
|
.BR PTRACE_GETREGS ", " PTRACE_GETFPREGS
|
||||||
Copies the child's general purpose or floating-point registers,
|
Copies the child's general purpose or floating-point registers,
|
||||||
respectively, to location \fIdata\fP in the parent.
|
respectively, to location \fIdata\fP in the parent.
|
||||||
See \fI<linux/user.h>\fP for information on
|
See \fI<linux/user.h>\fP for information on
|
||||||
the format of this data. (\fIaddr\fP is ignored.)
|
the format of this data. (\fIaddr\fP is ignored.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_GETSIGINFO (since Linux 2.3.99-pre6)
|
.BR PTRACE_GETSIGINFO " (since Linux 2.3.99-pre6)"
|
||||||
Retrieve information about the signal that caused the stop.
|
Retrieve information about the signal that caused the stop.
|
||||||
Copies a \fIsiginfo_t\fP structure (see
|
Copies a \fIsiginfo_t\fP structure (see
|
||||||
.BR sigaction (2))
|
.BR sigaction (2))
|
||||||
from the child to location \fIdata\fP in the parent.
|
from the child to location \fIdata\fP in the parent.
|
||||||
(\fIaddr\fP is ignored.)
|
(\fIaddr\fP is ignored.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_SETREGS, PTRACE_SETFPREGS
|
.BR PTRACE_SETREGS " , " PTRACE_SETFPREGS
|
||||||
Copies the child's general purpose or floating-point registers,
|
Copies the child's general purpose or floating-point registers,
|
||||||
respectively, from location \fIdata\fP in the parent.
|
respectively, from location \fIdata\fP in the parent.
|
||||||
As for PTRACE_POKEUSER, some general
|
As for
|
||||||
|
.BR PTRACE_POKEUSER ,
|
||||||
|
some general
|
||||||
purpose register modifications may be disallowed.
|
purpose register modifications may be disallowed.
|
||||||
(\fIaddr\fP is ignored.)
|
(\fIaddr\fP is ignored.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_SETSIGINFO (since Linux 2.3.99-pre6)
|
.BR PTRACE_SETSIGINFO " (since Linux 2.3.99-pre6)"
|
||||||
Set signal information.
|
Set signal information.
|
||||||
Copies a \fIsiginfo_t\fP structure from location \fIdata\fP in the
|
Copies a \fIsiginfo_t\fP structure from location \fIdata\fP in the
|
||||||
parent to the child.
|
parent to the child.
|
||||||
|
@ -181,65 +189,84 @@ these normal signals from synthetic signals generated by
|
||||||
.BR ptrace ()
|
.BR ptrace ()
|
||||||
itself. (\fIaddr\fP is ignored.)
|
itself. (\fIaddr\fP is ignored.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_SETOPTIONS (since Linux 2.4.6; see BUGS for caveats)
|
.BR PTRACE_SETOPTIONS " (since Linux 2.4.6; see BUGS for caveats)"
|
||||||
Sets ptrace options from \fIdata\fP in the parent.
|
Sets ptrace options from \fIdata\fP in the parent.
|
||||||
(\fIaddr\fP is ignored.)
|
(\fIaddr\fP is ignored.)
|
||||||
\fIdata\fP is interpreted
|
\fIdata\fP is interpreted
|
||||||
as a bitmask of options, which are specified by the following flags:
|
as a bitmask of options, which are specified by the following flags:
|
||||||
.RS
|
.RS
|
||||||
.TP
|
.TP
|
||||||
PTRACE_O_TRACESYSGOOD (since Linux 2.4.6)
|
.BR PTRACE_O_TRACESYSGOOD " (since Linux 2.4.6)"
|
||||||
When delivering syscall traps, set bit 7 in the signal number
|
When delivering syscall traps, set bit 7 in the signal number
|
||||||
(i.e., deliver (SIGTRAP | 0x80)
|
(i.e., deliver \fI(SIGTRAP | 0x80)\fP
|
||||||
This makes it easy for the tracer to tell the difference
|
This makes it easy for the tracer to tell the difference
|
||||||
between normal traps and those caused by a syscall.
|
between normal traps and those caused by a syscall.
|
||||||
(PTRACE_O_TRACESYSGOOD may not work on all architectures.)
|
.RB ( PTRACE_O_TRACESYSGOOD
|
||||||
|
may not work on all architectures.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_O_TRACEFORK (since Linux 2.5.46)
|
.BR PTRACE_O_TRACEFORK " (since Linux 2.5.46)"
|
||||||
Stop the child at the next
|
Stop the child at the next
|
||||||
.BR fork (2)
|
.BR fork (2)
|
||||||
call with SIGTRAP | PTRACE_EVENT_FORK << 8 and automatically
|
call with \fISIGTRAP | PTRACE_EVENT_FORK\ <<\ 8\fP and automatically
|
||||||
start tracing the newly forked process,
|
start tracing the newly forked process,
|
||||||
which will start with a SIGSTOP.
|
which will start with a
|
||||||
The PID for the new process can be retrieved with PTRACE_GETEVENTMSG.
|
.BR SIGSTOP .
|
||||||
|
The PID for the new process can be retrieved with
|
||||||
|
.BR PTRACE_GETEVENTMSG .
|
||||||
.TP
|
.TP
|
||||||
PTRACE_O_TRACEVFORK (since Linux 2.5.46)
|
.BR PTRACE_O_TRACEVFORK " (since Linux 2.5.46)"
|
||||||
Stop the child at the next
|
Stop the child at the next
|
||||||
.BR vfork (2)
|
.BR vfork (2)
|
||||||
call with SIGTRAP | PTRACE_EVENT_VFORK << 8 and automatically start
|
call with \fISIGTRAP | PTRACE_EVENT_VFORK\ <<\ 8\fP and automatically start
|
||||||
tracing the newly vforked process, which will start with a SIGSTOP.
|
tracing the newly vforked process, which will start with a
|
||||||
The PID for the new process can be retrieved with PTRACE_GETEVENTMSG.
|
.BR SIGSTOP .
|
||||||
|
The PID for the new process can be retrieved with
|
||||||
|
.BR PTRACE_GETEVENTMSG .
|
||||||
.TP
|
.TP
|
||||||
PTRACE_O_TRACECLONE (since Linux 2.5.46)
|
.BR PTRACE_O_TRACECLONE " (since Linux 2.5.46)"
|
||||||
Stop the child at the next
|
Stop the child at the next
|
||||||
.BR clone (2)
|
.BR clone (2)
|
||||||
call with SIGTRAP | PTRACE_EVENT_CLONE << 8 and automatically start
|
call with \fISIGTRAP | PTRACE_EVENT_CLONE\ <<\ 8\fP and automatically start
|
||||||
tracing the newly cloned process, which will start with a SIGSTOP.
|
tracing the newly cloned process, which will start with a
|
||||||
The PID for the new process can be retrieved with PTRACE_GETEVENTMSG.
|
.BR SIGSTOP .
|
||||||
|
The PID for the new process can be retrieved with
|
||||||
|
.BR PTRACE_GETEVENTMSG .
|
||||||
This option may not catch
|
This option may not catch
|
||||||
.BR clone (2)
|
.BR clone (2)
|
||||||
calls in all cases.
|
calls in all cases.
|
||||||
If the child calls
|
If the child calls
|
||||||
.BR clone (2)
|
.BR clone (2)
|
||||||
with the CLONE_VFORK flag, PTRACE_EVENT_VFORK will be delivered instead
|
with the
|
||||||
if PTRACE_O_TRACEVFORK is set; otherwise if the child calls
|
.BR CLONE_VFORK
|
||||||
|
flag,
|
||||||
|
.B PTRACE_EVENT_VFORK
|
||||||
|
will be delivered instead
|
||||||
|
if
|
||||||
|
.B PTRACE_O_TRACEVFORK
|
||||||
|
is set; otherwise if the child calls
|
||||||
.BR clone (2)
|
.BR clone (2)
|
||||||
with the exit signal set to SIGCHLD, PTRACE_EVENT_FORK will be delivered
|
with the exit signal set to
|
||||||
if PTRACE_O_TRACEFORK is set.
|
.BR SIGCHLD ,
|
||||||
|
.B PTRACE_EVENT_FORK
|
||||||
|
will be delivered
|
||||||
|
if
|
||||||
|
.B PTRACE_O_TRACEFORK
|
||||||
|
is set.
|
||||||
.TP
|
.TP
|
||||||
PTRACE_O_TRACEEXEC (since Linux 2.5.46)
|
.BR PTRACE_O_TRACEEXEC " (since Linux 2.5.46)"
|
||||||
Stop the child at the next
|
Stop the child at the next
|
||||||
.BR execve (2)
|
.BR execve (2)
|
||||||
call with SIGTRAP | PTRACE_EVENT_EXEC << 8.
|
call with \fISIGTRAP | PTRACE_EVENT_EXEC\ <<\ 8\fP.
|
||||||
.TP
|
.TP
|
||||||
PTRACE_O_TRACEVFORKDONE (since Linux 2.5.60)
|
.BR PTRACE_O_TRACEVFORKDONE " (since Linux 2.5.60)"
|
||||||
Stop the child at the completion of the next
|
Stop the child at the completion of the next
|
||||||
.BR vfork (2)
|
.BR vfork (2)
|
||||||
call with SIGTRAP | PTRACE_EVENT_VFORK_DONE << 8.
|
call with \fISIGTRAP | PTRACE_EVENT_VFORK_DONE\ <<\ 8\fP.
|
||||||
.TP
|
.TP
|
||||||
PTRACE_O_TRACEEXIT (since Linux 2.5.60)
|
.BR PTRACE_O_TRACEEXIT " (since Linux 2.5.60)"
|
||||||
Stop the child at exit with SIGTRAP | PTRACE_EVENT_EXIT << 8.
|
Stop the child at exit with \fISIGTRAP | PTRACE_EVENT_EXIT\ <<\ 8\fP.
|
||||||
The child's exit status can be retrieved with PTRACE_GETEVENTMSG.
|
The child's exit status can be retrieved with
|
||||||
|
.BR PTRACE_GETEVENTMSG .
|
||||||
This stop will be done early during process exit when registers
|
This stop will be done early during process exit when registers
|
||||||
are still available, allowing the tracer to see where the exit occurred,
|
are still available, allowing the tracer to see where the exit occurred,
|
||||||
whereas the normal exit notification is done after the process
|
whereas the normal exit notification is done after the process
|
||||||
|
@ -248,59 +275,82 @@ Even though context is available, the tracer cannot prevent the exit from
|
||||||
happening at this point.
|
happening at this point.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
PTRACE_GETEVENTMSG (since Linux 2.5.46)
|
.BR PTRACE_GETEVENTMSG " (since Linux 2.5.46)"
|
||||||
Retrieve a message (as an
|
Retrieve a message (as an
|
||||||
.IR "unsigned long" )
|
.IR "unsigned long" )
|
||||||
about the ptrace event
|
about the ptrace event
|
||||||
that just happened, placing it in the location \fIdata\fP in the parent.
|
that just happened, placing it in the location \fIdata\fP in the parent.
|
||||||
For PTRACE_EVENT_EXIT this is the child's exit status.
|
For
|
||||||
For PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK and PTRACE_EVENT_CLONE this
|
.BR PTRACE_EVENT_EXIT
|
||||||
|
this is the child's exit status.
|
||||||
|
For
|
||||||
|
.BR PTRACE_EVENT_FORK ,
|
||||||
|
.BR PTRACE_EVENT_VFORK
|
||||||
|
and
|
||||||
|
.B PTRACE_EVENT_CLONE
|
||||||
|
this
|
||||||
is the PID of the new process.
|
is the PID of the new process.
|
||||||
Since Linux 2.6.18, the PID of the new process is also available
|
Since Linux 2.6.18, the PID of the new process is also available
|
||||||
for PTRACE_EVENT_VFORK_DONE.
|
for
|
||||||
|
.BR PTRACE_EVENT_VFORK_DONE .
|
||||||
(\fIaddr\fP is ignored.)
|
(\fIaddr\fP is ignored.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_CONT
|
.B PTRACE_CONT
|
||||||
Restarts the stopped child process.
|
Restarts the stopped child process.
|
||||||
If \fIdata\fP is non-zero and not
|
If \fIdata\fP is non-zero and not
|
||||||
SIGSTOP, it is interpreted as a signal to be delivered to the child;
|
.BR SIGSTOP ,
|
||||||
|
it is interpreted as a signal to be delivered to the child;
|
||||||
otherwise, no signal is delivered.
|
otherwise, no signal is delivered.
|
||||||
Thus, for example, the parent can control
|
Thus, for example, the parent can control
|
||||||
whether a signal sent to the child is delivered or not.
|
whether a signal sent to the child is delivered or not.
|
||||||
(\fIaddr\fP is ignored.)
|
(\fIaddr\fP is ignored.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_SYSCALL, PTRACE_SINGLESTEP
|
.BR PTRACE_SYSCALL ", " PTRACE_SINGLESTEP
|
||||||
Restarts the stopped child as for PTRACE_CONT, but arranges for
|
Restarts the stopped child as for
|
||||||
|
.BR PTRACE_CONT ,
|
||||||
|
but arranges for
|
||||||
the child to be stopped at the next entry to or exit from a system call,
|
the child to be stopped at the next entry to or exit from a system call,
|
||||||
or after execution of a single instruction, respectively.
|
or after execution of a single instruction, respectively.
|
||||||
(The child will also, as usual, be stopped upon receipt of a signal.)
|
(The child will also, as usual, be stopped upon receipt of a signal.)
|
||||||
From the parent's perspective, the child will appear to have been
|
From the parent's perspective, the child will appear to have been
|
||||||
stopped by receipt of a SIGTRAP.
|
stopped by receipt of a
|
||||||
So, for PTRACE_SYSCALL, for example, the idea is to inspect
|
.BR SIGTRAP .
|
||||||
|
So, for
|
||||||
|
.BR PTRACE_SYSCALL ,
|
||||||
|
for example, the idea is to inspect
|
||||||
the arguments to the system call at the first stop,
|
the arguments to the system call at the first stop,
|
||||||
then do another PTRACE_SYSCALL and inspect the return value of
|
then do another
|
||||||
|
.B PTRACE_SYSCALL
|
||||||
|
and inspect the return value of
|
||||||
the system call at the second stop.
|
the system call at the second stop.
|
||||||
(\fIaddr\fP is ignored.)
|
(\fIaddr\fP is ignored.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP (since Linux 2.6.14)
|
.BR PTRACE_SYSEMU " , " PTRACE_SYSEMU_SINGLESTEP " (since Linux 2.6.14)"
|
||||||
For PTRACE_SYSEMU, continue and stop on entry to the next syscall,
|
For
|
||||||
|
.BR PTRACE_SYSEMU ,
|
||||||
|
continue and stop on entry to the next syscall,
|
||||||
which will not be executed.
|
which will not be executed.
|
||||||
For PTRACE_SYSEMU_SINGLESTEP, do the same
|
For
|
||||||
|
.BR PTRACE_SYSEMU_SINGLESTEP ,
|
||||||
|
do the same
|
||||||
but also singlestep if not a syscall.
|
but also singlestep if not a syscall.
|
||||||
This call is used by programs like
|
This call is used by programs like
|
||||||
User Mode Linux that want to emulate all the child's system calls.
|
User Mode Linux that want to emulate all the child's system calls.
|
||||||
(\fIaddr\fP and \fIdata\fP are ignored;
|
(\fIaddr\fP and \fIdata\fP are ignored;
|
||||||
not supported on all architectures.)
|
not supported on all architectures.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_KILL
|
.B PTRACE_KILL
|
||||||
Sends the child a SIGKILL to terminate it.
|
Sends the child a
|
||||||
|
.B SIGKILL
|
||||||
|
to terminate it.
|
||||||
(\fIaddr\fP and \fIdata\fP are ignored.)
|
(\fIaddr\fP and \fIdata\fP are ignored.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_ATTACH
|
.B PTRACE_ATTACH
|
||||||
Attaches to the process specified in
|
Attaches to the process specified in
|
||||||
.IR pid ,
|
.IR pid ,
|
||||||
making it a traced "child" of the current process;
|
making it a traced "child" of the current process;
|
||||||
the behavior of the child is as if it had done a PTRACE_TRACEME.
|
the behavior of the child is as if it had done a
|
||||||
|
.BR PTRACE_TRACEME .
|
||||||
The current process actually becomes the parent of the child
|
The current process actually becomes the parent of the child
|
||||||
process for most purposes (e.g., it will receive
|
process for most purposes (e.g., it will receive
|
||||||
notification of child events and appears in
|
notification of child events and appears in
|
||||||
|
@ -308,27 +358,36 @@ notification of child events and appears in
|
||||||
output as the child's parent), but a
|
output as the child's parent), but a
|
||||||
.BR getppid (2)
|
.BR getppid (2)
|
||||||
by the child will still return the PID of the original parent.
|
by the child will still return the PID of the original parent.
|
||||||
The child is sent a SIGSTOP, but will not necessarily have stopped
|
The child is sent a
|
||||||
|
.BR SIGSTOP ,
|
||||||
|
but will not necessarily have stopped
|
||||||
by the completion of this call; use
|
by the completion of this call; use
|
||||||
.BR wait (2)
|
.BR wait (2)
|
||||||
to wait for the child to stop.
|
to wait for the child to stop.
|
||||||
(\fIaddr\fP and \fIdata\fP are ignored.)
|
(\fIaddr\fP and \fIdata\fP are ignored.)
|
||||||
.TP
|
.TP
|
||||||
PTRACE_DETACH
|
.B PTRACE_DETACH
|
||||||
Restarts the stopped child as for PTRACE_CONT, but first detaches
|
Restarts the stopped child as for
|
||||||
from the process, undoing the reparenting effect of PTRACE_ATTACH,
|
.BR PTRACE_CONT ,
|
||||||
and the effects of PTRACE_TRACEME.
|
but first detaches
|
||||||
|
from the process, undoing the reparenting effect of
|
||||||
|
.BR PTRACE_ATTACH ,
|
||||||
|
and the effects of
|
||||||
|
.BR PTRACE_TRACEME .
|
||||||
Although perhaps not intended, under Linux a traced child can be
|
Although perhaps not intended, under Linux a traced child can be
|
||||||
detached in this way regardless of which method was used to initiate
|
detached in this way regardless of which method was used to initiate
|
||||||
tracing.
|
tracing.
|
||||||
(\fIaddr\fP is ignored.)
|
(\fIaddr\fP is ignored.)
|
||||||
.SH "RETURN VALUE"
|
.SH "RETURN VALUE"
|
||||||
On success, PTRACE_PEEK* requests return the requested data,
|
On success,
|
||||||
|
.BR PTRACE_PEEK*
|
||||||
|
requests return the requested data,
|
||||||
while other requests return zero.
|
while other requests return zero.
|
||||||
On error, all requests return \-1, and
|
On error, all requests return \-1, and
|
||||||
.I errno
|
.I errno
|
||||||
is set appropriately.
|
is set appropriately.
|
||||||
Since the value returned by a successful PTRACE_PEEK*
|
Since the value returned by a successful
|
||||||
|
.BR PTRACE_PEEK*
|
||||||
request may be \-1, the caller must check
|
request may be \-1, the caller must check
|
||||||
.I errno
|
.I errno
|
||||||
after such requests to determine whether or not an error occurred.
|
after such requests to determine whether or not an error occurred.
|
||||||
|
@ -394,20 +453,25 @@ The size of a "word" is determined by the OS variant
|
||||||
.LP
|
.LP
|
||||||
Tracing causes a few subtle differences in the semantics of
|
Tracing causes a few subtle differences in the semantics of
|
||||||
traced processes.
|
traced processes.
|
||||||
For example, if a process is attached to with PTRACE_ATTACH,
|
For example, if a process is attached to with
|
||||||
|
.BR PTRACE_ATTACH ,
|
||||||
its original parent can no longer receive notification via
|
its original parent can no longer receive notification via
|
||||||
.BR wait (2)
|
.BR wait (2)
|
||||||
when it stops, and there is no way for the new parent to
|
when it stops, and there is no way for the new parent to
|
||||||
effectively simulate this notification.
|
effectively simulate this notification.
|
||||||
.LP
|
.LP
|
||||||
When the parent receives an event with PTRACE_EVENT_* set,
|
When the parent receives an event with
|
||||||
|
.BR PTRACE_EVENT_*
|
||||||
|
set,
|
||||||
the child is not in the normal signal delivery path.
|
the child is not in the normal signal delivery path.
|
||||||
This means the parent cannot do
|
This means the parent cannot do
|
||||||
.BR ptrace (PTRACE_CONT)
|
.BR ptrace (PTRACE_CONT)
|
||||||
with a signal or
|
with a signal or
|
||||||
.BR ptrace (PTRACE_KILL).
|
.BR ptrace (PTRACE_KILL).
|
||||||
.BR kill (2)
|
.BR kill (2)
|
||||||
with a SIGKILL signal can be used instead to kill the child process
|
with a
|
||||||
|
.BR SIGKILL
|
||||||
|
signal can be used instead to kill the child process
|
||||||
after receiving one of these messages.
|
after receiving one of these messages.
|
||||||
.LP
|
.LP
|
||||||
This page documents the way the
|
This page documents the way the
|
||||||
|
@ -426,12 +490,17 @@ present in Solaris 2 implements a superset of
|
||||||
.BR ptrace ()
|
.BR ptrace ()
|
||||||
functionality in a more powerful and uniform way.
|
functionality in a more powerful and uniform way.
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
On hosts with 2.6 kernel headers, PTRACE_SETOPTIONS is declared
|
On hosts with 2.6 kernel headers,
|
||||||
|
.BR PTRACE_SETOPTIONS
|
||||||
|
is declared
|
||||||
with a different value than the one for 2.4.
|
with a different value than the one for 2.4.
|
||||||
This leads to applications compiled with such
|
This leads to applications compiled with such
|
||||||
headers failing when run on 2.4 kernels.
|
headers failing when run on 2.4 kernels.
|
||||||
This can be worked around by redefining PTRACE_SETOPTIONS to
|
This can be worked around by redefining
|
||||||
PTRACE_OLDSETOPTIONS, if that is defined.
|
.BR PTRACE_SETOPTIONS
|
||||||
|
to
|
||||||
|
.BR PTRACE_OLDSETOPTIONS ,
|
||||||
|
if that is defined.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR gdb (1),
|
.BR gdb (1),
|
||||||
.BR strace (1),
|
.BR strace (1),
|
||||||
|
|
|
@ -105,7 +105,9 @@ or the current file offset is not suitably aligned.
|
||||||
I/O error.
|
I/O error.
|
||||||
This will happen for example when the process is in a
|
This will happen for example when the process is in a
|
||||||
background process group, tries to read from its controlling tty,
|
background process group, tries to read from its controlling tty,
|
||||||
and either it is ignoring or blocking SIGTTIN or its process group
|
and either it is ignoring or blocking
|
||||||
|
.B SIGTTIN
|
||||||
|
or its process group
|
||||||
is orphaned.
|
is orphaned.
|
||||||
It may also occur when there is a low-level I/O error
|
It may also occur when there is a low-level I/O error
|
||||||
while reading from a disk or tape.
|
while reading from a disk or tape.
|
||||||
|
|
|
@ -111,7 +111,9 @@ the action associated with LINUX_REBOOT_CMD_RESTART.
|
||||||
.B LINUX_REBOOT_CMD_CAD_OFF
|
.B LINUX_REBOOT_CMD_CAD_OFF
|
||||||
(RB_DISABLE_CAD, 0).
|
(RB_DISABLE_CAD, 0).
|
||||||
CAD is disabled.
|
CAD is disabled.
|
||||||
This means that the CAD keystroke will cause a SIGINT signal to be
|
This means that the CAD keystroke will cause a
|
||||||
|
.B SIGINT
|
||||||
|
signal to be
|
||||||
sent to init (process 1), whereupon this process may decide upon a
|
sent to init (process 1), whereupon this process may decide upon a
|
||||||
proper action (maybe: kill all processes, sync, reboot).
|
proper action (maybe: kill all processes, sync, reboot).
|
||||||
.LP
|
.LP
|
||||||
|
|
|
@ -111,14 +111,20 @@ calls described in
|
||||||
are used to get/set the process group of the control terminal.
|
are used to get/set the process group of the control terminal.
|
||||||
|
|
||||||
If a session has a controlling terminal, CLOCAL is not set and a hangup
|
If a session has a controlling terminal, CLOCAL is not set and a hangup
|
||||||
occurs, then the session leader is sent a SIGHUP.
|
occurs, then the session leader is sent a
|
||||||
|
.BR SIGHUP .
|
||||||
If the session leader
|
If the session leader
|
||||||
exits, the SIGHUP signal will be sent to each process in the foreground
|
exits, the
|
||||||
|
.B SIGHUP
|
||||||
|
signal will be sent to each process in the foreground
|
||||||
process group of the controlling terminal.
|
process group of the controlling terminal.
|
||||||
|
|
||||||
If the exit of the process causes a process group to become orphaned,
|
If the exit of the process causes a process group to become orphaned,
|
||||||
and if any member of the newly-orphaned process group is stopped, then a
|
and if any member of the newly-orphaned process group is stopped, then a
|
||||||
SIGHUP signal followed by a SIGCONT signal will be sent to each process
|
.B SIGHUP
|
||||||
|
signal followed by a
|
||||||
|
.B SIGCONT
|
||||||
|
signal will be sent to each process
|
||||||
in the newly-orphaned process group.
|
in the newly-orphaned process group.
|
||||||
.SH "RETURN VALUE"
|
.SH "RETURN VALUE"
|
||||||
On success,
|
On success,
|
||||||
|
|
|
@ -124,7 +124,9 @@ flag.
|
||||||
Do not reserve swap space for this segment.
|
Do not reserve swap space for this segment.
|
||||||
When swap space is reserved, one has the guarantee
|
When swap space is reserved, one has the guarantee
|
||||||
that it is possible to modify the segment.
|
that it is possible to modify the segment.
|
||||||
When swap space is not reserved one might get SIGSEGV upon a write
|
When swap space is not reserved one might get
|
||||||
|
.B SIGSEGV
|
||||||
|
upon a write
|
||||||
if no physical memory is available.
|
if no physical memory is available.
|
||||||
See also the discussion of the file
|
See also the discussion of the file
|
||||||
.I /proc/sys/vm/overcommit_memory
|
.I /proc/sys/vm/overcommit_memory
|
||||||
|
|
|
@ -402,7 +402,8 @@ Integer division by zero has undefined result.
|
||||||
On some architectures it will generate a
|
On some architectures it will generate a
|
||||||
.B SIGFPE
|
.B SIGFPE
|
||||||
signal.
|
signal.
|
||||||
(Also dividing the most negative integer by \-1 may generate SIGFPE.)
|
(Also dividing the most negative integer by \-1 may generate
|
||||||
|
.BR SIGFPE .)
|
||||||
Ignoring this signal might lead to an endless loop.
|
Ignoring this signal might lead to an endless loop.
|
||||||
.PP
|
.PP
|
||||||
POSIX.1-1990 disallowed setting the action for
|
POSIX.1-1990 disallowed setting the action for
|
||||||
|
|
|
@ -150,7 +150,9 @@ is defined, also
|
||||||
.SS Portability
|
.SS Portability
|
||||||
The original Unix
|
The original Unix
|
||||||
.BR signal ()
|
.BR signal ()
|
||||||
would reset the handler to SIG_DFL, and System V
|
would reset the handler to
|
||||||
|
.BR SIG_DFL ,
|
||||||
|
and System V
|
||||||
(and the Linux kernel and libc4,5) does the same.
|
(and the Linux kernel and libc4,5) does the same.
|
||||||
On the other hand, BSD does not reset the handler, but blocks
|
On the other hand, BSD does not reset the handler, but blocks
|
||||||
new instances of this signal from occurring during a call of the handler.
|
new instances of this signal from occurring during a call of the handler.
|
||||||
|
|
|
@ -48,7 +48,10 @@ returns after the signal handler returns,
|
||||||
and the signal mask is restored to the state before the call to
|
and the signal mask is restored to the state before the call to
|
||||||
.BR sigsuspend ().
|
.BR sigsuspend ().
|
||||||
|
|
||||||
It is not possible to block SIGKILL or SIGSTOP;
|
It is not possible to block
|
||||||
|
.B SIGKILL
|
||||||
|
or
|
||||||
|
.BR SIGSTOP ;
|
||||||
specifying these signals in
|
specifying these signals in
|
||||||
.IR mask ,
|
.IR mask ,
|
||||||
has no effect on the process's signal mask.
|
has no effect on the process's signal mask.
|
||||||
|
|
|
@ -174,7 +174,11 @@ The BSD man page states:
|
||||||
"To avoid a possible deadlock situation, processes that are children
|
"To avoid a possible deadlock situation, processes that are children
|
||||||
in the middle of a
|
in the middle of a
|
||||||
.BR vfork ()
|
.BR vfork ()
|
||||||
are never sent SIGTTOU or SIGTTIN signals; rather, output or
|
are never sent
|
||||||
|
.B SIGTTOU
|
||||||
|
or
|
||||||
|
.B SIGTTIN
|
||||||
|
signals; rather, output or
|
||||||
.IR ioctl s
|
.IR ioctl s
|
||||||
are allowed and input attempts result in an end-of-file indication."
|
are allowed and input attempts result in an end-of-file indication."
|
||||||
.\"
|
.\"
|
||||||
|
|
|
@ -382,8 +382,10 @@ and
|
||||||
.I id
|
.I id
|
||||||
.RB ( waitid ())
|
.RB ( waitid ())
|
||||||
does not exist or is not a child of the calling process.
|
does not exist or is not a child of the calling process.
|
||||||
(This can happen for one's own child if the action for SIGCHLD
|
(This can happen for one's own child if the action for
|
||||||
is set to SIG_IGN.
|
.B SIGCHLD
|
||||||
|
is set to
|
||||||
|
.BR SIG_IGN .
|
||||||
See also the \fILinux Notes\fP section about threads.)
|
See also the \fILinux Notes\fP section about threads.)
|
||||||
.TP
|
.TP
|
||||||
.B EINTR
|
.B EINTR
|
||||||
|
|
|
@ -40,13 +40,17 @@ abort \- cause abnormal program termination
|
||||||
The
|
The
|
||||||
.BR abort ()
|
.BR abort ()
|
||||||
function causes abnormal program termination unless
|
function causes abnormal program termination unless
|
||||||
the signal SIGABRT is caught and the signal handler does not return.
|
the signal
|
||||||
|
.B SIGABRT
|
||||||
|
is caught and the signal handler does not return.
|
||||||
If the
|
If the
|
||||||
.BR abort ()
|
.BR abort ()
|
||||||
function causes program termination, all open
|
function causes program termination, all open
|
||||||
streams are closed and flushed.
|
streams are closed and flushed.
|
||||||
.PP
|
.PP
|
||||||
If the SIGABRT signal is blocked or ignored, the
|
If the
|
||||||
|
.B SIGABRT
|
||||||
|
signal is blocked or ignored, the
|
||||||
.BR abort ()
|
.BR abort ()
|
||||||
function will still override it.
|
function will still override it.
|
||||||
.SH "RETURN VALUE"
|
.SH "RETURN VALUE"
|
||||||
|
|
35
man3/exit.3
35
man3/exit.3
|
@ -95,7 +95,11 @@ calls either
|
||||||
or
|
or
|
||||||
.BR longjmp (3).
|
.BR longjmp (3).
|
||||||
.LP
|
.LP
|
||||||
The use of EXIT_SUCCESS and EXIT_FAILURE is slightly more portable
|
The use of
|
||||||
|
.B EXIT_SUCCESS
|
||||||
|
and
|
||||||
|
.B EXIT_FAILURE
|
||||||
|
is slightly more portable
|
||||||
(to non-Unix environments) than the use of 0 and some non-zero value
|
(to non-Unix environments) than the use of 0 and some non-zero value
|
||||||
like 1 or \-1.
|
like 1 or \-1.
|
||||||
In particular, VMS uses a different convention.
|
In particular, VMS uses a different convention.
|
||||||
|
@ -109,8 +113,12 @@ the exit status must be transmitted to the
|
||||||
parent process.
|
parent process.
|
||||||
There are three cases.
|
There are three cases.
|
||||||
If the parent has set
|
If the parent has set
|
||||||
SA_NOCLDWAIT, or has set the SIGCHLD handler to SIG_IGN, the
|
.BR SA_NOCLDWAIT ,
|
||||||
status is discarded.
|
or has set the
|
||||||
|
.B SIGCHLD
|
||||||
|
handler to
|
||||||
|
.BR SIG_IGN ,
|
||||||
|
the status is discarded.
|
||||||
If the parent was waiting on the child
|
If the parent was waiting on the child
|
||||||
it is notified of the exit status.
|
it is notified of the exit status.
|
||||||
In both cases the exiting
|
In both cases the exiting
|
||||||
|
@ -124,21 +132,32 @@ it later calls one of the
|
||||||
.BR wait (2)
|
.BR wait (2)
|
||||||
functions.
|
functions.
|
||||||
.LP
|
.LP
|
||||||
If the implementation supports the SIGCHLD signal, this signal
|
If the implementation supports the
|
||||||
|
.BR SIGCHLD
|
||||||
|
signal, this signal
|
||||||
is sent to the parent.
|
is sent to the parent.
|
||||||
If the parent has set SA_NOCLDWAIT,
|
If the parent has set
|
||||||
it is undefined whether a SIGCHLD signal is sent.
|
.BR SA_NOCLDWAIT ,
|
||||||
|
it is undefined whether a
|
||||||
|
.B SIGCHLD
|
||||||
|
signal is sent.
|
||||||
.LP
|
.LP
|
||||||
If the process is a session leader and its controlling terminal
|
If the process is a session leader and its controlling terminal
|
||||||
is the controlling terminal of the session, then each process in
|
is the controlling terminal of the session, then each process in
|
||||||
the foreground process group of this controlling terminal
|
the foreground process group of this controlling terminal
|
||||||
is sent a SIGHUP signal, and the terminal is disassociated
|
is sent a
|
||||||
|
.B SIGHUP
|
||||||
|
signal, and the terminal is disassociated
|
||||||
from this session, allowing it to be acquired by a new controlling
|
from this session, allowing it to be acquired by a new controlling
|
||||||
process.
|
process.
|
||||||
.LP
|
.LP
|
||||||
If the exit of the process causes a process group to become orphaned,
|
If the exit of the process causes a process group to become orphaned,
|
||||||
and if any member of the newly orphaned process group is stopped,
|
and if any member of the newly orphaned process group is stopped,
|
||||||
then a SIGHUP signal followed by a SIGCONT signal will be
|
then a
|
||||||
|
.B SIGHUP
|
||||||
|
signal followed by a
|
||||||
|
.B SIGCONT
|
||||||
|
signal will be
|
||||||
sent to each process in this process group.
|
sent to each process in this process group.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR _exit (2),
|
.BR _exit (2),
|
||||||
|
|
|
@ -76,8 +76,12 @@ cannot be opened, the password is read from
|
||||||
.IR stdin .
|
.IR stdin .
|
||||||
The static buffer has length 128 so that only the first 127
|
The static buffer has length 128 so that only the first 127
|
||||||
bytes of the password are returned.
|
bytes of the password are returned.
|
||||||
While reading the password, signal generation (SIGINT, SIGQUIT,
|
While reading the password, signal generation
|
||||||
SIGSTOP, SIGTSTOP) is disabled and the corresponding characters
|
.RB (SIGINT ,
|
||||||
|
.BR SIGQUIT ,
|
||||||
|
.BR SIGSTOP ,
|
||||||
|
.BR SIGTSTOP )
|
||||||
|
is disabled and the corresponding characters
|
||||||
(usually control-C, control-\e, control-Z and control-Y)
|
(usually control-C, control-\e, control-Z and control-Y)
|
||||||
are transmitted as part of the password.
|
are transmitted as part of the password.
|
||||||
Since libc 5.4.19 also line editing is disabled, so that also
|
Since libc 5.4.19 also line editing is disabled, so that also
|
||||||
|
|
|
@ -24,7 +24,9 @@ The mode of the slave is set to 0620 (crw\-\-w\-\-\-\-).
|
||||||
.PP
|
.PP
|
||||||
The behavior of
|
The behavior of
|
||||||
.BR grantpt ()
|
.BR grantpt ()
|
||||||
is unspecified if a signal handler is installed to catch SIGCHLD signals.
|
is unspecified if a signal handler is installed to catch
|
||||||
|
.B SIGCHLD
|
||||||
|
signals.
|
||||||
.SH "RETURN VALUE"
|
.SH "RETURN VALUE"
|
||||||
When successful,
|
When successful,
|
||||||
.BR grantpt ()
|
.BR grantpt ()
|
||||||
|
|
|
@ -53,17 +53,24 @@ number
|
||||||
.I signum
|
.I signum
|
||||||
is raised using the function
|
is raised using the function
|
||||||
.BR gsignal (),
|
.BR gsignal (),
|
||||||
and returns the previous such action or SIG_DFL.
|
and returns the previous such action or
|
||||||
|
.BR SIG_DFL .
|
||||||
The function
|
The function
|
||||||
.BR gsignal ()
|
.BR gsignal ()
|
||||||
does the following: if no action (or the action SIG_DFL) was
|
does the following: if no action (or the action
|
||||||
|
.BR SIG_DFL )
|
||||||
|
was
|
||||||
specified for
|
specified for
|
||||||
.IR signum ,
|
.IR signum ,
|
||||||
then it does nothing and returns 0.
|
then it does nothing and returns 0.
|
||||||
If the action SIG_IGN was specified for
|
If the action
|
||||||
|
.BR SIG_IGN
|
||||||
|
was specified for
|
||||||
.IR signum ,
|
.IR signum ,
|
||||||
then it does nothing and returns 1.
|
then it does nothing and returns 1.
|
||||||
Otherwise, it resets the action to SIG_DFL and calls
|
Otherwise, it resets the action to
|
||||||
|
.BR SIG_DFL
|
||||||
|
and calls
|
||||||
the action function with parameter
|
the action function with parameter
|
||||||
.IR signum ,
|
.IR signum ,
|
||||||
and returns the value returned by that function.
|
and returns the value returned by that function.
|
||||||
|
|
|
@ -66,7 +66,9 @@ flag of
|
||||||
Out-of-band data is only supported on some stream socket protocols.
|
Out-of-band data is only supported on some stream socket protocols.
|
||||||
|
|
||||||
.BR sockatmark ()
|
.BR sockatmark ()
|
||||||
can safely be called from a handler for the SIGURG signal.
|
can safely be called from a handler for the
|
||||||
|
.B SIGURG
|
||||||
|
signal.
|
||||||
|
|
||||||
.BR sockatmark ()
|
.BR sockatmark ()
|
||||||
is implemented using the
|
is implemented using the
|
||||||
|
@ -78,8 +80,9 @@ Prior to glibc 2.4,
|
||||||
.BR sockatmark ()
|
.BR sockatmark ()
|
||||||
did not work.
|
did not work.
|
||||||
.SH EXAMPLE
|
.SH EXAMPLE
|
||||||
The following code can be used after receipt of a SIGURG signal
|
The following code can be used after receipt of a
|
||||||
to read (and discard) all data up to the mark,
|
.B SIGURG
|
||||||
|
signal to read (and discard) all data up to the mark,
|
||||||
and then read the byte of data at the mark:
|
and then read the byte of data at the mark:
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,10 @@ etc.) are made available when including
|
||||||
.PP
|
.PP
|
||||||
As mentioned,
|
As mentioned,
|
||||||
.BR system ()
|
.BR system ()
|
||||||
ignores SIGINT and SIGQUIT.
|
ignores
|
||||||
|
.B SIGINT
|
||||||
|
and
|
||||||
|
.BR SIGQUIT .
|
||||||
This may make programs that call it
|
This may make programs that call it
|
||||||
from a loop uninterruptible, unless they take care themselves
|
from a loop uninterruptible, unless they take care themselves
|
||||||
to check the exit status of the child.
|
to check the exit status of the child.
|
||||||
|
|
|
@ -52,8 +52,11 @@ the same session as the calling process.
|
||||||
If
|
If
|
||||||
.BR tcsetpgrp ()
|
.BR tcsetpgrp ()
|
||||||
is called by a member of a background process group in its session,
|
is called by a member of a background process group in its session,
|
||||||
and the calling process is not blocking or ignoring SIGTTOU,
|
and the calling process is not blocking or ignoring
|
||||||
a SIGTTOU signal is sent to all members of this background process group.
|
.BR SIGTTOU ,
|
||||||
|
a
|
||||||
|
.B SIGTTOU
|
||||||
|
signal is sent to all members of this background process group.
|
||||||
.SH "RETURN VALUE"
|
.SH "RETURN VALUE"
|
||||||
When
|
When
|
||||||
.I fd
|
.I fd
|
||||||
|
|
|
@ -362,12 +362,18 @@ the DISCARD character.
|
||||||
[requires _BSD_SOURCE or _SVID_SOURCE]
|
[requires _BSD_SOURCE or _SVID_SOURCE]
|
||||||
.TP
|
.TP
|
||||||
.B NOFLSH
|
.B NOFLSH
|
||||||
Disable flushing the input and output queues when generating the SIGINT,
|
Disable flushing the input and output queues when generating the
|
||||||
SIGQUIT and SIGSUSP signals.
|
.BR SIGINT ,
|
||||||
|
.BR SIGQUIT ,
|
||||||
|
and
|
||||||
|
.B SIGSUSP
|
||||||
|
signals.
|
||||||
.\" Stevens lets SIGSUSP only flush the input queue
|
.\" Stevens lets SIGSUSP only flush the input queue
|
||||||
.TP
|
.TP
|
||||||
.B TOSTOP
|
.B TOSTOP
|
||||||
Send the SIGTTOU signal to the process group of a background process
|
Send the
|
||||||
|
.B SIGTTOU
|
||||||
|
signal to the process group of a background process
|
||||||
which tries to write to its controlling terminal.
|
which tries to write to its controlling terminal.
|
||||||
.TP
|
.TP
|
||||||
.B PENDIN
|
.B PENDIN
|
||||||
|
@ -389,13 +395,17 @@ The symbolic indices (initial values) and meaning are:
|
||||||
.B VINTR
|
.B VINTR
|
||||||
(003, ETX, Ctrl-C, or also 0177, DEL, rubout)
|
(003, ETX, Ctrl-C, or also 0177, DEL, rubout)
|
||||||
Interrupt character.
|
Interrupt character.
|
||||||
Send a SIGINT signal.
|
Send a
|
||||||
|
.B SIGINT
|
||||||
|
signal.
|
||||||
Recognized when ISIG is set, and then not passed as input.
|
Recognized when ISIG is set, and then not passed as input.
|
||||||
.TP
|
.TP
|
||||||
.B VQUIT
|
.B VQUIT
|
||||||
(034, FS, Ctrl-\e)
|
(034, FS, Ctrl-\e)
|
||||||
Quit character.
|
Quit character.
|
||||||
Send SIGQUIT signal.
|
Send
|
||||||
|
.BR SIGQUIT
|
||||||
|
signal.
|
||||||
Recognized when ISIG is set, and then not passed as input.
|
Recognized when ISIG is set, and then not passed as input.
|
||||||
.TP
|
.TP
|
||||||
.B VERASE
|
.B VERASE
|
||||||
|
@ -457,13 +467,17 @@ Recognized when IXON is set, and then not passed as input.
|
||||||
.B VSUSP
|
.B VSUSP
|
||||||
(032, SUB, Ctrl-Z)
|
(032, SUB, Ctrl-Z)
|
||||||
Suspend character.
|
Suspend character.
|
||||||
Send SIGTSTP signal.
|
Send
|
||||||
|
.B SIGTSTP
|
||||||
|
signal.
|
||||||
Recognized when ISIG is set, and then not passed as input.
|
Recognized when ISIG is set, and then not passed as input.
|
||||||
.TP
|
.TP
|
||||||
.B VDSUSP
|
.B VDSUSP
|
||||||
(not in POSIX; not supported under Linux; 031, EM, Ctrl-Y)
|
(not in POSIX; not supported under Linux; 031, EM, Ctrl-Y)
|
||||||
Delayed suspend character:
|
Delayed suspend character:
|
||||||
send SIGTSTP signal when the character is read by the user program.
|
send
|
||||||
|
.B SIGTSTP
|
||||||
|
signal when the character is read by the user program.
|
||||||
Recognized when IEXTEN and ISIG are set, and the system supports
|
Recognized when IEXTEN and ISIG are set, and the system supports
|
||||||
job control, and then not passed as input.
|
job control, and then not passed as input.
|
||||||
.TP
|
.TP
|
||||||
|
|
|
@ -33,19 +33,24 @@ ualarm \- schedule signal after given number of microseconds
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The
|
The
|
||||||
.BR ualarm ()
|
.BR ualarm ()
|
||||||
function causes the signal SIGALRM to be sent
|
function causes the signal
|
||||||
to the invoking process after (not less than)
|
.B SIGALRM
|
||||||
|
to be sent to the invoking process after (not less than)
|
||||||
.I usecs
|
.I usecs
|
||||||
microseconds.
|
microseconds.
|
||||||
The delay may be lengthened slightly by any system activity
|
The delay may be lengthened slightly by any system activity
|
||||||
or by the time spent processing the call or by the
|
or by the time spent processing the call or by the
|
||||||
granularity of system timers.
|
granularity of system timers.
|
||||||
.LP
|
.LP
|
||||||
Unless caught or ignored, the SIGALRM signal will terminate the process.
|
Unless caught or ignored, the
|
||||||
|
.B SIGALRM
|
||||||
|
signal will terminate the process.
|
||||||
.LP
|
.LP
|
||||||
If the
|
If the
|
||||||
.I interval
|
.I interval
|
||||||
argument is non-zero, further SIGALRM signals will be sent every
|
argument is non-zero, further
|
||||||
|
.B SIGALRM
|
||||||
|
signals will be sent every
|
||||||
.I interval
|
.I interval
|
||||||
microseconds after the first.
|
microseconds after the first.
|
||||||
.SH "RETURN VALUE"
|
.SH "RETURN VALUE"
|
||||||
|
|
|
@ -91,8 +91,9 @@ Use
|
||||||
.fi
|
.fi
|
||||||
.RE
|
.RE
|
||||||
.LP
|
.LP
|
||||||
The interaction of this function with the SIGALRM signal, and with
|
The interaction of this function with the
|
||||||
other timer functions such as
|
.B SIGALRM
|
||||||
|
signal, and with other timer functions such as
|
||||||
.BR alarm (2),
|
.BR alarm (2),
|
||||||
.BR sleep (3),
|
.BR sleep (3),
|
||||||
.BR nanosleep (2),
|
.BR nanosleep (2),
|
||||||
|
|
|
@ -41,7 +41,11 @@ request \fBTIOCNOTTY\fP is supported.
|
||||||
Detach the current process from its controlling terminal.
|
Detach the current process from its controlling terminal.
|
||||||
.sp
|
.sp
|
||||||
If the process is the session leader,
|
If the process is the session leader,
|
||||||
then SIGHUP and SIGCONT signals are sent to the foreground process group
|
then
|
||||||
|
.B SIGHUP
|
||||||
|
and
|
||||||
|
.B SIGCONT
|
||||||
|
signals are sent to the foreground process group
|
||||||
and all processes in the current session lose their controlling tty.
|
and all processes in the current session lose their controlling tty.
|
||||||
.sp
|
.sp
|
||||||
This
|
This
|
||||||
|
|
|
@ -101,7 +101,9 @@ struct winsize {
|
||||||
};
|
};
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
When the window size changes, a SIGWINCH signal is sent to the
|
When the window size changes, a
|
||||||
|
.B SIGWINCH
|
||||||
|
signal is sent to the
|
||||||
foreground process group.
|
foreground process group.
|
||||||
.SS "Sending a Break"
|
.SS "Sending a Break"
|
||||||
.TP
|
.TP
|
||||||
|
@ -215,7 +217,11 @@ it as controlling tty lose it.
|
||||||
If the given tty was the controlling tty of the current process,
|
If the given tty was the controlling tty of the current process,
|
||||||
give up this controlling tty.
|
give up this controlling tty.
|
||||||
If the process was session leader,
|
If the process was session leader,
|
||||||
then send SIGHUP and SIGCONT to the foreground process group
|
then send
|
||||||
|
.B SIGHUP
|
||||||
|
and
|
||||||
|
.B SIGCONT
|
||||||
|
to the foreground process group
|
||||||
and all processes in the current session lose their controlling tty.
|
and all processes in the current session lose their controlling tty.
|
||||||
.SS "Process group and session ID"
|
.SS "Process group and session ID"
|
||||||
.TP
|
.TP
|
||||||
|
|
|
@ -408,8 +408,9 @@ This value is hard coded to 0 as a placeholder for a removed field.
|
||||||
.TP
|
.TP
|
||||||
\fIitrealvalue\fP %ld
|
\fIitrealvalue\fP %ld
|
||||||
.\" FIXME . does this field disappear in 2.6.17-rc1?
|
.\" FIXME . does this field disappear in 2.6.17-rc1?
|
||||||
The time in jiffies before the next SIGALRM is sent to the process
|
The time in jiffies before the next
|
||||||
due to an interval timer.
|
.B SIGALRM
|
||||||
|
is sent to the process due to an interval timer.
|
||||||
.TP
|
.TP
|
||||||
\fIstarttime\fP %lu
|
\fIstarttime\fP %lu
|
||||||
The time in jiffies the process started after system boot.
|
The time in jiffies the process started after system boot.
|
||||||
|
|
|
@ -47,7 +47,8 @@ that uses both ends of the connection in order to communicate
|
||||||
with itself should be very careful to avoid deadlocks.
|
with itself should be very careful to avoid deadlocks.
|
||||||
.SH NOTES
|
.SH NOTES
|
||||||
When a process tries to write to a FIFO that is not opened
|
When a process tries to write to a FIFO that is not opened
|
||||||
for read on the other side, the process is sent a SIGPIPE
|
for read on the other side, the process is sent a
|
||||||
|
.B SIGPIPE
|
||||||
signal.
|
signal.
|
||||||
|
|
||||||
FIFO special files can be created by
|
FIFO special files can be created by
|
||||||
|
|
|
@ -146,7 +146,11 @@ This thread handles thread creation and termination.
|
||||||
.IP \- 3
|
.IP \- 3
|
||||||
Signals are used internally by the implementation.
|
Signals are used internally by the implementation.
|
||||||
On Linux 2.2 and later, the first three real-time signals are used.
|
On Linux 2.2 and later, the first three real-time signals are used.
|
||||||
On older Linux kernels, SIGUSR1 and SIGUSR2 are used.
|
On older Linux kernels,
|
||||||
|
.B SIGUSR1
|
||||||
|
and
|
||||||
|
.B SIGUSR2
|
||||||
|
are used.
|
||||||
Applications must avoid the use of whichever set of signals is
|
Applications must avoid the use of whichever set of signals is
|
||||||
employed by the implementation.
|
employed by the implementation.
|
||||||
.IP \- 3
|
.IP \- 3
|
||||||
|
|
|
@ -37,7 +37,8 @@ then be driven by a program that has opened the master end.
|
||||||
Anything that is written on the master end is provided to the process
|
Anything that is written on the master end is provided to the process
|
||||||
on the slave end as though it was input typed on a terminal.
|
on the slave end as though it was input typed on a terminal.
|
||||||
For example, writing the interrupt character (usually control-C)
|
For example, writing the interrupt character (usually control-C)
|
||||||
to the master device would cause an interrupt signal (SIGINT)
|
to the master device would cause an interrupt signal
|
||||||
|
.RB ( SIGINT )
|
||||||
to be generated for the foreground process group
|
to be generated for the foreground process group
|
||||||
that is connected to the slave.
|
that is connected to the slave.
|
||||||
Conversely, anything that is written to the slave end of the
|
Conversely, anything that is written to the slave end of the
|
||||||
|
|
Loading…
Reference in New Issue