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 read 28 (0x1c) from efd
.fi
.SS Program source
.R " "
.in
.nf
#include <sys/eventfd.h>
#include <unistd.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
.fi
.in
.SS Program source
.R " "
.nf
#define HAVE_D_TYPE /* Remove for kernels < 2.6.4 */
#define _GNU_SOURCE

View File

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

View File

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

View File

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

View File

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

View File

@ -183,8 +183,9 @@ backtrace() returned 8 addresses
\&./prog [0x8048711]
.in
.fi
.SS Program source
.R " "
.nf
#include <execinfo.h>
#include <stdio.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"
CPU-time clock for PID 1 is 2.213466748 seconds
.fi
.in
.SS Program source
.R " "
.nf
#define _XOPEN_SOURCE 600
#include <stdio.h>

View File

@ -82,9 +82,10 @@ First address past:
program text (etext) 0x8048568
initialized data (edata) 0x804a01c
uninitialized data (end) 0x804a024
.fi
.in
.SS Program source
.R " "
.nf
#include <stdio.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"
size=11; ptr=1 529 1849
.fi
.in
.SS Program source
.R " "
.nf
#define _GNU_SOURCE
#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
(e.g., opening a stream with a cookie that already has an open stream;
closing a stream that has already been closed).
.SS Program source
.R " "
.nf
#define _GNU_SOURCE
#include <sys/types.h>
#include <stdio.h>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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