eventfd.2, getdents.2, mprotect.2, signalfd.2, timerfd_create.2, wait.2, backtrace.3, clock_getcpuclockid.3, end.3, fmemopen.3, fopencookie.3, getdate.3, getgrouplist.3, getprotoent_r.3, getservent_r.3, gnu_get_libc_version.3, inet.3, inet_pton.3, makecontext.3, matherr.3, offsetof.3, pthread_attr_init.3, pthread_create.3, pthread_getattr_np.3, sem_wait.3, strtol.3, core.5: global fix: Add ".SS Program source" to EXAMPLE

Add ".SS Program source" to clearly distinguish shell session and
descriptive text from actual program code.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2008-10-28 10:51:05 -05:00
parent b43a3b301e
commit 9c33050447
27 changed files with 54 additions and 35 deletions

View File

@ -324,9 +324,10 @@ Child completed write loop
Parent about to read Parent about to read
Parent read 28 (0x1c) from efd Parent read 28 (0x1c) from efd
.fi .fi
.SS Program source
.R " "
.in .in
.nf .nf
#include <sys/eventfd.h> #include <sys/eventfd.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -177,7 +177,8 @@ i-node# file type d_reclen d_off d_name
130817 directory 16 4096 sub3 130817 directory 16 4096 sub3
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#define HAVE_D_TYPE /* Remove for kernels < 2.6.4 */ #define HAVE_D_TYPE /* Remove for kernels < 2.6.4 */
#define _GNU_SOURCE #define _GNU_SOURCE

View File

@ -155,9 +155,10 @@ following:
Start of region: 0x804c000 Start of region: 0x804c000
Got SIGSEGV at address: 0x804e000 Got SIGSEGV at address: 0x804e000
.fi .fi
.SS Program source
.R " "
.in .in
.nf .nf
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>

View File

@ -381,9 +381,10 @@ Got SIGINT
Got SIGQUIT Got SIGQUIT
$ $
.fi .fi
.SS Program source
.R " "
.in .in
.nf .nf
#include <sys/signalfd.h> #include <sys/signalfd.h>
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>

View File

@ -374,8 +374,9 @@ a.out 3 1 100
.BR "^C " " # type control-C to suspend the program" .BR "^C " " # type control-C to suspend the program"
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
.\" The commented out code here is what we currently need until .\" The commented out code here is what we currently need until
.\" the required stuff is in glibc .\" the required stuff is in glibc
.\" .\"

View File

@ -535,9 +535,10 @@ continued
killed by signal 15 killed by signal 15
[1]+ Done ./a.out [1]+ Done ./a.out
$ $
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#include <sys/wait.h> #include <sys/wait.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -183,8 +183,9 @@ backtrace() returned 8 addresses
\&./prog [0x8048711] \&./prog [0x8048711]
.in .in
.fi .fi
.SS Program source
.R " "
.nf .nf
#include <execinfo.h> #include <execinfo.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -103,9 +103,10 @@ An example run is the following:
.RB "$" " ./a.out 1" " # Show CPU clock of init process" .RB "$" " ./a.out 1" " # Show CPU clock of init process"
CPU-time clock for PID 1 is 2.213466748 seconds CPU-time clock for PID 1 is 2.213466748 seconds
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#define _XOPEN_SOURCE 600 #define _XOPEN_SOURCE 600
#include <stdio.h> #include <stdio.h>

View File

@ -82,9 +82,10 @@ First address past:
program text (etext) 0x8048568 program text (etext) 0x8048568
initialized data (edata) 0x804a01c initialized data (edata) 0x804a01c
uninitialized data (end) 0x804a024 uninitialized data (end) 0x804a024
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -168,9 +168,10 @@ An example of the output produced by this program is the following:
.RB "$" " ./a.out \(aq1 23 43\(aq" .RB "$" " ./a.out \(aq1 23 43\(aq"
size=11; ptr=1 529 1849 size=11; ptr=1 529 1849
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#define _GNU_SOURCE #define _GNU_SOURCE
#include <assert.h> #include <assert.h>

View File

@ -264,8 +264,9 @@ Note that a more general version of the program below
could be improved to more robustly handle various error situations could be improved to more robustly handle various error situations
(e.g., opening a stream with a cookie that already has an open stream; (e.g., opening a stream with a cookie that already has an open stream;
closing a stream that has already been closed). closing a stream that has already been closed).
.SS Program source
.R " "
.nf .nf
#define _GNU_SOURCE #define _GNU_SOURCE
#include <sys/types.h> #include <sys/types.h>
#include <stdio.h> #include <stdio.h>

View File

@ -242,7 +242,8 @@ Call 3 ("12:22:33") succeeded:
tm_isdst = 1 tm_isdst = 1
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#define _GNU_SOURCE 500 #define _GNU_SOURCE 500
#include <time.h> #include <time.h>

View File

@ -124,8 +124,9 @@ ngroups = 3
33 (video) 33 (video)
100 (users) 100 (users)
.fi .fi
.sp
.in .in
.SS Program source
.R " "
.nf .nf
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -153,9 +153,10 @@ p_name=tcp; p_proto=6; aliases=TCP
ERANGE! Retrying with larger buffer ERANGE! Retrying with larger buffer
getprotobyname_r() returned: 0 (success) (buflen=100) getprotobyname_r() returned: 0 (success) (buflen=100)
Call failed/record not found Call failed/record not found
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#define _GNU_SOURCE #define _GNU_SOURCE
#include <ctype.h> #include <ctype.h>

