aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2017-08-18 13:01:10 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2017-08-19 13:47:26 +0200
commitb76974c1ec51463d46033bd653a806ddca8c6eb1 (patch)
tree22f747b0a40f67413769821889799d8ec73caa7f
parentc4b7e5ac346d2bf512834ccc7be8fa11d69592a6 (diff)
downloadman-pages-b76974c1ec51463d46033bd653a806ddca8c6eb1.tar.gz
locale.1, pldd.1, bpf.2, clone.2, copy_file_range.2, dup.2, execve.2, futex.2, get_kernel_syms.2, getdents.2, getrlimit.2, getunwind.2, init_module.2, ioctl_console.2, ioctl_ficlonerange.2, ioctl_fideduperange.2, ioctl_ns.2, ioctl_tty.2, ioctl_userfaultfd.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man1/locale.14
-rw-r--r--man1/pldd.14
-rw-r--r--man2/bpf.24
-rw-r--r--man2/clone.216
-rw-r--r--man2/copy_file_range.24
-rw-r--r--man2/dup.24
-rw-r--r--man2/execve.28
-rw-r--r--man2/futex.232
-rw-r--r--man2/get_kernel_syms.24
-rw-r--r--man2/getdents.212
-rw-r--r--man2/getrlimit.28
-rw-r--r--man2/getunwind.212
-rw-r--r--man2/init_module.24
-rw-r--r--man2/ioctl_console.2110
-rw-r--r--man2/ioctl_ficlonerange.28
-rw-r--r--man2/ioctl_fideduperange.221
-rw-r--r--man2/ioctl_ns.256
-rw-r--r--man2/ioctl_tty.28
-rw-r--r--man2/ioctl_userfaultfd.219
19 files changed, 175 insertions, 163 deletions
diff --git a/man1/locale.1 b/man1/locale.1
index 9cc6350df4..99b94928e7 100644
--- a/man1/locale.1
+++ b/man1/locale.1
@@ -137,7 +137,7 @@ Usual default path for locale definition files.
.SH CONFORMING TO
POSIX.1-2001, POSIX.1-2008.
.SH EXAMPLE
-.nf
+.EX
$ \fBlocale\fP
LANG=en_US.UTF\-8
LC_CTYPE="en_US.UTF\-8"
@@ -177,7 +177,7 @@ tel_dom_fmt="(%a) %l"
int_select="11"
int_prefix="1"
telephone\-codeset="UTF\-8"
-.fi
+.EE
.PP
The following example compiles a custom locale from the
.I ./wrk
diff --git a/man1/pldd.1 b/man1/pldd.1
index 7f683d3895..79b7000703 100644
--- a/man1/pldd.1
+++ b/man1/pldd.1
@@ -103,7 +103,7 @@ is broken: it just hangs when executed.
.\" FIXME . https://sourceware.org/bugzilla/show_bug.cgi?id=18035
It is unclear if it will ever be fixed.
.SH EXAMPLE
-.nf
+.EX
$ \fBecho $$\fP # Display PID of shell
1143
$ \fBpldd $$\fP # Display DSOs linked into the shell
@@ -114,7 +114,7 @@ linux\-vdso.so.1
/lib64/libc.so.6
/lib64/ld\-linux\-x86\-64.so.2
/lib64/libnss_files.so.2
-.fi
+.EE
.SH SEE ALSO
.BR ldd (1),
.BR lsof (1),
diff --git a/man2/bpf.2 b/man2/bpf.2
index afc16650d8..dc6a0a8c04 100644
--- a/man2/bpf.2
+++ b/man2/bpf.2
@@ -921,9 +921,9 @@ that was created by a previous call to
.BR perf_event_open (2):
.PP
.in +4n
-.nf
+.EX
ioctl(event_fd, PERF_EVENT_IOC_SET_BPF, prog_fd);
-.fi
+.EE
.in
.\"
.\"
diff --git a/man2/clone.2 b/man2/clone.2
index c80b37ed6b..b4e5485c25 100644
--- a/man2/clone.2
+++ b/man2/clone.2
@@ -829,11 +829,11 @@ The raw system call interface on x86-64 and some other architectures
(including sh, tile, and alpha) is roughly:
.PP
.in +4
-.nf
+.EX
.BI "long clone(unsigned long " flags ", void *" child_stack ,
.BI " int *" ptid ", int *" ctid ,
.BI " unsigned long " newtls );
-.fi
+.EE
.in
.PP
On x86-32, and several other common architectures
@@ -843,11 +843,11 @@ and MIPS),
the order of the last two arguments is reversed:
.PP
.in +4
-.nf
+.EX
.BI "long clone(unsigned long " flags ", void *" child_stack ,
.BI " int *" ptid ", unsigned long " newtls ,
.BI " int *" ctid );
-.fi
+.EE
.in
.PP
On the cris and s390 architectures,
@@ -855,11 +855,11 @@ On the cris and s390 architectures,
the order of the first two arguments is reversed:
.PP
.in +4
-.nf
+.EX
.BI "long clone(void *" child_stack ", unsigned long " flags ,
.BI " int *" ptid ", int *" ctid ,
.BI " unsigned long " newtls );
-.fi
+.EE
.in
.PP
On the microblaze architecture,
@@ -867,12 +867,12 @@ On the microblaze architecture,
an additional argument is supplied:
.PP
.in +4
-.nf
+.EX
.BI "long clone(unsigned long " flags ", void *" child_stack ,
.BI " int " stack_size , "\fR /* Size of stack */"
.BI " int *" ptid ", int *" ctid ,
.BI " unsigned long " newtls );
-.fi
+.EE
.in
.PP
Another difference for the raw system call is that the
diff --git a/man2/copy_file_range.2 b/man2/copy_file_range.2
index ff41cfc1d5..d3e1116d6e 100644
--- a/man2/copy_file_range.2
+++ b/man2/copy_file_range.2
@@ -150,7 +150,7 @@ such as the use of reflinks (i.e., two or more i-nodes that share
pointers to the same copy-on-write disk blocks)
or server-side-copy (in the case of NFS).
.SH EXAMPLE
-.nf
+.EX
#define _GNU_SOURCE
#include <fcntl.h>
#include <stdio.h>
@@ -212,7 +212,7 @@ main(int argc, char **argv)
close(fd_out);
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.SH SEE ALSO
.BR lseek (2),
.BR sendfile (2),
diff --git a/man2/dup.2 b/man2/dup.2
index 3d2ad394b4..d3d88e6288 100644
--- a/man2/dup.2
+++ b/man2/dup.2
@@ -247,7 +247,7 @@ before calling
because of the race condition described above.
Instead, code something like the following could be used:
.PP
-.nf
+.EX
/* Obtain a duplicate of 'newfd' that can subsequently
be used to check for close() errors; an EBADF error
means that 'newfd' was not open. */
@@ -271,7 +271,7 @@ Instead, code something like the following could be used:
/* Handle errors from close */
}
}
-.fi
+.EE
.SH SEE ALSO
.BR close (2),
.BR fcntl (2),
diff --git a/man2/execve.2 b/man2/execve.2
index d1686d1f5f..c9ddced038 100644
--- a/man2/execve.2
+++ b/man2/execve.2
@@ -50,9 +50,9 @@ executes the program pointed to by \fIfilename\fP.
starting with a line of the form:
.PP
.in +4n
-.nf
+.EX
\fB#!\fP \fIinterpreter \fP[optional-arg]
-.fi
+.EE
.in
.PP
For details of the latter case, see "Interpreter scripts" below.
@@ -70,9 +70,9 @@ The argument vector and environment can be accessed by the
called program's main function, when it is defined as:
.PP
.in +4n
-.nf
+.EX
int main(int argc, char *argv[], char *envp[])
-.fi
+.EE
.in
.PP
Note, however, that the use of a third argument to the main function
diff --git a/man2/futex.2 b/man2/futex.2
index b0b60f8248..b07c7eb002 100644
--- a/man2/futex.2
+++ b/man2/futex.2
@@ -531,7 +531,7 @@ where multiple waiter threads are waiting on B,
a wait queue implemented using a futex:
.IP
.in +4n
-.nf
+.EX
lock(A)
while (!check_value(V)) {
unlock(A);
@@ -539,7 +539,7 @@ while (!check_value(V)) {
lock(A);
};
unlock(A);
-.fi
+.EE
.in
.IP
If a waker thread used
@@ -581,13 +581,13 @@ and totally ordered with respect to other futex operations on
any of the two supplied futex words:
.IP
.in +4n
-.nf
+.EX
int oldval = *(int *) uaddr2;
*(int *) uaddr2 = oldval \fIop\fP \fIoparg\fP;
futex(uaddr, FUTEX_WAKE, val, 0, 0, 0);
if (oldval \fIcmp\fP \fIcmparg\fP)
futex(uaddr2, FUTEX_WAKE, val2, 0, 0, 0);
-.fi
+.EE
.in
.IP
In other words,
@@ -623,24 +623,24 @@ in the bits of the argument
Pictorially, the encoding is:
.IP
.in +8n
-.nf
+.EX
+---+---+-----------+-----------+
|op |cmp| oparg | cmparg |
+---+---+-----------+-----------+
4 4 12 12 <== # of bits
-.fi
+.EE
.in
.IP
Expressed in code, the encoding is:
.IP
.in +4n
-.nf
+.EX
#define FUTEX_OP(op, oparg, cmp, cmparg) \\
(((op & 0xf) << 28) | \\
((cmp & 0xf) << 24) | \\
((oparg & 0xfff) << 12) | \\
(cmparg & 0xfff))
-.fi
+.EE
.in
.IP
In the above,
@@ -659,13 +659,13 @@ The
component has one of the following values:
.IP
.in +4n
-.nf
+.EX
FUTEX_OP_SET 0 /* uaddr2 = oparg; */
FUTEX_OP_ADD 1 /* uaddr2 += oparg; */
FUTEX_OP_OR 2 /* uaddr2 |= oparg; */
FUTEX_OP_ANDN 3 /* uaddr2 &= ~oparg; */
FUTEX_OP_XOR 4 /* uaddr2 ^= oparg; */
-.fi
+.EE
.in
.IP
In addition, bit-wise ORing the following value into
@@ -675,9 +675,9 @@ causes
to be used as the operand:
.IP
.in +4n
-.nf
+.EX
FUTEX_OP_ARG_SHIFT 8 /* Use (1 << oparg) as operand */
-.fi
+.EE
.in
.IP
The
@@ -685,14 +685,14 @@ The
field is one of the following:
.IP
.in +4n
-.nf
+.EX
FUTEX_OP_CMP_EQ 0 /* if (oldval == cmparg) wake */
FUTEX_OP_CMP_NE 1 /* if (oldval != cmparg) wake */
FUTEX_OP_CMP_LT 2 /* if (oldval < cmparg) wake */
FUTEX_OP_CMP_LE 3 /* if (oldval <= cmparg) wake */
FUTEX_OP_CMP_GT 4 /* if (oldval > cmparg) wake */
FUTEX_OP_CMP_GE 5 /* if (oldval >= cmparg) wake */
-.fi
+.EE
.in
.IP
The return value of
@@ -1724,7 +1724,7 @@ that ensures that they alternate in writing messages.
Upon running this program we see output such as the following:
.PP
.in +4n
-.nf
+.EX
$ \fB./futex_demo\fP
Parent (18534) 0
Child (18535) 0
@@ -1736,7 +1736,7 @@ Parent (18534) 3
Child (18535) 3
Parent (18534) 4
Child (18535) 4
-.fi
+.EE
.in
.SS Program source
\&
diff --git a/man2/get_kernel_syms.2 b/man2/get_kernel_syms.2
index fdfbf46e6e..1489e0dd1a 100644
--- a/man2/get_kernel_syms.2
+++ b/man2/get_kernel_syms.2
@@ -31,12 +31,12 @@ returns the number of symbols available for query.
Otherwise, it fills in a table of structures:
.PP
.in +4n
-.nf
+.EX
struct kernel_sym {
unsigned long value;
char name[60];
};
-.fi
+.EE
.in
.PP
The symbols are interspersed with magic symbols of the form
diff --git a/man2/getdents.2 b/man2/getdents.2
index 75ff7c6302..573b9b3dc0 100644
--- a/man2/getdents.2
+++ b/man2/getdents.2
@@ -66,7 +66,7 @@ The
structure is declared as follows:
.PP
.in +4n
-.nf
+.EX
struct linux_dirent {
unsigned long d_ino; /* Inode number */
unsigned long d_off; /* Offset to next \fIlinux_dirent\fP */
@@ -80,7 +80,7 @@ struct linux_dirent {
// 2.6.4); offset is (d_reclen \- 1)
*/
}
-.fi
+.EE
.in
.PP
.I d_ino
@@ -165,7 +165,7 @@ system call is like
except that its second argument is a pointer to a buffer containing
structures of the following type:
.PP
-.nf
+.EX
.in +4n
struct linux_dirent64 {
ino64_t d_ino; /* 64-bit inode number */
@@ -174,7 +174,7 @@ struct linux_dirent64 {
unsigned char d_type; /* File type */
char d_name[]; /* Filename (null-terminated) */
};
-.in
+.EE
.fi
.SH RETURN VALUE
On success, the number of bytes read is returned.
@@ -225,7 +225,7 @@ The following output shows an example of what we see when running this
program on an ext2 directory:
.PP
.in +4n
-.nf
+.EX
.RB "$" " ./a.out /testfs/"
--------------- nread=120 ---------------
inode# file type d_reclen d_off d_name
@@ -236,7 +236,7 @@ inode# file type d_reclen d_off d_name
228929 directory 16 68 sub
16353 directory 16 80 sub2
130817 directory 16 4096 sub3
-.fi
+.EE
.in
.SS Program source
\&
diff --git a/man2/getrlimit.2 b/man2/getrlimit.2
index a4353667bd..01948c8276 100644
--- a/man2/getrlimit.2
+++ b/man2/getrlimit.2
@@ -251,7 +251,7 @@ This limit is enforced for
.BR mq_open (3).
Each message queue that the user creates counts (until it is removed)
against this limit according to the formula:
-.nf
+.EX
Since Linux 3.5:
@@ -269,7 +269,7 @@ against this limit according to the formula:
attr.mq_maxmsg * attr.mq_msgsize;
/* For message data */
-.fi
+.EE
where
.I attr
is the
@@ -762,7 +762,7 @@ as wrapper functions that call
The program below demonstrates the use of
.BR prlimit ().
.PP
-.nf
+.EX
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <stdio.h>
@@ -813,7 +813,7 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
-.fi
+.EX
.SH SEE ALSO
.BR prlimit (1),
.BR dup (2),
diff --git a/man2/getunwind.2 b/man2/getunwind.2
index 5d8d58a512..5ea17b4750 100644
--- a/man2/getunwind.2
+++ b/man2/getunwind.2
@@ -66,11 +66,13 @@ The first part of the unwind data contains an unwind table.
The rest contains the associated unwind information, in no particular order.
The unwind table contains entries of the following form:
.PP
-.nf
- u64 start; (64-bit address of start of function)
- u64 end; (64-bit address of end of function)
- u64 info; (BUF-relative offset to unwind info)
-.fi
+.in +4n
+.EX
+u64 start; (64-bit address of start of function)
+u64 end; (64-bit address of end of function)
+u64 info; (BUF-relative offset to unwind info)
+.EE
+.in
.PP
An entry whose
.I start
diff --git a/man2/init_module.2 b/man2/init_module.2
index 15ede83bd3..87f9d942cd 100644
--- a/man2/init_module.2
+++ b/man2/init_module.2
@@ -320,7 +320,7 @@ code and data as appropriate.
Since Linux 2.2, the module structure is defined as follows:
.PP
.in +4n
-.nf
+.EX
struct module {
unsigned long size_of_struct;
struct module *next;
@@ -341,7 +341,7 @@ struct module {
unsigned long gp;
#endif
};
-.fi
+.EE
.in
.PP
All of the pointer fields, with the exception of
diff --git a/man2/ioctl_console.2 b/man2/ioctl_console.2
index 231cde8b67..d6f3ec1bc5 100644
--- a/man2/ioctl_console.2
+++ b/man2/ioctl_console.2
@@ -245,7 +245,7 @@ Sets screen font and associated rendering information.
points to a
.in +4n
-.nf
+.EX
struct consolefontdesc {
unsigned short charcount; /* characters in font
(256 or 512) */
@@ -254,7 +254,7 @@ struct consolefontdesc {
char *chardata; /* font data in
expanded form */
};
-.fi
+.EE
.in
If necessary, the screen will be appropriately resized, and
@@ -311,29 +311,29 @@ symbols.
Get Unicode-to-font mapping from kernel.
.I argp
points to a
-
+.IP
.in +4n
-.nf
+.EX
struct unimapdesc {
unsigned short entry_ct;
struct unipair *entries;
};
-.fi
+.EE
.in
-
+.IP
where
.I entries
points to an array of
-
+,IP
.in +4n
-.nf
+.EX
struct unipair {
unsigned short unicode;
unsigned short fontpos;
};
-.fi
+.EE
.in
-
+.IP
(Since Linux 1.1.92.)
.TP
.B PIO_UNIMAP
@@ -347,17 +347,17 @@ points to a
Clear table, possibly advise hash algorithm.
.I argp
points to a
-
+.IP
.in +4n
-.nf
+.EX
struct unimapinit {
unsigned short advised_hashsize; /* 0 if no opinion */
unsigned short advised_hashstep; /* 0 if no opinion */
unsigned short advised_hashlevel; /* 0 if no opinion */
};
-.fi
+.EE
.in
-
+.IP
(Since Linux 1.1.92.)
.TP
.B KDGKBMODE
@@ -410,17 +410,17 @@ equal to one of the values shown above for
Gets one entry in key translation table (keycode to action code).
.I argp
points to a
-
+.IP
.in +4n
-.nf
+.EX
struct kbentry {
unsigned char kb_table;
unsigned char kb_index;
unsigned short kb_value;
};
-.fi
+.EE
.in
-
+.IP
with the first two members filled in:
.I kb_table
selects the key table (0 <=
@@ -448,16 +448,16 @@ points to a
Gets one function key string.
.I argp
points to a
-
+.IP
.in +4n
-.nf
+.EX
struct kbsentry {
unsigned char kb_func;
unsigned char kb_string[512];
};
.fi
.in
-
+.IP
.I kb_string
is set to the (null-terminated) string corresponding to
the
@@ -474,45 +474,45 @@ points to a
Read kernel accent table.
.I argp
points to a
-
+.IP
.in +4n
-.nf
+.EX
struct kbdiacrs {
unsigned int kb_cnt;
struct kbdiacr kbdiacr[256];
};
-.fi
+.EE
.in
-
+.IP
where
.I kb_cnt
is the number of entries in the array, each of which
is a
-
+.IP
.in +4n
-.nf
+.EX
struct kbdiacr {
unsigned char diacr;
unsigned char base;
unsigned char result;
};
-.fi
+.EE
.in
.TP
.B KDGETKEYCODE
Read kernel keycode table entry (scan code to keycode).
.I argp
points to a
-
+.IP
.in +4n
-.nf
+.EX
struct kbkeycode {
unsigned int scancode;
unsigned int keycode;
};
-.fi
+.EE
.in
-
+.IP
.I keycode
is set to correspond to the given
.IR scancode .
@@ -558,9 +558,9 @@ number of the vt (1 <=
Get mode of active vt.
.I argp
points to a
-
+.IP
.in +4n
-.nf
+.EX
struct vt_mode {
char mode; /* vt mode */
char waitv; /* if set, hang on writes if not active */
@@ -568,9 +568,9 @@ struct vt_mode {
short acqsig; /* signal to raise on acquisition */
short frsig; /* unused (set to 0) */
};
-.fi
+.EE
.in
-
+.IP
which is set to the mode of the active vt.
.I mode
is set to one of these values:
@@ -591,17 +591,17 @@ points to a
Get global vt state info.
.I argp
points to a
-
+.IP
.in +4n
-.nf
+.EX
struct vt_stat {
unsigned short v_active; /* active vt */
unsigned short v_signal; /* signal to send */
unsigned short v_state; /* vt bit mask */
};
-.fi
+.EE
.in
-
+.IP
For each vt in use, the corresponding bit in the
.I v_state
member is set.
@@ -631,17 +631,17 @@ Deallocate the memory associated with vt
Set the kernel's idea of screensize.
.I argp
points to a
-
+.IP
.in +4n
-.nf
+.EX
struct vt_sizes {
unsigned short v_rows; /* # rows */
unsigned short v_cols; /* # columns */
unsigned short v_scrollsize; /* no longer used */
};
-.fi
+.EE
.in
-
+.IP
Note that this does not change the videomode.
See
.BR resizecons (8).
@@ -651,9 +651,9 @@ See
Set the kernel's idea of various screen parameters.
.I argp
points to a
-
+.IP
.in +4n
-.nf
+.EX
struct vt_consize {
unsigned short v_rows; /* number of rows */
unsigned short v_cols; /* number of columns */
@@ -666,9 +666,9 @@ struct vt_consize {
unsigned short v_ccol; /* number of pixel columns
per character */
};
-.fi
+.EE
.in
-
+.IP
Any parameter may be set to zero, indicating "no change", but if
multiple parameters are set, they must be self-consistent.
Note that this does not change the videomode.
@@ -699,17 +699,17 @@ Disappeared in Linux 1.1.92.
Set selection.
.I argp
points to a
+.IP
.in +4n
-.nf
-
+.EX
struct {
- char subcode;
- short xs, ys, xe, ye;
- short sel_mode;
+ char subcode;
+ short xs, ys, xe, ye;
+ short sel_mode;
};
-
-.fi
+.EE
.in
+.IP
.I xs
and
.I ys
diff --git a/man2/ioctl_ficlonerange.2 b/man2/ioctl_ficlonerange.2
index 1804ef9a28..64f6adcd57 100644
--- a/man2/ioctl_ficlonerange.2
+++ b/man2/ioctl_ficlonerange.2
@@ -64,18 +64,18 @@ If
is zero, the ioctl reflinks to the end of the source file.
This information is conveyed in a structure of
the following form:
+.PP
.in +4n
-.nf
-
+.EX
struct file_clone_range {
__s64 src_fd;
__u64 src_offset;
__u64 src_length;
__u64 dest_offset;
};
-
-.fi
+.EX
.in
+.PP
Clones are atomic with regards to concurrent writes, so no locks need to be
taken to obtain a consistent cloned copy.
.PP
diff --git a/man2/ioctl_fideduperange.2 b/man2/ioctl_fideduperange.2
index 0ccd60a2cc..6d69dffc0e 100644
--- a/man2/ioctl_fideduperange.2
+++ b/man2/ioctl_fideduperange.2
@@ -55,9 +55,9 @@ bytes from file descriptor
at offset
.IR src_offset ".
This information is conveyed in a structure of the following form:
+.PP
.in +4n
-.nf
-
+.EX
struct file_dedupe_range {
__u64 src_offset;
__u64 src_length;
@@ -66,7 +66,7 @@ struct file_dedupe_range {
__u32 reserved2;
struct file_dedupe_range_info info[0];
};
-.fi
+.EX
.in
.PP
Deduplication is atomic with regards to concurrent writes, so no locks need to
@@ -83,16 +83,15 @@ The number of destinations is given in
and the destination information is conveyed in the following form:
.PP
.in +4n
-.nf
+.EX
struct file_dedupe_range_info {
- __s64 dest_fd;
- __u64 dest_offset;
- __u64 bytes_deduped;
- __s32 status;
- __u32 reserved;
+ __s64 dest_fd;
+ __u64 dest_offset;
+ __u64 bytes_deduped;
+ __s32 status;
+ __u32 reserved;
};
-
-.fi
+.EE
.in
.PP
Each deduplication operation targets
diff --git a/man2/ioctl_ns.2 b/man2/ioctl_ns.2
index 63be7f1b39..99388d80d7 100644
--- a/man2/ioctl_ns.2
+++ b/man2/ioctl_ns.2
@@ -37,9 +37,13 @@ operations are provided to allow discovery of namespace relationships (see
and
.BR pid_namespaces (7)).
The form of the calls is:
-
- new_fd = ioctl(fd, request);
-
+.PP
+.nf
+.in +4n
+new_fd = ioctl(fd, request);
+.fi
+.in
+.PP
In each case,
.I fd
refers to a
@@ -86,7 +90,7 @@ structure whose
This inode number can be matched with the inode number of another
.IR /proc/[pid]/ns/{pid,user}
file to determine whether that is the owning/parent namespace.
-
+.PP
Either of these
.BR ioctl (2)
operations can fail with the following errors:
@@ -119,14 +123,18 @@ The
operation (available since Linux 4.11) can be used to discover
the type of namespace referred to by the file descriptor
.IR fd :
-
- nstype = ioctl(fd, NS_GET_NSTYPE);
-
+.PP
+.nf
+.in +4n
+nstype = ioctl(fd, NS_GET_NSTYPE);
+.fi
+.in
+.PP
.I fd
refers to a
.IR /proc/[pid]/ns/*
file.
-
+.PP
The return value is one of the
.BR CLONE_NEW*
values that can be specified to
@@ -144,19 +152,23 @@ operation (available since Linux 4.11) can be used to discover
the owner user ID of a user namespace (i.e., the effective user ID
of the process that created the user namespace).
The form of the call is:
-
- uid_t uid;
- ioctl(fd, NS_GET_OWNER_UID, &uid);
-
+.PP
+.nf
+.in +4n
+uid_t uid;
+ioctl(fd, NS_GET_OWNER_UID, &uid);
+.fi
+.in
+.PP
.I fd
refers to a
.IR /proc/[pid]/ns/user
file.
-
+.PP
The owner user ID is returned in the
.I uid_t
pointed to by the third argument.
-
+.PP
This operation can fail with the following error:
.TP
.B EINVAL
@@ -181,22 +193,22 @@ operations described above to perform simple
discovery of namespace relationships.
The following shell sessions show various examples of the use
of this program.
-
+.PP
Trying to get the parent of the initial user namespace fails,
since it has no parent:
-
+.PP
.nf
.in +4n
$ \fB./ns_show /proc/self/ns/user p\fP
The parent namespace is outside your namespace scope
.in
.fi
-
+.PP
Create a process running
.BR sleep (1)
that resides in new user and UTS namespaces,
and show that the new UTS namespace is associated with the new user namespace:
-
+.PP
.nf
.in +4n
$ \fBunshare \-Uu sleep 1000 &\fP
@@ -207,10 +219,10 @@ $ \fBreadlink /proc/23235/ns/user \fP
user:[4026532448]
.in
.fi
-
+.PP
Then show that the parent of the new user namespace in the preceding
example is the initial user namespace:
-
+.PP
.nf
.in +4n
$ \fBreadlink /proc/self/ns/user\fP
@@ -219,13 +231,13 @@ $ \fB./ns_show /proc/23235/ns/user p\fP
Device/Inode of parent namespace is: [0,3] / 4026531837
.in
.fi
-
+.PP
Start a shell in a new user namespace, and show that from within
this shell, the parent user namespace can't be discovered.
Similarly, the UTS namespace
(which is associated with the initial user namespace)
can't be discovered.
-
+.PP
.nf
.in +4n
$ \fBPS1="sh2$ " unshare \-U bash\fP
diff --git a/man2/ioctl_tty.2 b/man2/ioctl_tty.2
index b06b939f23..465d84be30 100644
--- a/man2/ioctl_tty.2
+++ b/man2/ioctl_tty.2
@@ -111,14 +111,14 @@ Set window size.
The struct used by these ioctls is defined as
.PP
.in +4n
-.nf
+.EX
struct winsize {
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel; /* unused */
unsigned short ws_ypixel; /* unused */
};
-.fi
+.EE
.in
.PP
When the window size changes, a
@@ -548,7 +548,7 @@ Insufficient permission.
.SH EXAMPLE
Check the condition of DTR on the serial port.
.PP
-.nf
+.EX
#include <termios.h>
#include <fcntl.h>
#include <sys/ioctl.h>
@@ -566,7 +566,7 @@ main(void)
puts("TIOCM_DTR is not set");
close(fd);
}
-.fi
+.EE
.SH SEE ALSO
.BR ldattach (1),
.BR ioctl (2),
diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
index f742dda4b0..7c51202eda 100644
--- a/man2/ioctl_userfaultfd.2
+++ b/man2/ioctl_userfaultfd.2
@@ -84,17 +84,17 @@ The
argument is a pointer to a
.IR uffdio_api
structure, defined as:
+.PP
.in +4n
-.nf
-
+.EX
struct uffdio_api {
__u64 api; /* Requested API version (input) */
__u64 features; /* Requested features (input/output) */
__u64 ioctls; /* Available ioctl() operations (output) */
};
-
-.fi
+.EE
.in
+.PP
The
.I api
field denotes the API version requested by the application.
@@ -269,9 +269,9 @@ The
argument is a pointer to a
.I uffdio_register
structure, defined as:
+.PP
.in +4n
-.nf
-
+.EX
struct uffdio_range {
__u64 start; /* Start of range */
__u64 len; /* Length of range (bytes) */
@@ -282,8 +282,7 @@ struct uffdio_register {
__u64 mode; /* Desired mode of operation (input) */
__u64 ioctls; /* Available ioctl() operations (output) */
};
-
-.fi
+.EE
.in
.PP
The
@@ -408,7 +407,7 @@ structure pointed to by
.IR argp :
.PP
.in +4n
-.nf
+.EX
struct uffdio_copy {
__u64 dst; /* Source of copy */
__u64 src; /* Destination of copy */
@@ -416,7 +415,7 @@ struct uffdio_copy {
__u64 mode; /* Flags controlling behavior of copy */
__s64 copy; /* Number of bytes copied, or negated error */
};
-.fi
+.EE
.in
.PP
The following value may be bitwise ORed in