mirror of https://github.com/mkerrisk/man-pages
eventfd.2, execve.2, getdents.2, ioprio_set.2, mprotect.2, signalfd.2, timerfd_create.2, wait.2, backtrace.3, clock_getcpuclockid.3, end.3, fmemopen.3, fopencookie.3, frexp.3, getdate.3, getgrouplist.3, getprotoent_r.3, getservent_r.3, gnu_get_libc_version.3, inet.3, inet_pton.3, makecontext.3, malloc.3, matherr.3, offsetof.3, pthread_attr_init.3, pthread_create.3, pthread_getattr_np.3, sem_wait.3, strftime.3, strtok.3, strtol.3, core.5, proc.5, cpuset.7, mq_overview.7: Global fix: Format user input in shell sessions in boldface
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
7e1d89c9b2
commit
b43a3b301e
|
@ -314,7 +314,7 @@ The following shell session shows a sample run of the program:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out 1 2 4 7 14
|
||||
.RB "$" " ./a.out 1 2 4 7 14"
|
||||
Child writing 1 to efd
|
||||
Child writing 2 to efd
|
||||
Child writing 4 to efd
|
||||
|
|
|
@ -581,9 +581,9 @@ We can use the second program to exec the first as follows:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ cc myecho.c \-o myecho
|
||||
$ cc execve.c \-o execve
|
||||
$ ./execve ./myecho
|
||||
.RB "$" " cc myecho.c \-o myecho"
|
||||
.RB "$" " cc execve.c \-o execve"
|
||||
.RB "$" " ./execve ./myecho"
|
||||
argv[0]: ./myecho
|
||||
argv[1]: hello
|
||||
argv[2]: world
|
||||
|
@ -598,10 +598,10 @@ program:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ cat > script.sh
|
||||
.RB "$" " cat > script.sh"
|
||||
#! ./myecho script-arg
|
||||
^D
|
||||
$ chmod +x script.sh
|
||||
.B ^D
|
||||
.RB "$" " chmod +x script.sh"
|
||||
.fi
|
||||
.in
|
||||
|
||||
|
@ -609,7 +609,7 @@ We can then use our program to exec the script:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ./execve ./script.sh
|
||||
.RB "$" " ./execve ./script.sh"
|
||||
argv[0]: ./myecho
|
||||
argv[1]: script-arg
|
||||
argv[2]: ./script.sh
|
||||
|
|
|
@ -165,7 +165,7 @@ program on an ext2 directory:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ./a.out /testfs/
|
||||
.RB "$" " ./a.out /testfs/"
|
||||
--------------- nread=120 ---------------
|
||||
i-node# file type d_reclen d_off d_name
|
||||
2 directory 16 12 .
|
||||
|
|
|
@ -206,7 +206,7 @@ displays a list of all schedulers currently loaded in the kernel:
|
|||
.sp
|
||||
.RS
|
||||
.nf
|
||||
$ cat /sys/block/hda/queue/scheduler
|
||||
.RB "$" " cat /sys/block/hda/queue/scheduler"
|
||||
noop anticipatory deadline [cfq]
|
||||
.fi
|
||||
.RE
|
||||
|
@ -225,9 +225,9 @@ device to
|
|||
.sp
|
||||
.RS
|
||||
.nf
|
||||
$ su
|
||||
.RB "$" " su"
|
||||
Password:
|
||||
# echo cfq > /sys/block/hda/queue/scheduler
|
||||
.RB "#" " echo cfq > /sys/block/hda/queue/scheduler"
|
||||
.fi
|
||||
.RE
|
||||
.SS "The Completely Fair Queuing (CFQ) I/O Scheduler"
|
||||
|
|
|
@ -151,7 +151,7 @@ following:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ./a.out
|
||||
.RB "$" " ./a.out"
|
||||
Start of region: 0x804c000
|
||||
Got SIGSEGV at address: 0x804e000
|
||||
.fi
|
||||
|
|
|
@ -372,12 +372,12 @@ The following shell session demonstrates the use of the program:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./signalfd_demo
|
||||
^C # Control\-C generates SIGINT
|
||||
.RB "$" " ./signalfd_demo"
|
||||
.BR "^C" " # Control\-C generates SIGINT"
|
||||
Got SIGINT
|
||||
^C
|
||||
.B ^C
|
||||
Got SIGINT
|
||||
^\\ # Control\-\\ generates SIGQUIT
|
||||
\fB^\\\fP # Control\-\\ generates SIGQUIT
|
||||
Got SIGQUIT
|
||||
$
|
||||
.fi
|
||||
|
|
|
@ -360,18 +360,18 @@ The following shell session demonstrates the use of the program:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ a.out 3 1 100
|
||||
.RB "$" " a.out 3 1 100"
|
||||
0.000: timer started
|
||||
3.000: read: 1; total=1
|
||||
4.000: read: 1; total=2
|
||||
[type control-Z to suspend the program]
|
||||
.BR "^Z " " # type control-Z to suspend the program"
|
||||
[1]+ Stopped ./timerfd3_demo 3 1 100
|
||||
$ fg # Resume execution after a few seconds
|
||||
.RB "$ " "fg" " # Resume execution after a few seconds"
|
||||
a.out 3 1 100
|
||||
9.660: read: 5; total=7
|
||||
10.000: read: 1; total=8
|
||||
11.000: read: 1; total=9
|
||||
[type control-C to terminate the program]
|
||||
.BR "^C " " # type control-C to suspend the program"
|
||||
.fi
|
||||
.in
|
||||
.nf
|
||||
|
|
|
@ -524,14 +524,14 @@ The following shell session demonstrates the use of the program:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out &
|
||||
.RB "$" " ./a.out &"
|
||||
Child PID is 32360
|
||||
[1] 32359
|
||||
$ kill \-STOP 32360
|
||||
.RB "$" " kill \-STOP 32360"
|
||||
stopped by signal 19
|
||||
$ kill \-CONT 32360
|
||||
.RB "$" " kill \-CONT 32360"
|
||||
continued
|
||||
$ kill \-TERM 32360
|
||||
.RB "$" " kill \-TERM 32360"
|
||||
killed by signal 15
|
||||
[1]+ Done ./a.out
|
||||
$
|
||||
|
|
|
@ -170,17 +170,17 @@ program:
|
|||
.nf
|
||||
.in +4n
|
||||
|
||||
$ cc \-rdynamic prog.c \-o prog
|
||||
$ ./prog 3
|
||||
backtrace() returned 8 addresses
|
||||
./prog(myfunc3+0x5c) [0x80487f0]
|
||||
./prog [0x8048871]
|
||||
./prog(myfunc+0x21) [0x8048894]
|
||||
./prog(myfunc+0x1a) [0x804888d]
|
||||
./prog(myfunc+0x1a) [0x804888d]
|
||||
./prog(main+0x65) [0x80488fb]
|
||||
/lib/libc.so.6(__libc_start_main+0xdc) [0xb7e38f9c]
|
||||
./prog [0x8048711]
|
||||
.RB "$" " cc \-rdynamic prog.c \-o prog"
|
||||
.RB "$" " ./prog 3"
|
||||
backtrace() returned 8 addresses
|
||||
\&./prog(myfunc3+0x5c) [0x80487f0]
|
||||
\&./prog [0x8048871]
|
||||
\&./prog(myfunc+0x21) [0x8048894]
|
||||
\&./prog(myfunc+0x1a) [0x804888d]
|
||||
\&./prog(myfunc+0x1a) [0x804888d]
|
||||
\&./prog(main+0x65) [0x80488fb]
|
||||
\&/lib/libc.so.6(__libc_start_main+0xdc) [0xb7e38f9c]
|
||||
\&./prog [0x8048711]
|
||||
.in
|
||||
.fi
|
||||
.nf
|
||||
|
|
|
@ -101,7 +101,7 @@ An example run is the following:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./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
|
||||
|
||||
.fi
|
||||
|
|
|
@ -77,7 +77,7 @@ When run, the program below produces output such as the following:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out
|
||||
.RB "$" " ./a.out"
|
||||
First address past:
|
||||
program text (etext) 0x8048568
|
||||
initialized data (edata) 0x804a01c
|
||||
|
|
|
@ -166,7 +166,7 @@ An example of the output produced by this program is the following:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out "1 23 43"
|
||||
.RB "$" " ./a.out \(aq1 23 43\(aq"
|
||||
size=11; ptr=1 529 1849
|
||||
|
||||
.fi
|
||||
|
|
|
@ -252,7 +252,7 @@ The following shell session demonstrates the use of the program:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out 'hello world'
|
||||
.RB "$" " ./a.out \(aqhello world\(aq"
|
||||
/he/
|
||||
/ w/
|
||||
/d/
|
||||
|
|
|
@ -120,9 +120,9 @@ This program produces results such as the following:
|
|||
.sp
|
||||
.nf
|
||||
.in +4n
|
||||
$ ./a.out 2560
|
||||
.RB "$" " ./a.out 2560"
|
||||
frexp(2560, &e) = 0.625: 0.625 * 2^12 = 2560
|
||||
$ ./a.out \-4
|
||||
.RB "$" " ./a.out \-4"
|
||||
frexp(\-4, &e) = \-0.5: \-0.5 * 2^3 = -4
|
||||
.in
|
||||
.fi
|
||||
|
|
|
@ -202,13 +202,13 @@ The following shell session demonstrates the operation of the program:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ TFILE=$PWD/tfile
|
||||
$ echo "%A" > $TFILE # Full weekday name
|
||||
$ echo "%T" >> $TFILE # ISO date (YYYY-MM-DD)
|
||||
$ echo "%F" >> $TFILE # Time (HH:MM:SS)
|
||||
$ date
|
||||
$ export DATEMSK=$TFILE
|
||||
$ ./a.out Tuesday "2009-12-28" "12:22:33"
|
||||
.RB "$" " TFILE=$PWD/tfile"
|
||||
.RB "$" " echo \(aq%A\(aq > $TFILE " " # Full weekday name"
|
||||
.RB "$" " echo \(aq%T\(aq >> $TFILE" " # ISO date (YYYY-MM-DD)"
|
||||
.RB "$" " echo \(aq%F\(aq >> $TFILE" " # Time (HH:MM:SS)"
|
||||
.RB "$" " date"
|
||||
.RB "$" " export DATEMSK=$TFILE"
|
||||
.RB "$" " ./a.out Tuesday \(aq2009-12-28\(aq \(aq12:22:33\(aq"
|
||||
Sun Sep 7 06:03:36 CEST 2008
|
||||
Call 1 ("Tuesday") succeeded:
|
||||
tm_sec = 36
|
||||
|
|
|
@ -116,9 +116,9 @@ The following shell session shows examples of the use of this program:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out cecilia 0
|
||||
.RB "$" " ./a.out cecilia 0"
|
||||
getgrouplist() returned -1; ngroups = 3
|
||||
$ ./a.out cecilia 3
|
||||
.RB "$" " ./a.out cecilia 3"
|
||||
ngroups = 3
|
||||
16 (dialout)
|
||||
33 (video)
|
||||
|
|
|
@ -145,11 +145,11 @@ The following shell session shows a couple of sample runs:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out tcp 1
|
||||
.RB "$" " ./a.out tcp 1"
|
||||
ERANGE! Retrying with larger buffer
|
||||
getprotobyname_r() returned: 0 (success) (buflen=78)
|
||||
p_name=tcp; p_proto=6; aliases=TCP
|
||||
$ ./a.out xxx 1
|
||||
.RB "$" " ./a.out xxx 1"
|
||||
ERANGE! Retrying with larger buffer
|
||||
getprotobyname_r() returned: 0 (success) (buflen=100)
|
||||
Call failed/record not found
|
||||
|
|
|
@ -144,11 +144,11 @@ The following shell session shows a couple of sample runs:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out 7 tcp 1
|
||||
.RB "$" " ./a.out 7 tcp 1"
|
||||
ERANGE! Retrying with larger buffer
|
||||
getservbyport_r() returned: 0 (success) (buflen=87)
|
||||
s_name=echo; s_proto=tcp; s_port=7; aliases=
|
||||
$ ./a.out 77777 tcp
|
||||
.RB "$" " ./a.out 77777 tcp"
|
||||
getservbyport_r() returned: 0 (success) (buflen=1024)
|
||||
Call failed/record not found
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ When run, the program below will produce output such as the following:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out
|
||||
.RB "$" " ./a.out"
|
||||
GNU libc version: 2.8
|
||||
GNU libc release: stable
|
||||
|
||||
|
|
|
@ -261,9 +261,9 @@ Here are some example runs:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out 226.000.000.037 # Last byte is in octal
|
||||
.RB "$" " ./a.out 226.000.000.037" " # Last byte is in octal"
|
||||
226.0.0.31
|
||||
$ ./a.out 0x7f.1 # First byte is in hex
|
||||
.RB "$" " ./a.out 0x7f.1 " " # First byte is in hex"
|
||||
127.0.0.1
|
||||
|
||||
.fi
|
||||
|
|
|
@ -160,11 +160,11 @@ Here are some example runs:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out i6 0:0:0:0:0:0:0:0
|
||||
.RB "$" " ./a.out i6 0:0:0:0:0:0:0:0"
|
||||
::
|
||||
$ ./a.out i6 1:0:0:0:0:0:0:8
|
||||
.RB "$" " ./a.out i6 1:0:0:0:0:0:0:8"
|
||||
1::8
|
||||
$ ./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
|
||||
|
||||
.fi
|
||||
|
|
|
@ -124,7 +124,7 @@ Running the program produces the following output:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out
|
||||
.RB "$" " ./a.out"
|
||||
main: swapcontext(&uctx_main, &uctx_func2)
|
||||
func2: started
|
||||
func2: swapcontext(&uctx_func2, &uctx_func1)
|
||||
|
|
|
@ -252,7 +252,7 @@ one can switch off this overcommitting behavior using a command like:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
# echo 2 > /proc/sys/vm/overcommit_memory
|
||||
.RB "#" " echo 2 > /proc/sys/vm/overcommit_memory"
|
||||
|
||||
.fi
|
||||
.in
|
||||
|
|
|
@ -295,7 +295,7 @@ is given an argument of 0.0, does not use
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ./a.out 0.0
|
||||
.RB "$" " ./a.out 0.0"
|
||||
errno: Numerical result out of range
|
||||
x=-inf
|
||||
.fi
|
||||
|
@ -307,7 +307,7 @@ is called, and returns 0:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ./a.out 0.0 0
|
||||
.RB "$" " ./a.out 0.0 0"
|
||||
matherr SING exception in log() function
|
||||
args: 0.000000, 0.000000
|
||||
retval: -340282346638528859811704183484516925440.000000
|
||||
|
@ -325,7 +325,7 @@ is called, and returns a non-zero value:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ./a.out 0.0 1
|
||||
.RB "$" " ./a.out 0.0 1"
|
||||
matherr SING exception in log() function
|
||||
args: 0.000000, 0.000000
|
||||
retval: -340282346638528859811704183484516925440.000000
|
||||
|
@ -344,7 +344,7 @@ and returns a non-zero value:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ./a.out 0.0 1 12345.0
|
||||
.RB "$" " ./a.out 0.0 1 12345.0"
|
||||
matherr SING exception in log() function
|
||||
args: 0.000000, 0.000000
|
||||
retval: -340282346638528859811704183484516925440.000000
|
||||
|
|
|
@ -64,7 +64,7 @@ options, the program below produces the following output:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out
|
||||
.RB "$" " ./a.out"
|
||||
offsets: i=0; c=4; d=8 a=16
|
||||
sizeof(struct s)=16
|
||||
|
||||
|
|
|
@ -103,9 +103,9 @@ we see the following:
|
|||
.in +4n
|
||||
.nf
|
||||
.\" Results from glibc 2.8, SUSE 11.0; Oct 2008
|
||||
$ ulimit \-s # No stack imit ==> default stack size is 2MB
|
||||
.RB "$" " ulimit \-s" " # No stack imit ==> default stack size is 2MB"
|
||||
unlimited
|
||||
$ ./a.out
|
||||
.RB "$" " ./a.out"
|
||||
Thread attributes:
|
||||
Detach state = PTHREAD_CREATE_JOINABLE
|
||||
Scope = PTHREAD_SCOPE_SYSTEM
|
||||
|
@ -129,7 +129,7 @@ we see the following:
|
|||
.in +4n
|
||||
.nf
|
||||
.\" Results from glibc 2.8, SUSE 11.0; Oct 2008
|
||||
$ ./a.out 0x3000000
|
||||
.RB "$" " ./a.out 0x3000000"
|
||||
posix_memalign() allocated at 0x40197000
|
||||
Thread attributes:
|
||||
Detach state = PTHREAD_CREATE_DETACHED
|
||||
|
|
|
@ -203,9 +203,9 @@ the stack size defaults to the value given by the
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ulimit \-s
|
||||
.RB "$" " ulimit \-s"
|
||||
8192 # The stack size limit is 8 MB (0x80000 bytes)
|
||||
$ ./a.out hola salut servus
|
||||
.RB "$" " ./a.out hola salut servus"
|
||||
Thread 1: top of stack near 0xb7dd03b8; argv_string=hola
|
||||
Thread 2: top of stack near 0xb75cf3b8; argv_string=salut
|
||||
Thread 3: top of stack near 0xb6dce3b8; argv_string=servus
|
||||
|
@ -221,7 +221,7 @@ for the created threads:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ./a.out \-s 0x100000 hola salut servus
|
||||
.RB "$" " ./a.out \-s 0x100000 hola salut servus"
|
||||
Thread 1: top of stack near 0xb7d723b8; argv_string=hola
|
||||
Thread 2: top of stack near 0xb7c713b8; argv_string=salut
|
||||
Thread 3: top of stack near 0xb7b703b8; argv_string=servus
|
||||
|
|
|
@ -110,9 +110,9 @@ a thread is created using default attributes:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ulimit \-s # No stack imit ==> default stack size is 2MB
|
||||
.RB "$" " ulimit \-s" " # No stack imit ==> default stack size is 2MB"
|
||||
unlimited
|
||||
$ ./a.out
|
||||
.RB "$" " ./a.out"
|
||||
Attributes of created thread:
|
||||
Guard size = 4096 bytes
|
||||
Stack address = 0x40196000 (EOS = 0x40397000)
|
||||
|
@ -126,7 +126,7 @@ it is rounded up to the next multiple of the system page size
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ./a.out \-g 4097
|
||||
.RB "$" " ./a.out \-g 4097"
|
||||
Thread attributes object after initializations:
|
||||
Guard size = 4097 bytes
|
||||
Stack address = (nil)
|
||||
|
@ -158,7 +158,7 @@ In this case, the guard size attribute is ignored.
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ./a.out \-g 4096 \-s 0x8000 \-a
|
||||
.RB "$" " ./a.out \-g 4096 \-s 0x8000 \-a"
|
||||
Allocated thread stack at 0x804d000
|
||||
|
||||
Thread attributes object after initializations:
|
||||
|
|
|
@ -172,12 +172,12 @@ The following shows what happens on two different runs of the program:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ ./a.out 2 3
|
||||
.RB "$" " ./a.out 2 3"
|
||||
About to call sem_timedwait()
|
||||
sem_post() from handler
|
||||
sem_getvalue() from handler; value = 1
|
||||
sem_timedwait() succeeded
|
||||
$ ./a.out 2 1
|
||||
.RB "$" " ./a.out 2 1"
|
||||
About to call sem_timedwait()
|
||||
sem_timedwait() timed out
|
||||
.fi
|
||||
|
|
|
@ -460,11 +460,11 @@ are as follows:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out "%m"
|
||||
.RB "$" " ./a.out \(aq%m\(aq"
|
||||
Result string is "11"
|
||||
$ ./a.out "%5m"
|
||||
.RB "$" " ./a.out \(aq%5m\(aq"
|
||||
Result string is "00011"
|
||||
$ ./a.out "%_5m"
|
||||
.RB "$" " ./a.out \(aq%_5m\(aq"
|
||||
Result string is " 11"
|
||||
.fi
|
||||
.in
|
||||
|
|
|
@ -183,7 +183,7 @@ An example of the output produced by this program is the following:
|
|||
.PP
|
||||
.in +4n
|
||||
.nf
|
||||
$ ./a.out \(aqa/bbb///cc;xxx:yyy:\(aq \(aq:;\(aq \(aq/\(aq
|
||||
.RB "$" " ./a.out \(aqa/bbb///cc;xxx:yyy:\(aq \(aq:;\(aq \(aq/\(aq"
|
||||
1: a/bbb///cc
|
||||
\-\-> a
|
||||
\-\-> bbb
|
||||
|
|
|
@ -188,18 +188,18 @@ Some examples of the results produced by this program are the following:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ./a.out 123
|
||||
.RB "$" " ./a.out 123"
|
||||
strtol() returned 123
|
||||
$ ./a.out \(aq 123\(aq
|
||||
.RB "$" " ./a.out \(aq 123\(aq"
|
||||
strtol() returned 123
|
||||
$ ./a.out 123abc
|
||||
.RB "$" " ./a.out 123abc"
|
||||
strtol() returned 123
|
||||
Further characters after number: abc
|
||||
$ ./a.out 123abc 55
|
||||
.RB "$" " ./a.out 123abc 55"
|
||||
strtol: Invalid argument
|
||||
$ ./a.out \(aq\(aq
|
||||
.RB "$" " ./a.out \(aq\(aq"
|
||||
No digits were found
|
||||
$ ./a.out 4000000000
|
||||
.RB "$" " ./a.out 4000000000"
|
||||
strtol: Numerical result out of range
|
||||
|
||||
.fi
|
||||
|
|
21
man5/core.5
21
man5/core.5
|
@ -251,8 +251,8 @@ in the parent shell before running a program, for example:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
$ echo 0x7 > /proc/self/coredump_filter
|
||||
$ ./some_program
|
||||
.RB "$" " echo 0x7 > /proc/self/coredump_filter"
|
||||
.RB "$" " ./some_program"
|
||||
.fi
|
||||
.in
|
||||
.PP
|
||||
|
@ -295,16 +295,17 @@ The following shell session demonstrates the use of this program
|
|||
.PP
|
||||
.in +4n
|
||||
.nf
|
||||
$ cc \-o core_pattern_pipe_test core_pattern_pipe_test.c
|
||||
$ su
|
||||
.RB "$" " cc \-o core_pattern_pipe_test core_pattern_pipe_test.c"
|
||||
.RB "$" " su"
|
||||
Password:
|
||||
# echo "|$PWD/core_pattern_pipe_test %p UID=%u GID=%g sig=%s" > \\
|
||||
/proc/sys/kernel/core_pattern
|
||||
# exit
|
||||
$ sleep 100
|
||||
.I type control-backslash
|
||||
.RB "#" " echo \(aq|$PWD/core_pattern_pipe_test %p \
|
||||
UID=%u GID=%g sig=%s\(aq > \e"
|
||||
.B " /proc/sys/kernel/core_pattern"
|
||||
.RB "#" " exit"
|
||||
.RB "$" " sleep 100"
|
||||
.BR "^\e" " # type control-backslash"
|
||||
Quit (core dumped)
|
||||
$ cat core.info
|
||||
.RB "$" " cat core.info"
|
||||
argc=5
|
||||
argc[0]=</home/mtk/core_pattern_pipe_test>
|
||||
argc[1]=<20575>
|
||||
|
|
20
man5/proc.5
20
man5/proc.5
|
@ -132,7 +132,7 @@ for instance, you can do this:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
cd /proc/20/cwd; /bin/pwd
|
||||
.RB "$" " cd /proc/20/cwd; /bin/pwd"
|
||||
.fi
|
||||
.in
|
||||
|
||||
|
@ -160,7 +160,7 @@ Thus, to print out the environment of process 1, you would do:
|
|||
.nf
|
||||
|
||||
.ft CW
|
||||
(cat /proc/1/environ; echo) | tr "\\000" "\\n"
|
||||
.RB "$" " (cat /proc/1/environ; echo) | tr \(aq\e000\(aq \(aq\en\(aq"
|
||||
.fi
|
||||
.ft P
|
||||
.in
|
||||
|
@ -225,7 +225,7 @@ is the flag designating an output file:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ...
|
||||
.RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..."
|
||||
.fi
|
||||
.in
|
||||
|
||||
|
@ -261,7 +261,7 @@ Thus the example command above could be written as:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
foobar \-i /dev/stdin \-o /dev/stdout ...
|
||||
.RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..."
|
||||
.fi
|
||||
.in
|
||||
.\" FIXME Describe /proc/[pid]/loginuid
|
||||
|
@ -276,7 +276,7 @@ about the corresponding file descriptor, for example:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ cat /proc/12015/fdinfo/4
|
||||
.RB "$" " cat /proc/12015/fdinfo/4"
|
||||
pos: 1000
|
||||
flags: 01002002
|
||||
.fi
|
||||
|
@ -884,7 +884,7 @@ Here's an example:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ cat /proc/$$/status
|
||||
.RB "$" " cat /proc/$$/status"
|
||||
Name: bash
|
||||
State: S (sleeping)
|
||||
Tgid: 3515
|
||||
|
@ -2042,8 +2042,8 @@ that is:
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
# echo "darkstar" > /proc/sys/kernel/hostname
|
||||
# echo "mydomain" > /proc/sys/kernel/domainname
|
||||
.RB "#" " echo \(aqdarkstar\(aq > /proc/sys/kernel/hostname"
|
||||
.RB "#" " echo \(aqmydomain\(aq > /proc/sys/kernel/domainname"
|
||||
.fi
|
||||
.in
|
||||
|
||||
|
@ -2051,8 +2051,8 @@ has the same effect as
|
|||
|
||||
.in +4n
|
||||
.nf
|
||||
# hostname "darkstar"
|
||||
# domainname "mydomain"
|
||||
.RB "#" " hostname \(aqdarkstar\(aq"
|
||||
.RB "#" " domainname \(aqmydomain\(aq"
|
||||
.fi
|
||||
.in
|
||||
|
||||
|
|
|
@ -1388,17 +1388,17 @@ and then attach the current shell to that cpuset.
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
mkdir /dev/cpuset
|
||||
mount \-t cpuset cpuset /dev/cpuset
|
||||
cd /dev/cpuset
|
||||
mkdir Charlie
|
||||
cd Charlie
|
||||
/bin/echo 2-3 > cpus
|
||||
/bin/echo 1 > mems
|
||||
/bin/echo $$ > tasks
|
||||
.RB "$" " mkdir /dev/cpuset"
|
||||
.RB "$" " mount \-t cpuset cpuset /dev/cpuset"
|
||||
.RB "$" " cd /dev/cpuset"
|
||||
.RB "$" " mkdir Charlie"
|
||||
.RB "$" " cd Charlie"
|
||||
.RB "$" " /bin/echo 2-3 > cpus"
|
||||
.RB "$" " /bin/echo 1 > mems"
|
||||
.RB "$" " /bin/echo $$ > tasks"
|
||||
# The current shell is now running in cpuset Charlie
|
||||
# The next line should display '/Charlie'
|
||||
cat /proc/self/cpuset
|
||||
.RB "$" " cat /proc/self/cpuset"
|
||||
.fi
|
||||
.in
|
||||
.SS Migrating a job to different memory nodes.
|
||||
|
@ -1436,13 +1436,13 @@ The following sequence of commands accomplishes this.
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
cd /dev/cpuset
|
||||
mkdir beta
|
||||
cd beta
|
||||
/bin/echo 16-19 > cpus
|
||||
/bin/echo 8-9 > mems
|
||||
/bin/echo 1 > memory_migrate
|
||||
while read i; do /bin/echo $i; done < ../alpha/tasks > tasks
|
||||
.RB "$" " cd /dev/cpuset"
|
||||
.RB "$" " mkdir beta"
|
||||
.RB "$" " cd beta"
|
||||
.RB "$" " /bin/echo 16-19 > cpus"
|
||||
.RB "$" " /bin/echo 8-9 > mems"
|
||||
.RB "$" " /bin/echo 1 > memory_migrate"
|
||||
.RB "$" " while read i; do /bin/echo $i; done < ../alpha/tasks > tasks"
|
||||
.fi
|
||||
.in
|
||||
.PP
|
||||
|
@ -1457,7 +1457,7 @@ Notice that the last step of the above sequence did not do:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
cp ../alpha/tasks tasks
|
||||
.RB "$" " cp ../alpha/tasks tasks"
|
||||
.fi
|
||||
.in
|
||||
.PP
|
||||
|
@ -1480,7 +1480,7 @@ syntax that works on any shell, but alas more obscurely, by using the
|
|||
.in +4n
|
||||
|
||||
.nf
|
||||
sed \-un p < ../alpha/tasks > tasks
|
||||
.RB "$" " sed \-un p < ../alpha/tasks > tasks"
|
||||
.fi
|
||||
.in
|
||||
.\" ================== SEE ALSO ==================
|
||||
|
|
|
@ -193,8 +193,8 @@ This file system can be mounted using the following commands:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ mkdir /dev/mqueue
|
||||
$ mount \-t mqueue none /dev/mqueue
|
||||
.RB "$" " mkdir /dev/mqueue"
|
||||
.RB "$" " mount \-t mqueue none /dev/mqueue"
|
||||
|
||||
.fi
|
||||
.in
|
||||
|
@ -212,9 +212,9 @@ containing information about the queue:
|
|||
.in +4n
|
||||
.nf
|
||||
|
||||
$ ls /dev/mqueue/mymq
|
||||
.RB "$" " ls /dev/mqueue/mymq"
|
||||
QSIZE:129 NOTIFY:2 SIGNO:0 NOTIFY_PID:8260
|
||||
$ mount \-t mqueue none /dev/mqueue
|
||||
.RB "$" " mount \-t mqueue none /dev/mqueue"
|
||||
|
||||
.fi
|
||||
.in
|
||||
|
|
Loading…
Reference in New Issue