View File

@ -151,9 +151,10 @@ s_name=echo; s_proto=tcp; s_port=7; aliases=
.RB "$" " ./a.out 77777 tcp" .RB "$" " ./a.out 77777 tcp"
getservbyport_r() returned: 0 (success) (buflen=1024) getservbyport_r() returned: 0 (success) (buflen=1024)
Call failed/record not found Call failed/record not found
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#define _GNU_SOURCE #define _GNU_SOURCE
#include <ctype.h> #include <ctype.h>

View File

@ -55,9 +55,10 @@ When run, the program below will produce output such as the following:
.RB "$" " ./a.out" .RB "$" " ./a.out"
GNU libc version: 2.8 GNU libc version: 2.8
GNU libc release: stable GNU libc release: stable
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#include <gnu/libc-version.h> #include <gnu/libc-version.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -265,9 +265,10 @@ Here are some example runs:
226.0.0.31 226.0.0.31
.RB "$" " ./a.out 0x7f.1 " " # First byte is in hex" .RB "$" " ./a.out 0x7f.1 " " # First byte is in hex"
127.0.0.1 127.0.0.1
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#define _BSD_SOURCE #define _BSD_SOURCE
#include <arpa/inet.h> #include <arpa/inet.h>

View File

@ -166,9 +166,10 @@ Here are some example runs:
1::8 1::8
.RB "$" " ./a.out i6 0:0:0:0:0:FFFF:204.152.189.116" .RB "$" " ./a.out i6 0:0:0:0:0:FFFF:204.152.189.116"
::ffff:204.152.189.116 ::ffff:204.152.189.116
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#include <arpa/inet.h> #include <arpa/inet.h>
#include <stdio.h> #include <stdio.h>

View File

@ -133,9 +133,10 @@ func1: swapcontext(&uctx_func1, &uctx_func2)
func2: returning func2: returning
func1: returning func1: returning
main: exiting main: exiting
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#include <ucontext.h> #include <ucontext.h>
#include <stdio.h> #include <stdio.h>

View File

@ -351,7 +351,8 @@ matherr SING exception in log() function
x=12345.000000 x=12345.000000
.fi .fi
.in .in
.SS Example code .SS Program source
.R " "
.nf .nf
#define _SVID_SOURCE #define _SVID_SOURCE
#include <errno.h> #include <errno.h>

View File

@ -67,9 +67,10 @@ options, the program below produces the following output:
.RB "$" " ./a.out" .RB "$" " ./a.out"
offsets: i=0; c=4; d=8 a=16 offsets: i=0; c=4; d=8 a=16
sizeof(struct s)=16 sizeof(struct s)=16
.fi .fi
.nf .nf
.SS Program source
.R " "
.nf .nf
#include <stddef.h> #include <stddef.h>
#include <stdio.h> #include <stdio.h>

View File

@ -142,9 +142,8 @@ Thread attributes:
Stack size = 0x3000000 bytes Stack size = 0x3000000 bytes
.fi .fi
.in .in
.SS Program source
Here is the program source: .R " "
.nf .nf
#define _GNU_SOURCE /* To get pthread_getattr_np() declaration */ #define _GNU_SOURCE /* To get pthread_getattr_np() declaration */
#include <pthread.h> #include <pthread.h>

View File

@ -230,7 +230,8 @@ Joined with thread 2; returned value was SALUT
Joined with thread 3; returned value was SERVUS Joined with thread 3; returned value was SERVUS
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#include <pthread.h> #include <pthread.h>
#include <string.h> #include <string.h>

View File

@ -172,7 +172,8 @@ Attributes of created thread:
Stack size = 0x8000 (32768) bytes Stack size = 0x8000 (32768) bytes
.fi .fi
.in .in
.SS Program source
.R " "
.nf .nf
#define _GNU_SOURCE /* To get pthread_getattr_np() declaration */ #define _GNU_SOURCE /* To get pthread_getattr_np() declaration */
#include <pthread.h> #include <pthread.h>

View File

@ -182,10 +182,9 @@ About to call sem_timedwait()
sem_timedwait() timed out sem_timedwait() timed out
.fi .fi
.in .in
.PP .SS Program source
The source code of the program is as follows: .R " "
.nf .nf
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -201,12 +201,11 @@ strtol: Invalid argument
No digits were found No digits were found
.RB "$" " ./a.out 4000000000" .RB "$" " ./a.out 4000000000"
strtol: Numerical result out of range strtol: Numerical result out of range
.fi .fi
.in .in
The source code of the program is as follows: .SS Program source
.R " "
.nf .nf
#include <stdlib.h> #include <stdlib.h>
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>

View File

@ -315,9 +315,8 @@ argc[4]=<sig=3>
Total bytes in core dump: 282624 Total bytes in core dump: 282624
.fi .fi
.in .in
.PP .SS Program source
The source code of the program is as follows: .R " "
.PP
.nf .nf
/* core_pattern_pipe_test.c */ /* core_pattern_pipe_test.c */