was added to Linux in version 2.6.27;
glibc support is available starting with
version 2.9.
+.SH CONFORMING TO
+.BR pipe ():
+POSIX.1-2001, POSIX.1-2008.
+.PP
+.BR pipe2 ()
+is Linux-specific.
.SH NOTES
.\" See http://math-atlas.sourceforge.net/devel/assembly/64.psabi.1.33.ps.Z
.\" for example, section 3.2.1 "Registers and the Stack Frame".
See
.BR syscall (2)
for information regarding registers used for storing second file descriptor.
-.SH CONFORMING TO
-.BR pipe ():
-POSIX.1-2001, POSIX.1-2008.
-.PP
-.BR pipe2 ()
-is Linux-specific.
.SH EXAMPLE
.\" fork.2 refers to this example program.
The following program creates a pipe, and then
It used a slightly
different struct, and had the major disadvantage that the caller
had to know the direction of stack growth.
-.SH EXAMPLE
-The following code segment demonstrates the use of
-.BR sigaltstack ()
-(and
-.BR sigaction (2))
-to install an alternate signal stack that is employed by a handler
-for the
-.BR SIGSEGV
-signal:
-.PP
-.in +4n
-.EX
-stack_t ss;
-
-ss.ss_sp = malloc(SIGSTKSZ);
-if (ss.ss_sp == NULL) {
- perror("malloc");
- exit(EXIT_FAILURE);
-}
-
-ss.ss_size = SIGSTKSZ;
-ss.ss_flags = 0;
-if (sigaltstack(&ss, NULL) == \-1) {
- perror("sigaltstack");
- exit(EXIT_FAILURE);
-}
-
-sa.sa_flags = SA_ONSTACK;
-sa.sa_handler = handler(); /* Address of a signal handler */
-sigemptyset(&sa.sa_mask);
-if (sigaction(SIGSEGV, &sa, NULL) == -1) {
- perror("sigaction");
- exit(EXIT_FAILURE);
-}
-.EE
-.in
.SH BUGS
In Linux 2.2 and earlier, the only flag that could be specified
in
.B SS_ONSTACK
is specified in
.IR ss.ss_flags .
+.SH EXAMPLE
+The following code segment demonstrates the use of
+.BR sigaltstack ()
+(and
+.BR sigaction (2))
+to install an alternate signal stack that is employed by a handler
+for the
+.BR SIGSEGV
+signal:
+.PP
+.in +4n
+.EX
+stack_t ss;
+
+ss.ss_sp = malloc(SIGSTKSZ);
+if (ss.ss_sp == NULL) {
+ perror("malloc");
+ exit(EXIT_FAILURE);
+}
+
+ss.ss_size = SIGSTKSZ;
+ss.ss_flags = 0;
+if (sigaltstack(&ss, NULL) == \-1) {
+ perror("sigaltstack");
+ exit(EXIT_FAILURE);
+}
+
+sa.sa_flags = SA_ONSTACK;
+sa.sa_handler = handler(); /* Address of a signal handler */
+sigemptyset(&sa.sa_mask);
+if (sigaction(SIGSEGV, &sa, NULL) == -1) {
+ perror("sigaction");
+ exit(EXIT_FAILURE);
+}
+.EE
+.in
.SH SEE ALSO
.BR execve (2),
.BR setrlimit (2),
.BR abort ()
T} Thread safety MT-Safe
.TE
+.SH CONFORMING TO
+SVr4, POSIX.1-2001, POSIX.1-2008, 4.3BSD, C89, C99.
.SH NOTES
Up until glibc 2.26,
if the
POSIX.1 permits either possible behavior, saying that
.BR abort ()
"may include an attempt to effect fclose() on all open streams".
-.SH CONFORMING TO
-SVr4, POSIX.1-2001, POSIX.1-2008, 4.3BSD, C89, C99.
.SH SEE ALSO
.BR gdb (1),
.BR sigaction (2),
.BR nanosleep (2).
.SH CONFORMING TO
POSIX.1, except as noted.
+.SH NOTES
+For a discussion of async-signal-safe functions, see
+.BR signal-safety (7).
+.PP
+The
+.I /proc/[pid]/task/[tid]/status
+file contains various fields that show the signals
+that a thread is blocking
+.RI ( SigBlk ),
+catching
+.RI ( SigCgt ),
+or ignoring
+.RI ( SigIgn ).
+(The set of signals that are caught or ignored will be the same
+across all threads in a process.)
+Other fields show the set of pending signals that are directed to the thread
+.RI ( SigPnd )
+as well as the set of pending signals that are directed
+to the process as a whole
+.RI ( ShdPnd ).
+The corresponding fields in
+.I /proc/[pid]/status
+show the information for the main thread.
+See
+.BR proc (5)
+for further details.
.SH BUGS
There are six signals that can be delivered
as a consequence of a hardware exception:
.B SIGILL
would make more sense,
because of how the CPU reports the forbidden operation to the kernel.
-.SH NOTES
-For a discussion of async-signal-safe functions, see
-.BR signal-safety (7).
-.PP
-The
-.I /proc/[pid]/task/[tid]/status
-file contains various fields that show the signals
-that a thread is blocking
-.RI ( SigBlk ),
-catching
-.RI ( SigCgt ),
-or ignoring
-.RI ( SigIgn ).
-(The set of signals that are caught or ignored will be the same
-across all threads in a process.)
-Other fields show the set of pending signals that are directed to the thread
-.RI ( SigPnd )
-as well as the set of pending signals that are directed
-to the process as a whole
-.RI ( ShdPnd ).
-The corresponding fields in
-.I /proc/[pid]/status
-show the information for the main thread.
-See
-.BR proc (5)
-for further details.
.SH SEE ALSO
.BR kill (1),
.BR clone (2),