mirror of https://github.com/mkerrisk/man-pages
chown.2, clone.2, mmap.2, pipe.2, ftw.3, mq_notify.3: Add "Program source" subheading under EXAMPLE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
22617a74a7
commit
f30b741526
|
@ -35,7 +35,7 @@
|
|||
.\" (bsdgroups versus sysvgroups, and the effect of the parent
|
||||
.\" directory's set-group-ID permission bit).
|
||||
.\"
|
||||
.TH CHOWN 2 2010-11-22 "Linux" "Linux Programmer's Manual"
|
||||
.TH CHOWN 2 2014-01-05 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
chown, fchown, lchown \- change ownership of a file
|
||||
.SH SYNOPSIS
|
||||
|
@ -294,8 +294,8 @@ The new owner can be specified either as a numeric user ID,
|
|||
or as a username (which is converted to a user ID by using
|
||||
.BR getpwnam (3)
|
||||
to perform a lookup in the system password file).
|
||||
.SS Program source
|
||||
.nf
|
||||
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
.\" FIXME Document CLONE_NEWUSER, which is new in 2.6.23
|
||||
.\" (also supported for unshare()?)
|
||||
.\"
|
||||
.TH CLONE 2 2013-04-16 "Linux" "Linux Programmer's Manual"
|
||||
.TH CLONE 2 2014-01-05 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
clone, __clone2 \- create a child process
|
||||
.SH SYNOPSIS
|
||||
|
@ -1067,7 +1067,6 @@ To get the truth, it may be necessary to use code such as the following:
|
|||
.\" https://bugzilla.redhat.com/show_bug.cgi?id=417521
|
||||
.\" http://sourceware.org/bugzilla/show_bug.cgi?id=6910
|
||||
.SH EXAMPLE
|
||||
.SS Create a child that executes in a separate UTS namespace
|
||||
The following program demonstrates the use of
|
||||
.BR clone ()
|
||||
to create a child process that executes in a separate UTS namespace.
|
||||
|
@ -1077,7 +1076,7 @@ making it possible to see that the hostname
|
|||
differs in the UTS namespaces of the parent and child.
|
||||
For an example of the use of this program, see
|
||||
.BR setns (2).
|
||||
|
||||
.SS Program source
|
||||
.nf
|
||||
#define _GNU_SOURCE
|
||||
#include <sys/wait.h>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
.\" 2007-07-10, mtk, Added an example program.
|
||||
.\" 2008-11-18, mtk, document MAP_STACK
|
||||
.\"
|
||||
.TH MMAP 2 2013-04-17 "Linux" "Linux Programmer's Manual"
|
||||
.TH MMAP 2 2014-01-05 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
mmap, munmap \- map or unmap files or devices into memory
|
||||
.SH SYNOPSIS
|
||||
|
@ -639,8 +639,8 @@ The program creates a memory mapping of the required
|
|||
pages of the file and then uses
|
||||
.BR write (2)
|
||||
to output the desired bytes.
|
||||
.SS Program source
|
||||
.nf
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
.\" to EXAMPLE text.
|
||||
.\" 2008-10-10, mtk: add description of pipe2()
|
||||
.\"
|
||||
.TH PIPE 2 2013-12-08 "Linux" "Linux Programmer's Manual"
|
||||
.TH PIPE 2 2014-01-05 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
pipe, pipe2 \- create pipe
|
||||
.SH SYNOPSIS
|
||||
|
@ -137,8 +137,8 @@ The parent then writes the string contained in the program's
|
|||
command-line argument to the pipe,
|
||||
and the child reads this string a byte at a time from the pipe
|
||||
and echoes it on standard output.
|
||||
.SS Program source
|
||||
.nf
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -376,8 +376,8 @@ The second command-line argument can be used to specify characters that
|
|||
control the value assigned to the \fIflags\fP
|
||||
argument when calling
|
||||
.BR nftw ().
|
||||
.SS Program source
|
||||
.nf
|
||||
|
||||
#define _XOPEN_SOURCE 500
|
||||
#include <ftw.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
.\" the source, must acknowledge the copyright and authors of this work.
|
||||
.\" %%%LICENSE_END
|
||||
.\"
|
||||
.TH MQ_NOTIFY 3 2010-10-04 "Linux" "Linux Programmer's Manual"
|
||||
.TH MQ_NOTIFY 3 2014-01-05 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
mq_notify \- register for notification when a message is available
|
||||
.SH SYNOPSIS
|
||||
|
@ -179,8 +179,8 @@ message queue named in its command-line argument.
|
|||
Notification is performed by creating a thread.
|
||||
The thread executes a function which reads one message from the
|
||||
queue and then terminates the process.
|
||||
.SS Program source
|
||||
.nf
|
||||
|
||||
#include <pthread.h>
|
||||
#include <mqueue.h>
|
||||
#include <stdio.h>
|
||||
|
|
Loading…
Reference in New Issue