]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
pipe.2, sigaltstack.2, abort.3, signal.7: Place SH sections in standard order
authorMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 19 May 2020 07:59:28 +0000 (09:59 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 19 May 2020 13:45:01 +0000 (15:45 +0200)
Fix various pages that deviated from the norm described in
man-pages(7).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/pipe.2
man2/sigaltstack.2
man3/abort.3
man7/signal.7

index 4a5a10567e61e671da125ca0ef22947a5f78a357..bbd5cff92a24adee98b97ad2afc8dab1b72479d9 100644 (file)
@@ -193,6 +193,12 @@ has been reached and the caller is not privileged; see
 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".
@@ -210,12 +216,6 @@ wrapper function transparently deals with this.
 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
index 22f57b92a40d3a9ab7f48e9fde0f14493f6764ab..98d4d9c707a7178f4a3d5ed55ad854b0687d11ac 100644 (file)
@@ -286,42 +286,6 @@ system call.
 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
@@ -360,6 +324,42 @@ give an error if
 .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),
index beafdc8dbab29f0bec0fb374545d329de396303c..28cdf9da5e302b0cc0c01597d0ba8448941a1862 100644 (file)
@@ -79,6 +79,8 @@ T{
 .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
@@ -94,8 +96,6 @@ terminates the process without flushing streams.
 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),
index 433bfc30474a9fc16e5bea5bd6e5716197ec6d4f..b1b3fffaa2bc53d6602ba532414e37b0c5e248aa 100644 (file)
@@ -814,6 +814,32 @@ Linux 2.4 and earlier:
 .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:
@@ -844,32 +870,6 @@ even though
 .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),