From b8302363edee357a81465430514f2d9cf8a61509 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Fri, 18 Aug 2017 21:52:46 +0200 Subject: [PATCH] execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets Change .nf/.fi to .EX/.EE Signed-off-by: Michael Kerrisk --- man2/execve.2 | 8 +- man2/ioctl_console.2 | 2 +- man2/ioctl_iflags.2 | 4 +- man2/ioctl_ns.2 | 28 +++---- man2/ioctl_userfaultfd.2 | 4 +- man2/kcmp.2 | 8 +- man2/kexec_load.2 | 2 +- man2/keyctl.2 | 20 ++--- man2/link.2 | 4 +- man2/listxattr.2 | 4 +- man2/membarrier.2 | 8 +- man2/memfd_create.2 | 8 +- man2/mmap.2 | 4 +- man2/modify_ldt.2 | 2 +- man2/mprotect.2 | 4 +- man2/msgctl.2 | 6 +- man2/nanosleep.2 | 4 +- man2/open_by_handle_at.2 | 12 +-- man2/perf_event_open.2 | 72 +++++++++--------- man2/poll.2 | 4 +- man2/posix_fadvise.2 | 4 +- man2/process_vm_readv.2 | 4 +- man2/ptrace.2 | 2 +- man2/query_module.2 | 4 +- man2/quotactl.2 | 20 ++--- man2/readdir.2 | 4 +- man2/readv.2 | 8 +- man2/recv.2 | 6 +- man2/recvmmsg.2 | 8 +- man2/request_key.2 | 8 +- man2/sched_rr_get_interval.2 | 4 +- man2/sched_setaffinity.2 | 8 +- man2/sched_setattr.2 | 4 +- man2/sched_setscheduler.2 | 4 +- man2/seccomp.2 | 32 ++++---- man2/select.2 | 16 ++-- man2/select_tut.2 | 8 +- man2/semctl.2 | 10 +-- man2/semop.2 | 6 +- man2/send.2 | 2 +- man2/sendmmsg.2 | 4 +- man2/set_thread_area.2 | 4 +- man2/setns.2 | 8 +- man2/shmctl.2 | 10 +-- man2/shmget.2 | 2 +- man2/sigaction.2 | 12 +-- man2/sigaltstack.2 | 8 +- man2/signal.2 | 4 +- man2/sigwaitinfo.2 | 4 +- man2/stat.2 | 4 +- man2/statfs.2 | 4 +- man2/statx.2 | 8 +- man2/sync_file_range.2 | 4 +- man2/syscall.2 | 4 +- man2/sysctl.2 | 4 +- man2/sysinfo.2 | 8 +- man2/tee.2 | 4 +- man2/timer_create.2 | 2 +- man2/timer_settime.2 | 4 +- man2/timerfd_create.2 | 4 +- man2/unshare.2 | 2 +- man2/userfaultfd.2 | 8 +- man2/ustat.2 | 2 +- man2/utime.2 | 8 +- man2/utimensat.2 | 2 +- man2/vmsplice.2 | 4 +- man2/wait.2 | 2 +- man3/adjtime.3 | 2 +- man3/aio_init.3 | 4 +- man3/backtrace.3 | 2 +- man3/basename.3 | 4 +- man3/bswap.3 | 4 +- man3/btree.3 | 2 +- man3/clock_getcpuclockid.3 | 2 +- man3/cmsg.3 | 8 +- man3/confstr.3 | 2 +- man3/dbopen.3 | 6 +- man3/dl_iterate_phdr.3 | 14 ++-- man3/dladdr.3 | 12 +-- man3/dlinfo.3 | 14 ++-- man3/dlopen.3 | 4 +- man3/duplocale.3 | 2 +- man3/encrypt.3 | 2 +- man3/end.3 | 2 +- man3/endian.3 | 2 +- man3/err.3 | 6 +- man3/errno.3 | 2 +- man3/ether_aton.3 | 4 +- man3/fgetgrent.3 | 4 +- man3/fgetpwent.3 | 4 +- man3/fmemopen.3 | 2 +- man3/frexp.3 | 4 +- man3/ftime.3 | 4 +- man3/fts.3 | 2 +- man3/getaddrinfo.3 | 4 +- man3/getaddrinfo_a.3 | 8 +- man3/getdate.3 | 4 +- man3/getfsent.3 | 4 +- man3/getgrent.3 | 4 +- man3/getgrent_r.3 | 12 +-- man3/getgrnam.3 | 4 +- man3/getgrouplist.3 | 2 +- man3/gethostbyname.3 | 4 +- man3/getifaddrs.3 | 6 +- man3/getipnodebyname.3 | 4 +- man3/getmntent.3 | 4 +- man3/getnameinfo.3 | 10 +-- man3/getnetent.3 | 4 +- man3/getopt.3 | 4 +- man3/getprotoent.3 | 4 +- man3/getprotoent_r.3 | 2 +- man3/getpw.3 | 4 +- man3/getpwent.3 | 4 +- man3/getpwent_r.3 | 12 +-- man3/getpwnam.3 | 4 +- man3/getrpcent.3 | 2 +- man3/getservent.3 | 4 +- man3/getservent_r.3 | 2 +- man3/getspnam.3 | 4 +- man3/getttyent.3 | 2 +- man3/glob.3 | 6 +- man3/gnu_get_libc_version.3 | 2 +- man3/hash.3 | 2 +- man3/hsearch.3 | 2 +- man3/if_nameindex.3 | 4 +- man3/inet.3 | 2 +- man3/inet_net_pton.3 | 16 ++-- man3/inet_pton.3 | 2 +- man3/insque.3 | 6 +- man3/isalpha.3 | 4 +- man3/makecontext.3 | 2 +- man3/mallinfo.3 | 8 +- man3/malloc_info.3 | 2 +- man3/mallopt.3 | 10 +-- man3/matherr.3 | 20 ++--- man3/mbstowcs.3 | 2 +- man3/mcheck.3 | 2 +- man3/memchr.3 | 2 +- man3/mq_getattr.3 | 10 +-- man3/mq_open.3 | 2 +- man3/mq_receive.3 | 4 +- man3/mq_send.3 | 4 +- man3/mtrace.3 | 2 +- man3/newlocale.3 | 4 +- man3/ntp_gettime.3 | 6 +- man3/posix_openpt.3 | 2 +- man3/printf.3 | 4 +- man3/pthread_attr_init.3 | 8 +- man3/pthread_attr_setschedparam.3 | 4 +- man3/pthread_cancel.3 | 4 +- man3/pthread_cleanup_push.3 | 12 +-- man3/pthread_cleanup_push_defer_np.3 | 8 +- man3/pthread_create.3 | 8 +- man3/pthread_getattr_default_np.3 | 4 +- man3/pthread_getattr_np.3 | 12 +-- man3/pthread_getcpuclockid.3 | 4 +- man3/pthread_setname_np.3 | 2 +- man3/pthread_setschedparam.3 | 10 +-- man3/pthread_sigmask.3 | 4 +- man3/pthread_tryjoin_np.3 | 4 +- man3/readdir.3 | 4 +- man3/realpath.3 | 4 +- man3/recno.3 | 4 +- man3/regex.3 | 4 +- man3/rpc.3 | 22 +++--- man3/scanf.3 | 2 +- man3/sched_getcpu.3 | 2 +- man3/sem_wait.3 | 8 +- man3/setaliasent.3 | 4 +- man3/sigqueue.3 | 2 +- man3/statvfs.3 | 4 +- man3/strcat.3 | 2 +- man3/strcpy.3 | 4 +- man3/strftime.3 | 4 +- man3/strtok.3 | 4 +- man3/strtol.3 | 4 +- man3/strverscmp.3 | 4 +- man3/toupper.3 | 4 +- man3/ttyslot.3 | 4 +- man3/xdr.3 | 4 +- man4/fuse.4 | 54 ++++++------- man4/loop.4 | 12 +-- man4/rtc.4 | 8 +- man4/st.4 | 16 ++-- man5/acct.5 | 8 +- man5/core.5 | 8 +- man5/elf.5 | 36 ++++----- man5/slabinfo.5 | 2 +- man7/aio.7 | 8 +- man7/arp.7 | 4 +- man7/capabilities.7 | 8 +- man7/cgroup_namespaces.7 | 4 +- man7/cgroups.7 | 16 ++-- man7/ddp.7 | 4 +- man7/fanotify.7 | 12 +-- man7/feature_test_macros.7 | 4 +- man7/inode.7 | 8 +- man7/inotify.7 | 6 +- man7/ip.7 | 10 +-- man7/keyrings.7 | 6 +- man7/locale.7 | 2 +- man7/mount_namespaces.7 | 110 +++++++++++++-------------- man7/namespaces.7 | 8 +- man7/netdevice.7 | 8 +- man7/netlink.7 | 24 +++--- man7/packet.7 | 20 ++--- man7/pkeys.7 | 4 +- man7/pthreads.7 | 18 ++--- man7/sched.7 | 18 ++--- man7/session-keyring.7 | 8 +- man7/sock_diag.7 | 36 ++++----- man7/socket.7 | 16 ++-- man7/spufs.7 | 16 ++-- man7/udplite.7 | 2 +- man7/unix.7 | 12 +-- man7/user_namespaces.7 | 24 +++--- man7/vdso.7 | 2 +- man7/x25.7 | 4 +- man8/ld.so.8 | 4 +- 219 files changed, 813 insertions(+), 813 deletions(-) diff --git a/man2/execve.2 b/man2/execve.2 index c9ddced03..fbde5aa2e 100644 --- a/man2/execve.2 +++ b/man2/execve.2 @@ -296,9 +296,9 @@ An interpreter script is a text file that has execute permission enabled and whose first line is of the form: .PP .in +4n -.nf +.EX \fB#!\fP \fIinterpreter \fP[optional-arg] -.fi +.EE .in .PP The @@ -313,9 +313,9 @@ specifies an interpreter script, then will be invoked with the following arguments: .PP .in +4n -.nf +.EX \fIinterpreter\fP [optional-arg] \fIfilename\fP arg... -.fi +.EE .in .PP where diff --git a/man2/ioctl_console.2 b/man2/ioctl_console.2 index f56901e12..5966e660a 100644 --- a/man2/ioctl_console.2 +++ b/man2/ioctl_console.2 @@ -455,7 +455,7 @@ struct kbsentry { unsigned char kb_func; unsigned char kb_string[512]; }; -.fi +.EE .in .IP .I kb_string diff --git a/man2/ioctl_iflags.2 b/man2/ioctl_iflags.2 index 72458e573..66a356e34 100644 --- a/man2/ioctl_iflags.2 +++ b/man2/ioctl_iflags.2 @@ -35,7 +35,7 @@ These flags can be retrieved and modified using two operations: .PP .in +4n -.nf +.EX int attr; fd = open("pathname", ...); @@ -44,7 +44,7 @@ ioctl(fd, FS_IOC_GETFLAGS, &attr); /* Place current flags attr |= FS_NOATIME_FL; /* Tweak returned bit mask */ ioctl(fd, FS_IOC_SETFLAGS, &attr); /* Update flags for inode referred to by \(aqfd\(aq */ -.fi +.EE .in .PP The diff --git a/man2/ioctl_ns.2 b/man2/ioctl_ns.2 index 8946a10ca..d9aae7ca0 100644 --- a/man2/ioctl_ns.2 +++ b/man2/ioctl_ns.2 @@ -39,9 +39,9 @@ and The form of the calls is: .PP .in +4n -.nf +.EX new_fd = ioctl(fd, request); -.fi +.EE .in .PP In each case, @@ -125,9 +125,9 @@ the type of namespace referred to by the file descriptor .IR fd : .PP .in +4n -.nf +.EX nstype = ioctl(fd, NS_GET_NSTYPE); -.fi +.EE .in .PP .I fd @@ -154,10 +154,10 @@ of the process that created the user namespace). The form of the call is: .PP .in +4n -.nf +.EX uid_t uid; ioctl(fd, NS_GET_OWNER_UID, &uid); -.fi +.EE .in .PP .I fd @@ -198,10 +198,10 @@ Trying to get the parent of the initial user namespace fails, since it has no parent: .PP .in +4n -.nf +.EX $ \fB./ns_show /proc/self/ns/user p\fP The parent namespace is outside your namespace scope -.fi +.EE .in .PP Create a process running @@ -210,26 +210,26 @@ that resides in new user and UTS namespaces, and show that the new UTS namespace is associated with the new user namespace: .PP .in +4n -.nf +.EX $ \fBunshare \-Uu sleep 1000 &\fP [1] 23235 $ \fB./ns_show /proc/23235/ns/uts u\fP Device/Inode of owning user namespace is: [0,3] / 4026532448 $ \fBreadlink /proc/23235/ns/user \fP user:[4026532448] -.fi +.EE .in .PP Then show that the parent of the new user namespace in the preceding example is the initial user namespace: .PP .in +4n -.nf +.EX $ \fBreadlink /proc/self/ns/user\fP user:[4026531837] $ \fB./ns_show /proc/23235/ns/user p\fP Device/Inode of parent namespace is: [0,3] / 4026531837 -.fi +.EE .in .PP Start a shell in a new user namespace, and show that from within @@ -239,13 +239,13 @@ Similarly, the UTS namespace can't be discovered. .PP .in +4n -.nf +.EX $ \fBPS1="sh2$ " unshare \-U bash\fP sh2$ \fB./ns_show /proc/self/ns/user p\fP The parent namespace is outside your namespace scope sh2$ \fB./ns_show /proc/self/ns/uts u\fP The owning user namespace is outside your namespace scope -.fi +.EE .in .SS Program source \& diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2 index 7c51202ed..0a0e43e23 100644 --- a/man2/ioctl_userfaultfd.2 +++ b/man2/ioctl_userfaultfd.2 @@ -513,13 +513,13 @@ structure pointed to by .IR argp : .PP .in +4n -.nf +.EX struct uffdio_zeropage { struct uffdio_range range; __u64 mode; /* Flags controlling behavior of copy */ __s64 zeropage; /* Number of bytes zeroed, or negated error */ }; -.fi +.EE .in .PP The following value may be bitwise ORed in diff --git a/man2/kcmp.2 b/man2/kcmp.2 index d7d8b6f66..a79b29b3f 100644 --- a/man2/kcmp.2 +++ b/man2/kcmp.2 @@ -175,13 +175,13 @@ is a pointer to a structure where the target file is described. This structure has the form: .PP .in +4n -.nf +.EX struct kcmp_epoll_slot { __u32 efd; __u32 tfd; __u64 toff; }; -.fi +.EE .in .PP Within this structure, @@ -329,7 +329,7 @@ as described in the program output. An example run of the program is as follows: .PP .in +4n -.nf +.EX $ \fB./a.out\fP Parent PID is 1144 Parent opened file on FD 3 @@ -343,7 +343,7 @@ Child opened file on FD 4 Child duplicated FD 3 to create FD 5 Compare duplicated FDs in same process: kcmp(1145, 1145, KCMP_FILE, 3, 5) ==> same -.fi +.EE .in .SS Program source \& diff --git a/man2/kexec_load.2 b/man2/kexec_load.2 index 2ec15635d..a1217b12b 100644 --- a/man2/kexec_load.2 +++ b/man2/kexec_load.2 @@ -126,7 +126,7 @@ struct kexec_segment { void *mem; /* Physical address of kernel */ size_t memsz; /* Physical address length */ }; -.fi +.EE .in .PP The kernel image defined by diff --git a/man2/keyctl.2 b/man2/keyctl.2 index 3e8779f45..63109f9b4 100644 --- a/man2/keyctl.2 +++ b/man2/keyctl.2 @@ -1281,12 +1281,12 @@ but the payload data is specified as an array of structures: .IP .in +4n -.nf +.EX struct iovec { void *iov_base; /* Starting address of buffer */ size_t iov_len; /* Size of buffer (in bytes) */ }; -.fi +.EE .in .IP The pointer to the payload vector is specified in @@ -1424,14 +1424,14 @@ keys used in the Diffie-Hellman calculation, packaged in a structure of the following form: .IP .in +4n -.nf +.EX struct keyctl_dh_params { int32_t private; /* The local private key */ int32_t prime; /* The prime, known to both parties */ int32_t base; /* The base integer: either a shared generator or the remote public key */ }; -.fi +.EE .in .IP Each of the three keys specified in this structure must grant the caller @@ -1709,21 +1709,21 @@ we use the example program shown in to request a key. .PP .in +4n -.nf +.EX $ \fBcc \-o key_instantiate key_instantiate.c \-lkeyutils\fP $ \fBsudo mv /sbin/request\-key /sbin/request\-key.backup\fP $ \fBsudo cp key_instantiate /sbin/request\-key\fP $ \fB./t_request_key user mykey somepayloaddata\fP Key ID is 20d035bf $ \fBsudo mv /sbin/request\-key.backup /sbin/request\-key\fP -.fi +.EE .in .PP Looking at the log file created by this program, we can see the command-line arguments supplied to our example program: .PP .in +4n -.nf +.EX $ \fBcat /tmp/key_instantiate.log \fP Time: Mon Nov 7 13:06:47 2016 @@ -1741,7 +1741,7 @@ Key description: user;1000;1000;3f010000;mykey Auth key payload: somepayloaddata Destination keyring: 256e6a6 Auth key description: .request_key_auth;1000;1000;0b010000;20d035bf -.fi +.EE .in .PP The last few lines of the above output show that the example program @@ -1780,11 +1780,11 @@ and ID .IR 20d035bf . .PP .in +4n -.nf +.EX $ \fBcat /proc/keys | egrep \(aqmykey|256e6a6\(aq\fP 0256e6a6 I\-\-Q\-\-\- 194 perm 3f030000 1000 1000 keyring _ses: 3 20d035bf I\-\-Q\-\-\- 1 perm 3f010000 1000 1000 user mykey: 16 -.fi +.EE .in .SS Program source \& diff --git a/man2/link.2 b/man2/link.2 index 26b2199b9..95b41ec17 100644 --- a/man2/link.2 +++ b/man2/link.2 @@ -170,10 +170,10 @@ this can be used as an alternative to like this: .IP .in +4n -.nf +.EX linkat(AT_FDCWD, "/proc/self/fd/", newdirfd, newname, AT_SYMLINK_FOLLOW); -.fi +.EE .in .PP Before kernel 2.6.18, the diff --git a/man2/listxattr.2 b/man2/listxattr.2 index 6900eb60a..3d0b232de 100644 --- a/man2/listxattr.2 +++ b/man2/listxattr.2 @@ -205,7 +205,7 @@ some extended file attributes, and then listing the attributes with the example program. .SS Example output .in +4n -.nf +.EX $ \fBtouch /tmp/foo\fP $ \fBsetfattr -n user.fred -v chocolate /tmp/foo\fP $ \fBsetfattr -n user.frieda -v bar /tmp/foo\fP @@ -214,7 +214,7 @@ $ \fB./listxattr /tmp/foo\fP user.fred: chocolate user.frieda: bar user.empty: -.fi +.EE .in .SS Program source (listxattr.c) .nf diff --git a/man2/membarrier.2 b/man2/membarrier.2 index dfa48ca45..34d10315c 100644 --- a/man2/membarrier.2 +++ b/man2/membarrier.2 @@ -186,7 +186,7 @@ following code (x86) can be transformed using .BR membarrier (): .PP .in +4n -.nf +.EX #include static volatile int a, b; @@ -228,7 +228,7 @@ main(int argc, char **argv) exit(EXIT_SUCCESS); } -.fi +.EE .in .PP The code above transformed to use @@ -236,7 +236,7 @@ The code above transformed to use becomes: .PP .in +4n -.nf +.EX #define _GNU_SOURCE #include #include @@ -314,5 +314,5 @@ main(int argc, char **argv) exit(EXIT_SUCCESS); } -.fi +.EE .in diff --git a/man2/memfd_create.2 b/man2/memfd_create.2 index fa17466d2..8d66b7914 100644 --- a/man2/memfd_create.2 +++ b/man2/memfd_create.2 @@ -325,11 +325,11 @@ First we create a file and set some seals on it: .PP .in +4n -.nf +.EX $ \fB./t_memfd_create my_memfd_file 4096 sw &\fP [1] 11775 PID: 11775; fd: 3; /proc/11775/fd/3 -.fi +.EE .in .PP At this point, the @@ -349,12 +349,12 @@ symbolic link, and use our program to view the seals that have been placed on the file: .PP .in +4n -.nf +.EX $ \fBreadlink /proc/11775/fd/3\fP /memfd:my_memfd_file (deleted) $ \fB./t_get_seals /proc/11775/fd/3\fP Existing seals: WRITE SHRINK -.fi +.EE .in .SS Program source: t_memfd_create.c \& diff --git a/man2/mmap.2 b/man2/mmap.2 index 62a1a4dc5..401da62d2 100644 --- a/man2/mmap.2 +++ b/man2/mmap.2 @@ -263,10 +263,10 @@ field exposed by Thus, the above two constants are defined as: .IP .in +4n -.nf +.EX #define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT) #define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT) -.fi +.EE .in .IP The range of huge page sizes that are supported by the system diff --git a/man2/modify_ldt.2 b/man2/modify_ldt.2 index 3b6eb0399..7831feb08 100644 --- a/man2/modify_ldt.2 +++ b/man2/modify_ldt.2 @@ -88,7 +88,7 @@ struct user_desc { unsigned int seg_not_present:1; unsigned int useable:1; }; -.fi +.EE .in .PP In Linux 2.4 and earlier, this structure was named diff --git a/man2/mprotect.2 b/man2/mprotect.2 index 755353466..5387c2b27 100644 --- a/man2/mprotect.2 +++ b/man2/mprotect.2 @@ -292,11 +292,11 @@ An example of what we might see when running the program is the following: .PP .in +4n -.nf +.EX .RB "$" " ./a.out" Start of region: 0x804c000 Got SIGSEGV at address: 0x804e000 -.fi +.EE .in .SS Program source \& diff --git a/man2/msgctl.2 b/man2/msgctl.2 index 97f3457f2..23fabef10 100644 --- a/man2/msgctl.2 +++ b/man2/msgctl.2 @@ -72,7 +72,7 @@ struct msqid_ds { pid_t msg_lspid; /* PID of last msgsnd(2) */ pid_t msg_lrpid; /* PID of last msgrcv(2) */ }; -.fi +.EE .in .PP The @@ -82,7 +82,7 @@ structure is defined as follows .BR IPC_SET ): .PP .in +4n -.nf +.EX struct ipc_perm { key_t __key; /* Key supplied to msgget(2) */ uid_t \fBuid\fP; /* Effective UID of owner */ @@ -92,7 +92,7 @@ struct ipc_perm { unsigned short \fBmode\fP; /* Permissions */ unsigned short __seq; /* Sequence number */ }; -.fi +.EE .in .PP Valid values for diff --git a/man2/nanosleep.2 b/man2/nanosleep.2 index 090b3adb0..20de64cff 100644 --- a/man2/nanosleep.2 +++ b/man2/nanosleep.2 @@ -78,12 +78,12 @@ is used to specify intervals of time with nanosecond precision. It is defined as follows: .PP .in +4n -.nf +.EX struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; -.fi +.EE .in .PP The value of the nanoseconds field must be in the range 0 to 999999999. diff --git a/man2/open_by_handle_at.2 b/man2/open_by_handle_at.2 index e807155b6..446afd648 100644 --- a/man2/open_by_handle_at.2 +++ b/man2/open_by_handle_at.2 @@ -70,14 +70,14 @@ The file handle is returned via the argument which is a pointer to a structure of the following form: .PP .in +4n -.nf +.EX struct file_handle { unsigned int handle_bytes; /* Size of f_handle [in, out] */ int handle_type; /* Handle type [out] */ unsigned char f_handle[0]; /* File identifier (sized by caller) [out] */ }; -.fi +.EE .in .PP It is the caller's responsibility to allocate the structure @@ -471,7 +471,7 @@ and the mount directory specified in that record is opened. The following shell session demonstrates the use of these two programs: .PP .in +4n -.nf +.EX $ \fBecho 'Can you please think about it?' > cecilia.txt\fP $ \fB./t_name_to_handle_at cecilia.txt > fh\fP $ \fB./t_open_by_handle_at < fh\fP @@ -479,7 +479,7 @@ open_by_handle_at: Operation not permitted $ \fBsudo ./t_open_by_handle_at < fh\fP # Need CAP_SYS_ADMIN Read 31 bytes $ \fBrm cecilia.txt\fP -.fi +.EE .in .PP Now we delete and (quickly) re-create the file so that @@ -492,7 +492,7 @@ recognizes that the original file referred to by the file handle no longer exists. .PP .in +4n -.nf +.EX $ \fBstat \-\-printf="%i\\n" cecilia.txt\fP # Display inode number 4072121 $ \fBrm cecilia.txt\fP @@ -501,7 +501,7 @@ $ \fBstat \-\-printf="%i\\n" cecilia.txt\fP # Check inode number 4072121 $ \fBsudo ./t_open_by_handle_at < fh\fP open_by_handle_at: Stale NFS file handle -.fi +.EE .in .SS Program source: t_name_to_handle_at.c \& diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2 index e373c16ea..7089602de 100644 --- a/man2/perf_event_open.2 +++ b/man2/perf_event_open.2 @@ -201,7 +201,7 @@ structure provides detailed configuration information for the event being created. .PP .in +4n -.nf +.EX struct perf_event_attr { __u32 type; /* Type of event */ __u32 size; /* Size of attribute structure */ @@ -274,7 +274,7 @@ struct perf_event_attr { __u16 __reserved_2; /* align to u64 */ }; -.fi +.EE .in .PP The fields of the @@ -1034,7 +1034,7 @@ value appearing twice. The layout is described by this pseudo-structure: .IP .in +4n -.nf +.EX struct sample_id { { u32 pid, tid; } /* if PERF_SAMPLE_TID set */ { u64 time; } /* if PERF_SAMPLE_TIME set */ @@ -1361,7 +1361,7 @@ If was specified to allow reading all events in a group at once: .IP .in +4n -.nf +.EX struct read_format { u64 nr; /* The number of events */ u64 time_enabled; /* if PERF_FORMAT_TOTAL_TIME_ENABLED */ @@ -1371,7 +1371,7 @@ struct read_format { u64 id; /* if PERF_FORMAT_ID */ } values[nr]; }; -.fi +.EE .in .IP * If @@ -1381,14 +1381,14 @@ was specified: .IP .in +4n -.nf +.EX struct read_format { u64 value; /* The value of the event */ u64 time_enabled; /* if PERF_FORMAT_TOTAL_TIME_ENABLED */ u64 time_running; /* if PERF_FORMAT_TOTAL_TIME_RUNNING */ u64 id; /* if PERF_FORMAT_ID */ }; -.fi +.EE .in .PP The values read are as follows: @@ -1442,7 +1442,7 @@ ring buffer when sampling even if you do not plan to access it. The structure of the first metadata mmap page is as follows: .PP .in +4n -.nf +.EX struct perf_event_mmap_page { __u32 version; /* version number of this structure */ __u32 compat_version; /* lowest version this is compat with */ @@ -1476,7 +1476,7 @@ struct perf_event_mmap_page { __u64 aux_size; } -.fi +.EE .in .PP The following list describes the fields in the @@ -1552,7 +1552,7 @@ without syscall (this is the "rdpmc" instruction on x86), then the following code can be used to do a read: .IP .in +4n -.nf +.EX u32 seq, time_mult, time_shift, idx, width; u64 count, enabled, running; u64 cyc, time_offset; @@ -1580,7 +1580,7 @@ do { barrier(); } while (pc\->lock != seq); -.fi +.EE .in .TP .IR cap_user_time " (since Linux 3.12)" @@ -1603,11 +1603,11 @@ read using the rdpmc or equivalent instruction. This can be used to sign extend the result like: .IP .in +4n -.nf +.EX pmc <<= 64 \- pmc_width; pmc >>= 64 \- pmc_width; // signed shift right count += pmc; -.fi +.EE .in .TP .IR time_shift ", " time_mult ", " time_offset @@ -1761,13 +1761,13 @@ fields being ignored. The mmap values start with a header: .PP .in +4n -.nf +.EX struct perf_event_header { __u32 type; __u16 misc; __u16 size; }; -.fi +.EE .in .PP Below, we describe the @@ -1882,7 +1882,7 @@ user-space IPs to code. They have the following structure: .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u32 pid, tid; @@ -1891,7 +1891,7 @@ struct { u64 pgoff; char filename[]; }; -.fi +.EE .in .RS .TP @@ -1915,14 +1915,14 @@ is a string describing the backing of the allocated memory. This record indicates when events are lost. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u64 id; u64 lost; struct sample_id sample_id; }; -.fi +.EE .in .RS .TP @@ -1937,7 +1937,7 @@ is the number of events that were lost. This record indicates a change in the process name. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u32 pid; @@ -1945,7 +1945,7 @@ struct { char comm[]; struct sample_id sample_id; }; -.fi +.EE .in .RS .TP @@ -1963,7 +1963,7 @@ is a string containing the new name of the process. This record indicates a process exit event. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u32 pid, ppid; @@ -1971,14 +1971,14 @@ struct { u64 time; struct sample_id sample_id; }; -.fi +.EE .in .TP .BR PERF_RECORD_THROTTLE ", " PERF_RECORD_UNTHROTTLE This record indicates a throttle/unthrottle event. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u64 time; @@ -1986,14 +1986,14 @@ struct { u64 stream_id; struct sample_id sample_id; }; -.fi +.EE .in .TP .B PERF_RECORD_FORK This record indicates a fork event. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u32 pid, ppid; @@ -2001,28 +2001,28 @@ struct { u64 time; struct sample_id sample_id; }; -.fi +.EE .in .TP .B PERF_RECORD_READ This record indicates a read event. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u32 pid, tid; struct read_format values; struct sample_id sample_id; }; -.fi +.EE .in .TP .B PERF_RECORD_SAMPLE This record indicates a sample. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u64 sample_id; /* if PERF_SAMPLE_IDENTIFIER */ @@ -2486,7 +2486,7 @@ record, but includes extra values that allow uniquely identifying shared mappings. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u32 pid; @@ -2549,7 +2549,7 @@ This record reports that new data is available in the separate AUX buffer region. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u64 aux_offset; @@ -2587,7 +2587,7 @@ trace event, allowing tools to properly correlate the instruction addresses in the AUX buffer with the proper executable. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u32 pid; @@ -2609,7 +2609,7 @@ When using hardware sampling (such as Intel PEBS) this record indicates some number of samples that may have been lost. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u64 lost; @@ -2633,7 +2633,7 @@ field indicates whether it was a context switch into or away from the current process. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; struct sample_id sample_id; @@ -2656,7 +2656,7 @@ field indicates whether it was a context switch into or away from the current process. .IP .in +4n -.nf +.EX struct { struct perf_event_header header; u32 next_prev_pid; diff --git a/man2/poll.2 b/man2/poll.2 index f26572a82..922cacc89 100644 --- a/man2/poll.2 +++ b/man2/poll.2 @@ -62,7 +62,7 @@ struct pollfd { short events; /* requested events */ short revents; /* returned events */ }; -.fi +.EE .in .PP The caller should specify the number of items in the @@ -315,7 +315,7 @@ struct timespec { long tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; -.fi +.EE .in .PP If diff --git a/man2/posix_fadvise.2 b/man2/posix_fadvise.2 index 918ca7aff..705a5b743 100644 --- a/man2/posix_fadvise.2 +++ b/man2/posix_fadvise.2 @@ -214,10 +214,10 @@ but is otherwise exactly the same as For example, since Linux 2.6.14, ARM has the following system call: .PP .in +4n -.nf +.EX .BI "long arm_fadvise64_64(int " fd ", int " advice , .BI " loff_t " offset ", loff_t " len ); -.fi +.EE .in .PP These architecture-specific details are generally diff --git a/man2/process_vm_readv.2 b/man2/process_vm_readv.2 index 89a176d41..609c2af92 100644 --- a/man2/process_vm_readv.2 +++ b/man2/process_vm_readv.2 @@ -121,12 +121,12 @@ structures, defined in as: .PP .in +4n -.nf +.EX struct iovec { void *iov_base; /* Starting address */ size_t iov_len; /* Number of bytes to transfer */ }; -.fi +.EE .in .PP Buffers are processed in array order. diff --git a/man2/ptrace.2 b/man2/ptrace.2 index 6c3245d9b..a79bbd9d5 100644 --- a/man2/ptrace.2 +++ b/man2/ptrace.2 @@ -412,7 +412,7 @@ struct ptrace_peeksiginfo_args { u32 flags; /* PTRACE_PEEKSIGINFO_SHARED or 0 */ s32 nr; /* Number of signals to copy */ }; -.fi +.EE .in .IP Currently, there is only one flag, diff --git a/man2/query_module.2 b/man2/query_module.2 index 299cf138f..e74c681d6 100644 --- a/man2/query_module.2 +++ b/man2/query_module.2 @@ -85,7 +85,7 @@ struct module_symbol { unsigned long value; unsigned long name; }; -.fi +.EE .in .IP followed by null-terminated strings. @@ -107,7 +107,7 @@ struct module_info { unsigned long size; unsigned long flags; }; -.fi +.EE .in .IP where diff --git a/man2/quotactl.2 b/man2/quotactl.2 index ce987129d..7d78d47f8 100644 --- a/man2/quotactl.2 +++ b/man2/quotactl.2 @@ -218,7 +218,7 @@ field that is used to return the ID for which quota information is being returned: .IP .in +4n -.nf +.EX struct nextdqblk { uint64_t dqb_bhardlimit; uint64_t dqb_bsoftlimit; @@ -231,7 +231,7 @@ struct nextdqblk { uint32_t dqb_valid; uint32_t dqb_id; }; -.fi +.EE .in .TP .B Q_SETQUOTA @@ -394,7 +394,7 @@ that contains a combination of the following flags (defined in .IR ): .IP .in +4n -.nf +.EX #define XFS_QUOTA_UDQ_ACCT (1<<0) /* User quota accounting */ #define XFS_QUOTA_UDQ_ENFD (1<<1) /* User quota limits @@ -407,7 +407,7 @@ that contains a combination of the following flags (defined in accounting */ #define XFS_QUOTA_PDQ_ENFD (1<<5) /* Project quota limits enforcement */ -.fi +.EE .in .IP This operation requires privilege @@ -444,7 +444,7 @@ structure, which is defined in as follows: .IP .in +4n -.nf +.EX /* All the blk units are in BBs (Basic Blocks) of 512 bytes. */ @@ -490,7 +490,7 @@ struct fs_disk_quota { int16_t d_padding3; /* Padding - for future use */ char d_padding4[8]; /* Yet more padding */ }; -.fi +.EE .in .IP Unprivileged users may retrieve only their own quotas; @@ -543,7 +543,7 @@ The structure itself is defined as follows: .IP .in +4n -.nf +.EX #define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */ struct fs_qfilestat { @@ -570,7 +570,7 @@ struct fs_quota_stat { uint16_t qs_bwarnlimit; /* Limit for # of warnings */ uint16_t qs_iwarnlimit; /* Limit for # of warnings */ }; -.fi +.EE .in .IP The @@ -592,7 +592,7 @@ The structure itself is defined as follows: .IP .in +4n -.nf +.EX #define FS_QSTATV_VERSION1 1 /* fs_quota_statv.qs_version */ struct fs_qfilestatv { @@ -623,7 +623,7 @@ struct fs_quota_statv { uint16_t qs_iwarnlimit; /* Limit for # of warnings */ uint64_t qs_pad2[8]; /* For future proofing */ }; -.fi +.EE .in .IP The diff --git a/man2/readdir.2 b/man2/readdir.2 index 798cf19a3..04b87072b 100644 --- a/man2/readdir.2 +++ b/man2/readdir.2 @@ -67,14 +67,14 @@ The structure is declared as follows: .PP .in +4n -.nf +.EX struct old_linux_dirent { long d_ino; /* inode number */ off_t d_off; /* offset to this \fIold_linux_dirent\fP */ unsigned short d_reclen; /* length of this \fId_name\fP */ char d_name[NAME_MAX+1]; /* filename (null-terminated) */ } -.fi +.EE .in .PP .I d_ino diff --git a/man2/readv.2 b/man2/readv.2 index 45dbf71d3..b8b35f0c8 100644 --- a/man2/readv.2 +++ b/man2/readv.2 @@ -96,12 +96,12 @@ as: .PP .br .in +4n -.nf +.EX struct iovec { void *iov_base; /* Starting address */ size_t iov_len; /* Number of bytes to transfer */ }; -.fi +.EE .in .PP The @@ -381,7 +381,7 @@ The following code sample demonstrates the use of .BR writev (): .PP .in +4n -.nf +.EX char *str0 = "hello "; char *str1 = "world\\n"; struct iovec iov[2]; @@ -393,7 +393,7 @@ iov[1].iov_base = str1; iov[1].iov_len = strlen(str1); nwritten = writev(STDOUT_FILENO, iov, 2); -.fi +.EE .in .SH SEE ALSO .BR pread (2), diff --git a/man2/recv.2 b/man2/recv.2 index 48dd1f48a..3432efd31 100644 --- a/man2/recv.2 +++ b/man2/recv.2 @@ -189,7 +189,7 @@ struct sock_extended_err }; struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *); -.fi +.EE .in .IP .I ee_errno @@ -340,7 +340,7 @@ struct msghdr { size_t msg_controllen; /* ancillary data buffer len */ int msg_flags; /* flags on received message */ }; -.fi +.EE .in .PP The @@ -391,7 +391,7 @@ struct cmsghdr { /* followed by unsigned char cmsg_data[]; */ }; -.fi +.EE .in .PP Ancillary data should be accessed only by the macros defined in diff --git a/man2/recvmmsg.2 b/man2/recvmmsg.2 index ed1a50283..50d6bc1b4 100644 --- a/man2/recvmmsg.2 +++ b/man2/recvmmsg.2 @@ -72,12 +72,12 @@ structure is defined in as: .PP .in +4n -.nf +.EX struct mmsghdr { struct msghdr msg_hdr; /* Message header */ unsigned int msg_len; /* Number of received bytes for header */ }; -.fi +.EE .in .PP The @@ -196,7 +196,7 @@ containing a random number: .EX .RB "$" " while true; do echo $RANDOM > /dev/udp/127.0.0.1/1234; " .B " sleep 0.25; done" -.fi +.EE .in .PP These datagrams are read by the example application, which @@ -211,7 +211,7 @@ can give the following output: 3 304 4 13514 5 28421 -.fi +.EE .in .SS Program source \& diff --git a/man2/request_key.2 b/man2/request_key.2 index 6c3036914..ce987e353 100644 --- a/man2/request_key.2 +++ b/man2/request_key.2 @@ -461,12 +461,12 @@ we first create a suitable entry in the file .IR /etc/request-key.conf . .PP .in +4n -.nf +.EX $ sudo sh # \fBecho 'create user mtk:* * /bin/keyctl instantiate %k %c %S' \\\fP \fB> /etc/request-keys.conf\fP # \fBexit\fP -.fi +.EE .in .PP This entry specifies that when a new "user" key with the prefix @@ -499,11 +499,11 @@ Then we run the program and check the contents of to verify that the requested key has been instantiated: .PP .in +4n -.nf +.EX $ \fB./t_request_key user mtk:key1 "Payload data"\fP $ \fBgrep \(aq2dddaf50\(aq /proc/keys\fP 2dddaf50 I--Q--- 1 perm 3f010000 1000 1000 user mtk:key1: 12 -.fi +.EE .in .PP For another example of the use of this program, see diff --git a/man2/sched_rr_get_interval.2 b/man2/sched_rr_get_interval.2 index 239263bf8..8d059feaa 100644 --- a/man2/sched_rr_get_interval.2 +++ b/man2/sched_rr_get_interval.2 @@ -50,12 +50,12 @@ The structure has the following form: .PP .in +4n -.nf +.EX struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; -.fi +.EE .in .PP If diff --git a/man2/sched_setaffinity.2 b/man2/sched_setaffinity.2 index 728b7fccf..a5c4a94b3 100644 --- a/man2/sched_setaffinity.2 +++ b/man2/sched_setaffinity.2 @@ -314,12 +314,12 @@ to determine that this (x86) system has two cores, each with two CPUs: .PP .in +4n -.nf +.EX $ \fBlscpu | grep -i 'core.*:|socket'\fP Thread(s) per core: 2 Core(s) per socket: 2 Socket(s): 1 -.fi +.EE .in .PP We then time the operation of the example program for three cases: @@ -328,7 +328,7 @@ both processes running on different CPUs on the same core; and both processes running on different CPUs on different cores. .PP .in +4n -.nf +.EX $ \fBtime \-p ./a.out 0 0 100000000\fP real 14.75 user 3.02 @@ -341,7 +341,7 @@ $ \fBtime \-p ./a.out 0 3 100000000\fP real 7.89 user 3.29 sys 12.07 -.fi +.EE .in .SS Program source \& diff --git a/man2/sched_setattr.2 b/man2/sched_setattr.2 index 92e86eb4f..9408d58a0 100644 --- a/man2/sched_setattr.2 +++ b/man2/sched_setattr.2 @@ -96,7 +96,7 @@ the new scheduling policy and attributes for the specified thread. This structure has the following form: .PP .in +4n -.nf +.EX struct sched_attr { u32 size; /* Size of this structure */ u32 sched_policy; /* Policy (SCHED_*) */ @@ -110,7 +110,7 @@ struct sched_attr { u64 sched_deadline; u64 sched_period; }; -.fi +.EE .in .PP The fields of this structure are as follows: diff --git a/man2/sched_setscheduler.2 b/man2/sched_setscheduler.2 index 661dbe109..88239fdf6 100644 --- a/man2/sched_setscheduler.2 +++ b/man2/sched_setscheduler.2 @@ -51,13 +51,13 @@ The scheduling parameters are specified in the argument, which is a pointer to a structure of the following form: .PP .in +4n -.nf +.EX struct sched_param { ... int sched_priority; ... }; -.fi +.EE .in .PP In the current implementation, the structure contains only one field, diff --git a/man2/seccomp.2 b/man2/seccomp.2 index 6332c1c86..cf44cd4e7 100644 --- a/man2/seccomp.2 +++ b/man2/seccomp.2 @@ -213,26 +213,26 @@ When adding filters via points to a filter program: .PP .in +4n -.nf +.EX struct sock_fprog { unsigned short len; /* Number of BPF instructions */ struct sock_filter *filter; /* Pointer to array of BPF instructions */ }; -.fi +.EE .in .PP Each program must contain one or more BPF instructions: .PP .in +4n -.nf +.EX struct sock_filter { /* Filter block */ __u16 code; /* Actual filter code */ __u8 jt; /* Jump true */ __u8 jf; /* Jump false */ __u32 k; /* Generic multiuse field */ }; -.fi +.EE .in .PP When executing the instructions, the BPF program operates on the @@ -247,7 +247,7 @@ addressing mode) as a (read-only) buffer of the following form: .PP .in +4n -.nf +.EX struct seccomp_data { int nr; /* System call number */ __u32 arch; /* AUDIT_ARCH_* value @@ -255,7 +255,7 @@ struct seccomp_data { __u64 instruction_pointer; /* CPU instruction pointer */ __u64 args[6]; /* Up to 6 system call arguments */ }; -.fi +.EE .in .PP Because numbering of system calls varies between architectures and @@ -664,14 +664,14 @@ and then construct a shell function that looks up system call numbers on this architecture: .PP .in +4n -.nf +.EX $ \fBuname -m\fP x86_64 $ \fBsyscall_nr() { cat /usr/src/linux/arch/x86/syscalls/syscall_64.tbl | \\ awk '$2 != "x32" && $3 == "'$1'" { print $1 }' }\fP -.fi +.EE .in .PP When the BPF filter rejects a system call (case [2] above), @@ -680,10 +680,10 @@ specified on the command line. In the experiments shown here, we'll use error number 99: .PP .in +4n -.nf +.EX $ \fBerrno 99\fP EADDRNOTAVAIL 99 Cannot assign requested address -.fi +.EE .in .PP In the following example, we attempt to run the command @@ -693,7 +693,7 @@ but the BPF filter rejects the system call, so that the command is not even executed: .PP .in +4n -.nf +.EX $ \fBsyscall_nr execve\fP 59 $ \fB./a.out\fP @@ -702,7 +702,7 @@ Hint for : AUDIT_ARCH_I386: 0x40000003 AUDIT_ARCH_X86_64: 0xC000003E $ \fB./a.out 59 0xC000003E 99 /bin/whoami\fP execv: Cannot assign requested address -.fi +.EE .in .PP In the next example, the BPF filter rejects the @@ -712,11 +712,11 @@ system call, so that, although it is successfully started, the command is not able to write output: .PP .in +4n -.nf +.EX $ \fBsyscall_nr write\fP 1 $ \fB./a.out 1 0xC000003E 99 /bin/whoami\fP -.fi +.EE .in .PP In the final example, @@ -725,12 +725,12 @@ the BPF filter rejects a system call that is not used by the command, so it is able to successfully execute and produce output: .PP .in +4n -.nf +.EX $ \fBsyscall_nr preadv\fP 295 $ \fB./a.out 295 0xC000003E 99 /bin/whoami\fP cecilia -.fi +.EE .in .SS Program source .EX diff --git a/man2/select.2 b/man2/select.2 index fa7ec0c89..8e7d9eefc 100644 --- a/man2/select.2 +++ b/man2/select.2 @@ -262,23 +262,23 @@ The time structures involved are defined in and look like .PP .in +4n -.nf +.EX struct timeval { long tv_sec; /* seconds */ long tv_usec; /* microseconds */ }; -.fi +.EE .in .PP and .PP .in +4n -.nf +.EX struct timespec { long tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; -.fi +.EE .in .PP (However, see below on the POSIX.1 versions.) @@ -436,12 +436,12 @@ structure are typed as The POSIX.1 situation is .PP .in +4n -.nf +.EX struct timeval { time_t tv_sec; /* seconds */ suseconds_t tv_usec; /* microseconds */ }; -.fi +.EE .in .PP where the structure is defined in @@ -488,7 +488,7 @@ and the event notifications provided by .BR epoll (7)): .PP .in +4n -.nf +.EX #define POLLIN_SET (POLLRDNORM | POLLRDBAND | POLLIN | POLLHUP | POLLERR) /* Ready for reading */ @@ -496,7 +496,7 @@ and the event notifications provided by /* Ready for writing */ #define POLLEX_SET (POLLPRI) /* Exceptional condition */ -.fi +.EE .in .\" .SS Multithreaded applications diff --git a/man2/select_tut.2 b/man2/select_tut.2 index 5dfcea8df..4d06c0963 100644 --- a/man2/select_tut.2 +++ b/man2/select_tut.2 @@ -164,12 +164,12 @@ of file descriptors at the time of the call. The structure \fIstruct timeval\fP is defined as: .IP .in +4n -.nf +.EX struct timeval { time_t tv_sec; /* seconds */ long tv_usec; /* microseconds */ }; -.fi +.EE .in .TP \fIntimeout\fP @@ -182,12 +182,12 @@ but has nanosecond precision as follows: .IP .in +4n -.nf +.EX struct timespec { long tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; -.fi +.EE .in .TP \fIsigmask\fP diff --git a/man2/semctl.2 b/man2/semctl.2 index 129156c2b..120d5424e 100644 --- a/man2/semctl.2 +++ b/man2/semctl.2 @@ -67,7 +67,7 @@ When there are four, the fourth has the type The \fIcalling program\fP must define this union as follows: .PP .in +4n -.nf +.EX union semun { int val; /* Value for SETVAL */ struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ @@ -75,7 +75,7 @@ union semun { struct seminfo *__buf; /* Buffer for IPC_INFO (Linux-specific) */ }; -.fi +.EE .in .PP The @@ -90,7 +90,7 @@ struct semid_ds { time_t sem_ctime; /* Last change time */ unsigned long sem_nsems; /* No. of semaphores in set */ }; -.fi +.EE .in .PP The @@ -100,7 +100,7 @@ structure is defined as follows .BR IPC_SET ): .PP .in +4n -.nf +.EX struct ipc_perm { key_t __key; /* Key supplied to semget(2) */ uid_t \fBuid\fP; /* Effective UID of owner */ @@ -110,7 +110,7 @@ struct ipc_perm { unsigned short \fBmode\fP; /* Permissions */ unsigned short __seq; /* Sequence number */ }; -.fi +.EE .in .PP Valid values for diff --git a/man2/semop.2 b/man2/semop.2 index 7b48407cf..88de49048 100644 --- a/man2/semop.2 +++ b/man2/semop.2 @@ -59,7 +59,7 @@ Each semaphore in a System\ V semaphore set has the following associated values: .PP .in +4n -.nf +.EX unsigned short semval; /* semaphore value */ unsigned short semzcnt; /* # waiting for zero */ unsigned short semncnt; /* # waiting for increase */ @@ -81,11 +81,11 @@ The elements of this structure are of type containing the following members: .PP .in +4n -.nf +.EX unsigned short sem_num; /* semaphore number */ short sem_op; /* semaphore operation */ short sem_flg; /* operation flags */ -.fi +.EE .in .PP Flags recognized in diff --git a/man2/send.2 b/man2/send.2 index b20e7418b..bc5e35c4b 100644 --- a/man2/send.2 +++ b/man2/send.2 @@ -273,7 +273,7 @@ struct msghdr { size_t msg_controllen; /* ancillary data buffer len */ int msg_flags; /* flags (unused) */ }; -.fi +.EE .in .PP The diff --git a/man2/sendmmsg.2 b/man2/sendmmsg.2 index b813aa9e2..7dfa4d608 100644 --- a/man2/sendmmsg.2 +++ b/man2/sendmmsg.2 @@ -67,12 +67,12 @@ structure is defined in as: .PP .in +4n -.nf +.EX struct mmsghdr { struct msghdr msg_hdr; /* Message header */ unsigned int msg_len; /* Number of bytes transmitted */ }; -.fi +.EE .in .PP The diff --git a/man2/set_thread_area.2 b/man2/set_thread_area.2 index 7c38c9370..346f2def4 100644 --- a/man2/set_thread_area.2 +++ b/man2/set_thread_area.2 @@ -30,7 +30,7 @@ Both of these system calls take an argument that is a pointer to a structure of the following type: .PP .in +4n -.nf +.EX struct user_desc { unsigned int entry_number; unsigned long base_addr; @@ -42,7 +42,7 @@ struct user_desc { unsigned int seg_not_present:1; unsigned int useable:1; }; -.fi +.EE .in .PP .BR get_thread_area () diff --git a/man2/setns.2 b/man2/setns.2 index 90f377df7..ce9e39669 100644 --- a/man2/setns.2 +++ b/man2/setns.2 @@ -237,7 +237,7 @@ and then both processes display the hostnames in their UTS namespaces, so that we can see that they are different. .PP .in +4n -.nf +.EX $ \fBsu\fP # Need privilege for namespace operations Password: # \fB./newuts bizarro &\fP @@ -247,7 +247,7 @@ uts.nodename in child: bizarro uts.nodename in parent: antero # \fBuname \-n\fP # Verify hostname in the shell antero -.fi +.EE .in .PP We then run the program shown below, @@ -256,11 +256,11 @@ Inside that shell, we verify that the hostname is the one set by the child created by the first program: .PP .in +4n -.nf +.EX # \fB./ns_exec /proc/3550/ns/uts /bin/bash\fP # \fBuname \-n\fP # Executed in shell started by ns_exec bizarro -.fi +.EE .in .SS Program source .EX diff --git a/man2/shmctl.2 b/man2/shmctl.2 index aa22b7e8a..534ac70b8 100644 --- a/man2/shmctl.2 +++ b/man2/shmctl.2 @@ -66,7 +66,7 @@ argument is a pointer to a \fIshmid_ds\fP structure, defined in \fI\fP as follows: .PP .in +4n -.nf +.EX struct shmid_ds { struct ipc_perm shm_perm; /* Ownership and permissions */ size_t shm_segsz; /* Size of segment (bytes) */ @@ -78,7 +78,7 @@ struct shmid_ds { shmatt_t shm_nattch; /* No. of current attaches */ ... }; -.fi +.EE .in .PP The @@ -88,7 +88,7 @@ structure is defined as follows .BR IPC_SET ): .PP .in +4n -.nf +.EX struct ipc_perm { key_t __key; /* Key supplied to shmget(2) */ uid_t \fBuid\fP; /* Effective UID of owner */ @@ -99,7 +99,7 @@ struct ipc_perm { SHM_LOCKED flags */ unsigned short __seq; /* Sequence number */ }; -.fi +.EE .in .PP Valid values for @@ -230,7 +230,7 @@ struct shm_info { unsigned long swap_successes; /* Unused since Linux 2.4 */ }; -.fi +.EE .in .TP .BR SHM_STAT " (Linux-specific)" diff --git a/man2/shmget.2 b/man2/shmget.2 index c29a7994e..2ade9c9d8 100644 --- a/man2/shmget.2 +++ b/man2/shmget.2 @@ -128,7 +128,7 @@ Thus, the above two constants are defined as: .in +4 #define SHM_HUGE_2MB (21 << SHM_HUGE_SHIFT) #define SHM_HUGE_1GB (30 << SHM_HUGE_SHIFT) -.fi +.EE .in .IP For some additional details, diff --git a/man2/sigaction.2 b/man2/sigaction.2 index 03e40b3fb..b877921d4 100644 --- a/man2/sigaction.2 +++ b/man2/sigaction.2 @@ -100,7 +100,7 @@ The structure is defined as something like: .PP .in +4n -.nf +.EX struct sigaction { void (*sa_handler)(int); void (*sa_sigaction)(int, siginfo_t *, void *); @@ -108,7 +108,7 @@ struct sigaction { int sa_flags; void (*sa_restorer)(void); }; -.fi +.EE .in .PP On some architectures a union is involved: do not assign to both @@ -273,13 +273,13 @@ field. This handler takes three arguments, as follows: .PP .in +4n -.nf +.EX void handler(int sig, siginfo_t *info, void *ucontext) { ... } -.fi +.EE .in .PP The @@ -287,7 +287,7 @@ The data type is a structure with the following fields: .PP .in +4n -.nf +.EX siginfo_t { int si_signo; /* Signal number */ int si_errno; /* An errno value */ @@ -330,7 +330,7 @@ siginfo_t { unsigned int si_arch; /* Architecture of attempted system call (since Linux 3.5) */ } -.fi +.EE .in .PP .IR si_signo ", " si_errno " and " si_code diff --git a/man2/sigaltstack.2 b/man2/sigaltstack.2 index 4f3290549..4134813e1 100644 --- a/man2/sigaltstack.2 +++ b/man2/sigaltstack.2 @@ -90,13 +90,13 @@ The type used to type the arguments of this function is defined as follows: .PP .in +4n -.nf +.EX typedef struct { void *ss_sp; /* Base address of stack */ int ss_flags; /* Flags */ size_t ss_size; /* Number of bytes in stack */ } stack_t; -.fi +.EE .in .PP To establish a new alternate signal stack, @@ -246,7 +246,7 @@ The following code segment demonstrates the use of .BR sigaltstack (): .PP .in +4n -.nf +.EX stack_t ss; ss.ss_sp = malloc(SIGSTKSZ); @@ -256,7 +256,7 @@ ss.ss_size = SIGSTKSZ; ss.ss_flags = 0; if (sigaltstack(&ss, NULL) == \-1) /* Handle error */; -.fi +.EE .in .SH BUGS In the lead up to the development of the Linux 2.4 kernel, diff --git a/man2/signal.2 b/man2/signal.2 index d03bbfd65..b384cbdd2 100644 --- a/man2/signal.2 +++ b/man2/signal.2 @@ -165,9 +165,9 @@ Without use of such a type, the declaration of is the somewhat harder to read: .PP .in +4n -.nf +.EX .BI "void ( *" signal "(int " signum ", void (*" handler ")(int)) ) (int);" -.fi +.EE .in .SS Portability The only portable use of diff --git a/man2/sigwaitinfo.2 b/man2/sigwaitinfo.2 index 811cb6803..229040642 100644 --- a/man2/sigwaitinfo.2 +++ b/man2/sigwaitinfo.2 @@ -88,12 +88,12 @@ may overrun by a small amount.) This argument is of the following type: .PP .in +4n -.nf +.EX struct timespec { long tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ } -.fi +.EE .in .PP If both fields of this structure are specified as 0, a poll is performed: diff --git a/man2/stat.2 b/man2/stat.2 index 61cbc9d3a..8ce6f988d 100644 --- a/man2/stat.2 +++ b/man2/stat.2 @@ -136,7 +136,7 @@ All of these system calls return a structure, which contains the following fields: .PP .in +4n -.nf +.EX struct stat { dev_t st_dev; /* ID of device containing file */ ino_t st_ino; /* Inode number */ @@ -161,7 +161,7 @@ struct stat { #define st_mtime st_mtim.tv_sec #define st_ctime st_ctim.tv_sec }; -.fi +.EE .in .PP .IR Note : diff --git a/man2/statfs.2 b/man2/statfs.2 index c50ea0284..6af9731e8 100644 --- a/man2/statfs.2 +++ b/man2/statfs.2 @@ -46,7 +46,7 @@ is a pointer to a structure defined approximately as follows: .PP .in +4n -.nf +.EX struct statfs { __fsword_t f_type; /* Type of filesystem (see below) */ __fsword_t f_bsize; /* Optimal transfer block size */ @@ -150,7 +150,7 @@ Filesystem types: XENIX_SUPER_MAGIC 0x012ff7b4 XFS_SUPER_MAGIC 0x58465342 _XIAFS_SUPER_MAGIC 0x012fd16d -.fi +.EE .in .PP Most of these MAGIC constants are defined in diff --git a/man2/statx.2 b/man2/statx.2 index a53c73ed6..026d70a32 100644 --- a/man2/statx.2 +++ b/man2/statx.2 @@ -54,7 +54,7 @@ pointed to by The returned buffer is a structure of the following type: .PP .in +4n -.nf +.EX struct statx { __u32 stx_mask; /* Mask of bits indicating filled fields */ @@ -87,18 +87,18 @@ struct statx { __u32 stx_dev_major; /* Major ID */ __u32 stx_dev_minor; /* Minor ID */ }; -.fi +.EE .in .PP The file timestamps are structures of the following type: .PP .in +4n -.nf +.EX struct statx_timestamp { __s64 tv_sec; /* Seconds since the Epoch (UNIX time) */ __u32 tv_nsec; /* Nanoseconds since tv_sec */ }; -.fi +.EE .in .PP (Note that reserved space and padding is omitted.) diff --git a/man2/sync_file_range.2 b/man2/sync_file_range.2 index c0a6c920a..628d723bd 100644 --- a/man2/sync_file_range.2 +++ b/man2/sync_file_range.2 @@ -197,10 +197,10 @@ Therefore, these architectures define a different system call that orders the arguments suitably: .PP .in +4n -.nf +.EX .BI "int sync_file_range2(int " fd ", unsigned int " flags , .BI " off64_t " offset ", off64_t " nbytes ); -.fi +.EE .in .PP The behavior of this system call is otherwise exactly the same as diff --git a/man2/syscall.2 b/man2/syscall.2 index 5dffc1fdf..a0cb96774 100644 --- a/man2/syscall.2 +++ b/man2/syscall.2 @@ -106,12 +106,12 @@ system call would be invoked as follows on the ARM architecture with the EABI in little endian mode: .PP .in +4n -.nf +.EX syscall(SYS_readahead, fd, 0, (unsigned int) (offset & 0xFFFFFFFF), (unsigned int) (offset >> 32), count); -.fi +.EE .in .PP Since the offset argument is 64 bits, and the first argument diff --git a/man2/sysctl.2 b/man2/sysctl.2 index 5624a6ac1..cc27b55aa 100644 --- a/man2/sysctl.2 +++ b/man2/sysctl.2 @@ -53,7 +53,7 @@ or the maximum number of open files. The argument has the form .PP .in +4n -.nf +.EX struct __sysctl_args { int *name; /* integer vector describing variable */ int nlen; /* length of this vector */ @@ -63,7 +63,7 @@ struct __sysctl_args { void *newval; /* 0 or address of new value */ size_t newlen; /* size of new value */ }; -.fi +.EE .in .PP This call does a search in a tree structure, possibly resembling diff --git a/man2/sysinfo.2 b/man2/sysinfo.2 index 611470333..1ad27c503 100644 --- a/man2/sysinfo.2 +++ b/man2/sysinfo.2 @@ -49,7 +49,7 @@ Until Linux 2.3.16, returned information in the following structure: .PP .in +4n -.nf +.EX struct sysinfo { long uptime; /* Seconds since boot */ unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ @@ -62,7 +62,7 @@ struct sysinfo { unsigned short procs; /* Number of current processes */ char _f[22]; /* Pads structure to 64 bytes */ }; -.fi +.EE .in .PP In the above structure, the sizes of the memory and swap fields @@ -72,7 +72,7 @@ Since Linux 2.3.23 (i386) and Linux 2.3.48 (all architectures) the structure is: .PP .in +4n -.nf +.EX struct sysinfo { long uptime; /* Seconds since boot */ unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ @@ -89,7 +89,7 @@ struct sysinfo { char _f[20\-2*sizeof(long)\-sizeof(int)]; /* Padding to 64 bytes */ }; -.fi +.EE .in .PP In the above structure, diff --git a/man2/tee.2 b/man2/tee.2 index c8780759e..9e10455b9 100644 --- a/man2/tee.2 +++ b/man2/tee.2 @@ -140,12 +140,12 @@ system call. Here is an example of its use: .PP .in +4n -.nf +.EX $ \fBdate |./a.out out.log | cat\fP Tue Oct 28 10:06:00 CET 2014 $ \fBcat out.log\fP Tue Oct 28 10:06:00 CET 2014 -.fi +.EE .in .SS Program source .EX diff --git a/man2/timer_create.2 b/man2/timer_create.2 index b1535aac5..a12f1116b 100644 --- a/man2/timer_create.2 +++ b/man2/timer_create.2 @@ -343,7 +343,7 @@ Unblocking signal 34 Caught signal 34 sival_ptr = 0xbfb174f4; *sival_ptr = 0x804c008 overrun count = 10004886 -.fi +.EE .in .SS Program source \& diff --git a/man2/timer_settime.2 b/man2/timer_settime.2 index 00100c25b..b12d6df61 100644 --- a/man2/timer_settime.2 +++ b/man2/timer_settime.2 @@ -62,7 +62,7 @@ The structure is defined as follows: .PP .in +4n -.nf +.EX struct timespec { time_t tv_sec; /* Seconds */ long tv_nsec; /* Nanoseconds */ @@ -72,7 +72,7 @@ struct itimerspec { struct timespec it_interval; /* Timer interval */ struct timespec it_value; /* Initial expiration */ }; -.fi +.EE .in .PP Each of the substructures of the diff --git a/man2/timerfd_create.2 b/man2/timerfd_create.2 index 785c7449f..f3b981f2d 100644 --- a/man2/timerfd_create.2 +++ b/man2/timerfd_create.2 @@ -164,7 +164,7 @@ struct itimerspec { struct timespec it_interval; /* Interval for periodic timer */ struct timespec it_value; /* Initial expiration */ }; -.fi +.EE .in .PP .I new_value.it_value @@ -497,7 +497,7 @@ a.out 3 1 100 10.000: read: 1; total=8 11.000: read: 1; total=9 .BR "^C " " # type control-C to suspend the program" -.fi +.EE .in .SS Program source \& diff --git a/man2/unshare.2 b/man2/unshare.2 index 515560255..8bf6487e9 100644 --- a/man2/unshare.2 +++ b/man2/unshare.2 @@ -411,7 +411,7 @@ $ \fBsudo ./unshare -m /bin/bash\fP [sudo] password for cecilia: # \fBreadlink /proc/$$/ns/mnt\fP mnt:[4026532325] -.fi +.EE .in .PP The differing output of the two diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2 index 253460fbb..4e2f659be 100644 --- a/man2/userfaultfd.2 +++ b/man2/userfaultfd.2 @@ -196,7 +196,7 @@ structures, each of which describes a page-fault event or an event required for the non-cooperative userfaultfd usage: .PP .in +4n -.nf +.EX struct uffd_msg { __u8 event; /* Type of event */ ... @@ -226,7 +226,7 @@ struct uffd_msg { /* Padding fields omitted */ } __packed; -.fi +.EE .in .PP If multiple events are available and the supplied buffer is large enough, @@ -482,7 +482,7 @@ operation. The following is an example of what we see when running the program: .PP .in +4n -.nf +.EX $ \fB./userfaultfd_demo 3\fP Address returned by mmap() = 0x7fd30106c000 @@ -512,7 +512,7 @@ Read address 0x7fd30106e00f in main(): C Read address 0x7fd30106e40f in main(): C Read address 0x7fd30106e80f in main(): C Read address 0x7fd30106ec0f in main(): C -.fi +.EE .in .SS Program source \& diff --git a/man2/ustat.2 b/man2/ustat.2 index fdd09c1e5..485e153ff 100644 --- a/man2/ustat.2 +++ b/man2/ustat.2 @@ -58,7 +58,7 @@ daddr_t f_tfree; /* Total free blocks */ ino_t f_tinode; /* Number of free inodes */ char f_fname[6]; /* Filsys name */ char f_fpack[6]; /* Filsys pack name */ -.fi +.EE .in .PP The last two fields, diff --git a/man2/utime.2 b/man2/utime.2 index d07dd6d23..d2536baa6 100644 --- a/man2/utime.2 +++ b/man2/utime.2 @@ -76,12 +76,12 @@ The structure is: .PP .in +4n -.nf +.EX struct utimbuf { time_t actime; /* access time */ time_t modtime; /* modification time */ }; -.fi +.EE .in .PP The @@ -103,12 +103,12 @@ The structure is: .PP .in +4n -.nf +.EX struct timeval { long tv_sec; /* seconds */ long tv_usec; /* microseconds */ }; -.fi +.EE .in .PP .IR times [0] diff --git a/man2/utimensat.2 b/man2/utimensat.2 index 5d2a317fa..663d1ee72 100644 --- a/man2/utimensat.2 +++ b/man2/utimensat.2 @@ -105,7 +105,7 @@ struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; -.fi +.EE .in .PP Updated file timestamps are set to the greatest value diff --git a/man2/vmsplice.2 b/man2/vmsplice.2 index 6c23a92e3..03156ac2f 100644 --- a/man2/vmsplice.2 +++ b/man2/vmsplice.2 @@ -63,12 +63,12 @@ structures as defined in .IR : .PP .in +4n -.nf +.EX struct iovec { void *iov_base; /* Starting address */ size_t iov_len; /* Number of bytes */ }; -.fi +.EE .in .PP The diff --git a/man2/wait.2 b/man2/wait.2 index cb940967b..69b0c47fc 100644 --- a/man2/wait.2 +++ b/man2/wait.2 @@ -615,7 +615,7 @@ continued killed by signal 15 [1]+ Done ./a.out $ -.fi +.EE .in .SS Program source \& diff --git a/man3/adjtime.3 b/man3/adjtime.3 index 89918faa7..225f78def 100644 --- a/man3/adjtime.3 +++ b/man3/adjtime.3 @@ -58,7 +58,7 @@ struct timeval { time_t tv_sec; /* seconds */ suseconds_t tv_usec; /* microseconds */ }; -.fi +.EE .in .PP If the adjustment in diff --git a/man3/aio_init.3 b/man3/aio_init.3 index a5cdcc10b..c69f06de7 100644 --- a/man3/aio_init.3 +++ b/man3/aio_init.3 @@ -48,7 +48,7 @@ The tuning information is provided in the buffer pointed to by the argument This buffer is a structure of the following form: .PP .in +4n -.nf +.EX struct aioinit { int aio_threads; /* Maximum number of threads */ int aio_num; /* Number of expected simultaneous @@ -61,7 +61,7 @@ struct aioinit { terminates (since glibc 2.2) */ int aio_reserved; }; -.fi +.EE .in .PP The following fields are used in the diff --git a/man3/backtrace.3 b/man3/backtrace.3 index f96edb7c1..e33661526 100644 --- a/man3/backtrace.3 +++ b/man3/backtrace.3 @@ -201,7 +201,7 @@ backtrace() returned 8 addresses \&./prog(main+0x65) [0x80488fb] \&/lib/libc.so.6(__libc_start_main+0xdc) [0xb7e38f9c] \&./prog [0x8048711] -.fi +.EE .in .SS Program source \& diff --git a/man3/basename.3 b/man3/basename.3 index d7167963a..388699a66 100644 --- a/man3/basename.3 +++ b/man3/basename.3 @@ -180,7 +180,7 @@ did not correctly handle pathnames with trailing \(aq/\(aq characters, and generated a segfault if given a NULL argument. .SH EXAMPLE .in +4n -.nf +.EX char *dirc, *basec, *bname, *dname; char *path = "/etc/passwd"; @@ -189,7 +189,7 @@ basec = strdup(path); dname = dirname(dirc); bname = basename(basec); printf("dirname=%s, basename=%s\\n", dname, bname); -.fi +.EE .in .SH SEE ALSO .BR basename (1), diff --git a/man3/bswap.3 b/man3/bswap.3 index ae06eb430..26d6b90d7 100644 --- a/man3/bswap.3 +++ b/man3/bswap.3 @@ -48,10 +48,10 @@ its command-line argument. The following shell session demonstrates the use of the program: .PP .in +4n -.nf +.EX $ \fB./a.out 0x0123456789abcdef\fP 0x123456789abcdef ==> 0xefcdab8967452301 -.fi +.EE .in .SS Program source \& diff --git a/man3/btree.3 b/man3/btree.3 index 8984f8b70..47729d9c6 100644 --- a/man3/btree.3 +++ b/man3/btree.3 @@ -81,7 +81,7 @@ typedef struct { size_t (*prefix)(const DBT *key1, const DBT *key2); int lorder; } BTREEINFO; -.fi +.EE .in .PP The elements of this structure are as follows: diff --git a/man3/clock_getcpuclockid.3 b/man3/clock_getcpuclockid.3 index cc77f3c6c..25a56e4b1 100644 --- a/man3/clock_getcpuclockid.3 +++ b/man3/clock_getcpuclockid.3 @@ -121,7 +121,7 @@ An example run is the following: .EX .RB "$" " ./a.out 1" " # Show CPU clock of init process" CPU-time clock for PID 1 is 2.213466748 seconds -.fi +.EE .in .SS Program source \& diff --git a/man3/cmsg.3 b/man3/cmsg.3 index 060b96fd8..d7c96a7fb 100644 --- a/man3/cmsg.3 +++ b/man3/cmsg.3 @@ -166,7 +166,7 @@ This code looks for the option in a received ancillary buffer: .PP .in +4n -.nf +.EX struct msghdr msgh; struct cmsghdr *cmsg; int *ttlptr; @@ -187,7 +187,7 @@ for (cmsg = CMSG_FIRSTHDR(&msgh); cmsg != NULL; if (cmsg == NULL) { /* Error: IP_TTL not enabled or small buffer or I/O error */ } -.fi +.EE .in .PP The code below passes an array of file descriptors over a @@ -195,7 +195,7 @@ UNIX domain socket using .BR SCM_RIGHTS : .PP .in +4n -.nf +.EX struct msghdr msg = { 0 }; struct cmsghdr *cmsg; int myfds[NUM_FD]; /* Contains the file descriptors to pass */ @@ -221,7 +221,7 @@ cmsg\->cmsg_type = SCM_RIGHTS; cmsg\->cmsg_len = CMSG_LEN(sizeof(int) * NUM_FD); fdptr = (int *) CMSG_DATA(cmsg); /* Initialize the payload */ memcpy(fdptr, myfds, NUM_FD * sizeof(int)); -.fi +.EE .in .SH SEE ALSO .BR recvmsg (2), diff --git a/man3/confstr.3 b/man3/confstr.3 index 797dfcb03..26c4b4b33 100644 --- a/man3/confstr.3 +++ b/man3/confstr.3 @@ -155,7 +155,7 @@ pathbuf = malloc(n); if (pathbuf == NULL) abort(); confstr(_CS_PATH, pathbuf, n); -.fi +.EE .in .SH SEE ALSO .BR getconf (1), diff --git a/man3/dbopen.3 b/man3/dbopen.3 index 98efbaf38..6863a0392 100644 --- a/man3/dbopen.3 +++ b/man3/dbopen.3 @@ -153,7 +153,7 @@ include file, and contains at least the following fields: .PP .in +4n -.nf +.EX typedef struct { DBTYPE type; int (*close)(const DB *db); @@ -167,7 +167,7 @@ typedef struct { int (*seq)(const DB *db, DBT *key, DBT *data, unsigned int flags); } DB; -.fi +.EE .in .PP These elements describe a database type and a set of functions performing @@ -460,7 +460,7 @@ typedef struct { void *data; size_t size; } DBT; -.fi +.EE .in .PP The elements of the diff --git a/man3/dl_iterate_phdr.3 b/man3/dl_iterate_phdr.3 index 8e8fcfe7b..3c7e48b3e 100644 --- a/man3/dl_iterate_phdr.3 +++ b/man3/dl_iterate_phdr.3 @@ -74,7 +74,7 @@ The argument is a structure of the following type: .PP .in +4n -.nf +.EX struct dl_phdr_info { ElfW(Addr) dlpi_addr; /* Base address of object */ const char *dlpi_name; /* (Null-terminated) name of @@ -104,7 +104,7 @@ struct dl_phdr_info { one and it has been allocated in the calling thread, otherwise a null pointer */ }; -.fi +.EE .in .PP (The @@ -159,7 +159,7 @@ typedef struct { Elf32_Word p_flags; /* Segment flags */ Elf32_Word p_align; /* Segment alignment */ } Elf32_Phdr; -.fi +.EE .in .PP Note that we can calculate the location of a particular program header, @@ -177,7 +177,7 @@ include the following (see for further details): .PP .in +4n -.nf +.EX #define PT_LOAD 1 /* Loadable program segment */ #define PT_DYNAMIC 2 /* Dynamic linking information */ #define PT_INTERP 3 /* Program interpreter */ @@ -189,7 +189,7 @@ for further details): #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */ .\" For PT_GNU_STACK, see http://www.airs.com/blog/archives/518 #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ -.fi +.EE .in .SH RETURN VALUE The @@ -254,7 +254,7 @@ The first shared object for which output is displayed (where the name is an empty string) is the main program. .in +4n -.nf +.EX $ \fB./a.out\fP Name: "" (9 segments) 0: [ 0x400040; memsz: 1f8] flags: 0x5; PT_PHDR @@ -290,7 +290,7 @@ Name: "/lib64/ld-linux-x86-64.so.2" (7 segments) 4: [0x7f55716acec4; memsz: 604] flags: 0x4; PT_GNU_EH_FRAME 5: [0x7f557168f000; memsz: 0] flags: 0x6; PT_GNU_STACK 6: [0x7f55718afba0; memsz: 460] flags: 0x4; PT_GNU_RELRO -.fi +.EE .in .PP .SS Program source diff --git a/man3/dladdr.3 b/man3/dladdr.3 index 284a3af45..44634dd94 100644 --- a/man3/dladdr.3 +++ b/man3/dladdr.3 @@ -54,7 +54,7 @@ This information is returned in a structure: .PP .in +4n -.nf +.EX typedef struct { const char *dli_fname; /* Pathname of shared object that contains address */ @@ -65,7 +65,7 @@ typedef struct { void *dli_saddr; /* Exact address of symbol named in \fIdli_sname\fP */ } Dl_info; -.fi +.EE .in .PP If no symbol matching @@ -99,7 +99,7 @@ defined in as: .IP .in +4n -.nf +.EX struct link_map { ElfW(Addr) l_addr; /* Difference between the address in the ELF file and @@ -114,7 +114,7 @@ struct link_map { /* Plus additional fields private to the implementation */ }; -.fi +.EE .in .TP .B RTLD_DL_SYMENT @@ -136,7 +136,7 @@ which is defined in as: .IP .in +4n -.nf +.EX typedef struct { Elf64_Word st_name; /* Symbol name */ unsigned char st_info; /* Symbol type and binding */ @@ -145,7 +145,7 @@ typedef struct { Elf64_Addr st_value; /* Symbol value */ Elf64_Xword st_size; /* Symbol size */ } Elf64_Sym; -.fi +.EE .in .IP The diff --git a/man3/dlinfo.3 b/man3/dlinfo.3 index 0b30dee9d..521bf50e8 100644 --- a/man3/dlinfo.3 +++ b/man3/dlinfo.3 @@ -80,7 +80,7 @@ structure, defined in as: .IP .in +4n -.nf +.EX struct link_map { ElfW(Addr) l_addr; /* Difference between the address in the ELF file and @@ -95,7 +95,7 @@ struct link_map { /* Plus additional fields private to the implementation */ }; -.fi +.EE .in .TP .BR RTLD_DI_ORIGIN " (\fIchar *\fP)" @@ -156,7 +156,7 @@ The structure is defined as follows: .IP .in +4n -.nf +.EX typedef struct { size_t dls_size; /* Size in bytes of the whole buffer */ @@ -173,14 +173,14 @@ Each of the elements in the above structure is a structure of the following form: .IP .in +4n -.nf +.EX typedef struct { char *dls_name; /* Name of library search path directory */ unsigned int dls_flags; /* Indicates where this directory came from */ } Dl_serpath; -.fi +.EE .in .IP The @@ -252,11 +252,11 @@ requests to obtain the library search path list for the library. Here is an example of what we might see when running the program: .PP .in +4n -.nf +.EX $ \fB./a.out /lib64/libm.so.6\fP dls_serpath[0].dls_name = /lib64 dls_serpath[1].dls_name = /usr/lib64 -.fi +.EE .in .SS Program source \& diff --git a/man3/dlopen.3 b/man3/dlopen.3 index 04a9c427d..1f2baf6e3 100644 --- a/man3/dlopen.3 +++ b/man3/dlopen.3 @@ -521,11 +521,11 @@ function, and prints the cosine of 2.0. The following is an example of building and running the program: .PP .in +4n -.nf +.EX $ \fBcc dlopen_demo.c \-ldl\fP $ \fB./a.out\fP \-0.416147 -.fi +.EE .in .SS Program source .EX diff --git a/man3/duplocale.3 b/man3/duplocale.3 index 45d90e296..8cc87ad97 100644 --- a/man3/duplocale.3 +++ b/man3/duplocale.3 @@ -131,7 +131,7 @@ An example of its use is the following: .EX $ \fB./a.out abc\fP ABC -.fi +.EE .in .SS Program source .EX diff --git a/man3/encrypt.3 b/man3/encrypt.3 index 433102c0a..4703c6499 100644 --- a/man3/encrypt.3 +++ b/man3/encrypt.3 @@ -102,7 +102,7 @@ struct crypt_data { int direction; int initialized; }; -.fi +.EE .in .PP Before calling diff --git a/man3/end.3 b/man3/end.3 index 6e578e4d4..c70ed0dd7 100644 --- a/man3/end.3 +++ b/man3/end.3 @@ -83,7 +83,7 @@ First address past: program text (etext) 0x8048568 initialized data (edata) 0x804a01c uninitialized data (end) 0x804a024 -.fi +.EE .in .SS Program source \& diff --git a/man3/endian.3 b/man3/endian.3 index 054f286e7..082d1bc4b 100644 --- a/man3/endian.3 +++ b/man3/endian.3 @@ -141,7 +141,7 @@ $ \fB./a.out\fP x.u32 = 0x44332211 htole32(x.u32) = 0x44332211 htobe32(x.u32) = 0x11223344 -.fi +.EE .in .SS Program source \& diff --git a/man3/err.3 b/man3/err.3 index 4e297bfe0..c306b897e 100644 --- a/man3/err.3 +++ b/man3/err.3 @@ -151,7 +151,7 @@ if (p == NULL) fd = open(file_name, O_RDONLY, 0); if (fd == \-1) err(1, "%s", file_name); -.fi +.EE .in .PP Display an error message and exit: @@ -160,7 +160,7 @@ Display an error message and exit: .EX if (tm.tm_hour < START_TIME) errx(1, "too early, wait until %s", start_time_string); -.fi +.EE .in .PP Warn of an error: @@ -174,7 +174,7 @@ if (fd == \-1) fd = open(block_device, O_RDONLY, 0); if (fd == \-1) err(1, "%s", block_device); -.fi +.EE .in .SH SEE ALSO .BR error (3), diff --git a/man3/errno.3 b/man3/errno.3 index 95cb55abb..0799b658a 100644 --- a/man3/errno.3 +++ b/man3/errno.3 @@ -535,7 +535,7 @@ if (somecall() == \-1) { printf("somecall() failed\en"); if (errsv == ...) { ... } } -.fi +.EE .in .PP It was common in traditional C to declare diff --git a/man3/ether_aton.3 b/man3/ether_aton.3 index 5d43e9ae2..ab0cee50d 100644 --- a/man3/ether_aton.3 +++ b/man3/ether_aton.3 @@ -118,11 +118,11 @@ is defined in as: .PP .in +4n -.nf +.EX struct ether_addr { uint8_t ether_addr_octet[6]; } -.fi +.EE .in .SH ATTRIBUTES For an explanation of the terms used in this section, see diff --git a/man3/fgetgrent.3 b/man3/fgetgrent.3 index ca3104a72..f2468d570 100644 --- a/man3/fgetgrent.3 +++ b/man3/fgetgrent.3 @@ -67,7 +67,7 @@ must have the same format as The \fIgroup\fP structure is defined in \fI\fP as follows: .PP .in +4n -.nf +.EX struct group { char *gr_name; /* group name */ char *gr_passwd; /* group password */ @@ -75,7 +75,7 @@ struct group { char **gr_mem; /* NULL-terminated array of pointers to names of group members */ }; -.fi +.EE .in .SH RETURN VALUE The diff --git a/man3/fgetpwent.3 b/man3/fgetpwent.3 index cfeb8c1fc..0f0f4c05b 100644 --- a/man3/fgetpwent.3 +++ b/man3/fgetpwent.3 @@ -69,7 +69,7 @@ must have the same format as The \fIpasswd\fP structure is defined in \fI\fP as follows: .PP .in +4n -.nf +.EX struct passwd { char *pw_name; /* username */ char *pw_passwd; /* user password */ @@ -79,7 +79,7 @@ struct passwd { char *pw_dir; /* home directory */ char *pw_shell; /* shell program */ }; -.fi +.EE .in .SH RETURN VALUE The diff --git a/man3/fmemopen.3 b/man3/fmemopen.3 index 60fa7eaa5..c8c16765d 100644 --- a/man3/fmemopen.3 +++ b/man3/fmemopen.3 @@ -293,7 +293,7 @@ An example of the output produced by this program is the following: .EX .RB "$" " ./a.out \(aq1 23 43\(aq" size=11; ptr=1 529 1849 -.fi +.EE .in .SS Program source \& diff --git a/man3/frexp.3 b/man3/frexp.3 index 4caf5f03f..c9b3c3844 100644 --- a/man3/frexp.3 +++ b/man3/frexp.3 @@ -124,12 +124,12 @@ SVr4, 4.3BSD, C89. The program below produces results such as the following: .PP .in +4n -.nf +.EX .RB "$" " ./a.out 2560" frexp(2560, &e) = 0.625: 0.625 * 2^12 = 2560 .RB "$" " ./a.out \-4" frexp(\-4, &e) = \-0.5: \-0.5 * 2^3 = \-4 -.fi +.EE .in .SS Program source \& diff --git a/man3/ftime.3 b/man3/ftime.3 index 9977b308c..56dca01a6 100644 --- a/man3/ftime.3 +++ b/man3/ftime.3 @@ -42,14 +42,14 @@ The time is returned in which is declared as follows: .PP .in +4n -.nf +.EX struct timeb { time_t time; unsigned short millitm; short timezone; short dstflag; }; -.fi +.EE .in .PP Here \fItime\fP is the number of seconds since the Epoch, diff --git a/man3/fts.3 b/man3/fts.3 index 77db132c0..ec4a2c608 100644 --- a/man3/fts.3 +++ b/man3/fts.3 @@ -136,7 +136,7 @@ typedef struct _ftsent { .\" u_short fts_flags; /* private flags for FTSENT structure */ .\" u_short fts_instr; /* fts_set() instructions */ } FTSENT; -.fi +.EE .in .PP These fields are defined as follows: diff --git a/man3/getaddrinfo.3 b/man3/getaddrinfo.3 index 8a88a5a78..7171c8e96 100644 --- a/man3/getaddrinfo.3 +++ b/man3/getaddrinfo.3 @@ -105,7 +105,7 @@ structure used by contains the following fields: .PP .in +4n -.nf +.EX struct addrinfo { int ai_flags; int ai_family; @@ -116,7 +116,7 @@ struct addrinfo { char *ai_canonname; struct addrinfo *ai_next; }; -.fi +.EE .in .PP The diff --git a/man3/getaddrinfo_a.3 b/man3/getaddrinfo_a.3 index 210e474e3..f926c1e07 100644 --- a/man3/getaddrinfo_a.3 +++ b/man3/getaddrinfo_a.3 @@ -88,14 +88,14 @@ Each request is described by a structure, defined as follows: .PP .in +4n -.nf +.EX struct gaicb { const char *ar_name; const char *ar_service; const struct addrinfo *ar_request; struct addrinfo *ar_result; }; -.fi +.EE .in .PP The elements of this structure correspond to the arguments of @@ -344,7 +344,7 @@ $ \fB./a.out ftp.us.kernel.org enoent.linuxfoundation.org gnu.cz\fP ftp.us.kernel.org: 128.30.2.36 enoent.linuxfoundation.org: Name or service not known gnu.cz: 87.236.197.13 -.fi +.EE .in .PP Here is the program source code @@ -433,7 +433,7 @@ $ \fB./a.out\fP [00] ftp.us.kernel.org: 216.165.129.139 [01] enoent.linuxfoundation.org: Name or service not known [02] gnu.cz: 87.236.197.13 -.fi +.EE .in .PP The program source is as follows: diff --git a/man3/getdate.3 b/man3/getdate.3 index 370b9150f..fc04ad904 100644 --- a/man3/getdate.3 +++ b/man3/getdate.3 @@ -237,7 +237,7 @@ structure. The following shell session demonstrates the operation of the program: .PP .in +4n -.nf +.EX .RB "$" " TFILE=$PWD/tfile" .RB "$" " echo \(aq%A\(aq > $TFILE " " # Full name of the day of the week" .RB "$" " echo \(aq%T\(aq >> $TFILE" " # ISO date (YYYY-MM-DD)" @@ -276,7 +276,7 @@ Call 3 ("12:22:33") succeeded: tm_wday = 0 tm_yday = 250 tm_isdst = 1 -.fi +.EE .in .SS Program source \& diff --git a/man3/getfsent.3 b/man3/getfsent.3 index 55eb2d85d..1214ab016 100644 --- a/man3/getfsent.3 +++ b/man3/getfsent.3 @@ -47,7 +47,7 @@ The is defined by: .PP .in +4n -.nf +.EX struct fstab { char *fs_spec; /* block device name */ char *fs_file; /* mount point */ @@ -57,7 +57,7 @@ struct fstab { int fs_freq; /* dump frequency, in days */ int fs_passno; /* pass number on parallel dump */ }; -.fi +.EE .in .PP Here the field diff --git a/man3/getgrent.3 b/man3/getgrent.3 index 2b17b0690..f34a7e846 100644 --- a/man3/getgrent.3 +++ b/man3/getgrent.3 @@ -99,7 +99,7 @@ after all processing has been performed. The \fIgroup\fP structure is defined in \fI\fP as follows: .PP .in +4n -.nf +.EX struct group { char *gr_name; /* group name */ char *gr_passwd; /* group password */ @@ -107,7 +107,7 @@ struct group { char **gr_mem; /* NULL-terminated array of pointers to names of group members */ }; -.fi +.EE .in .PP For more information about the fields of this structure, see diff --git a/man3/getgrent_r.3 b/man3/getgrent_r.3 index 2511a957e..9a8c782dc 100644 --- a/man3/getgrent_r.3 +++ b/man3/getgrent_r.3 @@ -70,7 +70,7 @@ The \fIgroup\fP structure is defined in as follows: .PP .in +4n -.nf +.EX struct group { char *gr_name; /* group name */ char *gr_passwd; /* group password */ @@ -78,7 +78,7 @@ struct group { char **gr_mem; /* NULL-terminated array of pointers to names of group members */ }; -.fi +.EE .in .PP For more information about the fields of this structure, see @@ -152,19 +152,19 @@ the POSIX version of functions like Other systems use the prototype .PP .in +4n -.nf +.EX struct group *getgrent_r(struct group *grp, char *buf, int buflen); -.fi +.EE .in .PP or, better, .PP .in +4n -.nf +.EX int getgrent_r(struct group *grp, char *buf, int buflen, FILE **gr_fp); -.fi +.EE .in .SH NOTES The function diff --git a/man3/getgrnam.3 b/man3/getgrnam.3 index 156c13777..65cd149e6 100644 --- a/man3/getgrnam.3 +++ b/man3/getgrnam.3 @@ -85,7 +85,7 @@ that matches the group ID The \fIgroup\fP structure is defined in \fI\fP as follows: .PP .in +4n -.nf +.EX struct group { char *gr_name; /* group name */ char *gr_passwd; /* group password */ @@ -93,7 +93,7 @@ struct group { char **gr_mem; /* NULL-terminated array of pointers to names of group members */ }; -.fi +.EE .in .PP For more information about the fields of this structure, see diff --git a/man3/getgrouplist.3 b/man3/getgrouplist.3 index 5bc079c5b..000c3a871 100644 --- a/man3/getgrouplist.3 +++ b/man3/getgrouplist.3 @@ -140,7 +140,7 @@ ngroups = 3 16 (dialout) 33 (video) 100 (users) -.fi +.EE .in .SS Program source \& diff --git a/man3/gethostbyname.3 b/man3/gethostbyname.3 index 16a479a60..a5e89159e 100644 --- a/man3/gethostbyname.3 +++ b/man3/gethostbyname.3 @@ -260,7 +260,7 @@ keyword was used to control the order of host lookups as defined in The \fIhostent\fP structure is defined in \fI\fP as follows: .PP .in +4n -.nf +.EX struct hostent { char *h_name; /* official name of host */ char **h_aliases; /* alias list */ @@ -269,7 +269,7 @@ struct hostent { char **h_addr_list; /* list of addresses */ } #define h_addr h_addr_list[0] /* for backward compatibility */ -.fi +.EE .in .PP The members of the \fIhostent\fP structure are: diff --git a/man3/getifaddrs.3 b/man3/getifaddrs.3 index 7f91a1b05..11dde1476 100644 --- a/man3/getifaddrs.3 +++ b/man3/getifaddrs.3 @@ -57,7 +57,7 @@ The list consists of structures, defined as follows: .PP .in +4n -.nf +.EX struct ifaddrs { struct ifaddrs *ifa_next; /* Next item in list */ char *ifa_name; /* Name of interface */ @@ -74,7 +74,7 @@ struct ifaddrs { #define ifa_dstaddr ifa_ifu.ifu_dstaddr void *ifa_data; /* Address-specific data */ }; -.fi +.EE .in .PP The @@ -246,7 +246,7 @@ lo AF_INET6 (10) address: <::1> wlp3s0 AF_INET6 (10) address: -.fi +.EE .in .SS Program source \& diff --git a/man3/getipnodebyname.3 b/man3/getipnodebyname.3 index b07a7b389..5ac4c20f9 100644 --- a/man3/getipnodebyname.3 +++ b/man3/getipnodebyname.3 @@ -58,7 +58,7 @@ These functions return a pointer to the following structure: .PP .in +4n -.nf +.EX struct hostent { char *h_name; char **h_aliases; @@ -66,7 +66,7 @@ struct hostent { int h_length; char **h_addr_list; }; -.fi +.EE .in .PP These functions replace the diff --git a/man3/getmntent.3 b/man3/getmntent.3 index 945d36457..cbda1ee56 100644 --- a/man3/getmntent.3 +++ b/man3/getmntent.3 @@ -151,7 +151,7 @@ structure is defined in as follows: .PP .in +4n -.nf +.EX struct mntent { char *mnt_fsname; /* name of mounted filesystem */ char *mnt_dir; /* filesystem path prefix */ @@ -160,7 +160,7 @@ struct mntent { int mnt_freq; /* dump frequency in days */ int mnt_passno; /* pass number on parallel fsck */ }; -.fi +.EE .in .PP Since fields in the mtab and fstab files are separated by whitespace, diff --git a/man3/getnameinfo.3 b/man3/getnameinfo.3 index 66ec1c3d5..b8bd5f379 100644 --- a/man3/getnameinfo.3 +++ b/man3/getnameinfo.3 @@ -230,7 +230,7 @@ defines the constants .EX #define NI_MAXHOST 1025 #define NI_MAXSERV 32 -.fi +.EE .in .PP Since glibc 2.8, @@ -265,7 +265,7 @@ Note that there is no hardcoded reference to a particular address family. .PP .in +4n -.nf +.EX struct sockaddr *addr; /* input */ socklen_t addrlen; /* input */ char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; @@ -273,14 +273,14 @@ char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; if (getnameinfo(addr, addrlen, hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV) == 0) printf("host=%s, serv=%s\en", hbuf, sbuf); -.fi +.EE .in .PP The following version checks if the socket address has a reverse address mapping. .PP .in +4n -.nf +.EX struct sockaddr *addr; /* input */ socklen_t addrlen; /* input */ char hbuf[NI_MAXHOST]; @@ -290,7 +290,7 @@ if (getnameinfo(addr, addrlen, hbuf, sizeof(hbuf), printf("could not resolve hostname"); else printf("host=%s\en", hbuf); -.fi +.EE .in .PP An example program using diff --git a/man3/getnetent.3 b/man3/getnetent.3 index 6e7af6b0d..9410d9ac3 100644 --- a/man3/getnetent.3 +++ b/man3/getnetent.3 @@ -101,14 +101,14 @@ structure is defined in as follows: .PP .in +4n -.nf +.EX struct netent { char *n_name; /* official network name */ char **n_aliases; /* alias list */ int n_addrtype; /* net address type */ uint32_t n_net; /* network number */ } -.fi +.EE .in .PP The members of the diff --git a/man3/getopt.3 b/man3/getopt.3 index fe05756b2..cfc023d01 100644 --- a/man3/getopt.3 +++ b/man3/getopt.3 @@ -229,14 +229,14 @@ declared in as .PP .in +4n -.nf +.EX struct option { const char *name; int has_arg; int *flag; int val; }; -.fi +.EE .in .PP The meanings of the different fields are: diff --git a/man3/getprotoent.3 b/man3/getprotoent.3 index 5f1a06444..008728466 100644 --- a/man3/getprotoent.3 +++ b/man3/getprotoent.3 @@ -99,13 +99,13 @@ structure is defined in as follows: .PP .in +4n -.nf +.EX struct protoent { char *p_name; /* official protocol name */ char **p_aliases; /* alias list */ int p_proto; /* protocol number */ } -.fi +.EE .in .PP The members of the diff --git a/man3/getprotoent_r.3 b/man3/getprotoent_r.3 index c1a141c97..fa73b8b85 100644 --- a/man3/getprotoent_r.3 +++ b/man3/getprotoent_r.3 @@ -175,7 +175,7 @@ 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 +.EE .in .SS Program source \& diff --git a/man3/getpw.3 b/man3/getpw.3 index 94b51b2a3..e4a41c616 100644 --- a/man3/getpw.3 +++ b/man3/getpw.3 @@ -56,7 +56,7 @@ The returned buffer contains a line of format The \fIpasswd\fP structure is defined in \fI\fP as follows: .PP .in +4n -.nf +.EX struct passwd { char *pw_name; /* username */ char *pw_passwd; /* user password */ @@ -66,7 +66,7 @@ struct passwd { char *pw_dir; /* home directory */ char *pw_shell; /* shell program */ }; -.fi +.EE .in .PP For more information about the fields of this structure, see diff --git a/man3/getpwent.3 b/man3/getpwent.3 index dbf3f77e3..b5c655555 100644 --- a/man3/getpwent.3 +++ b/man3/getpwent.3 @@ -87,7 +87,7 @@ after all processing has been performed. The \fIpasswd\fP structure is defined in \fI\fP as follows: .PP .in +4n -.nf +.EX struct passwd { char *pw_name; /* username */ char *pw_passwd; /* user password */ @@ -97,7 +97,7 @@ struct passwd { char *pw_dir; /* home directory */ char *pw_shell; /* shell program */ }; -.fi +.EE .in .PP For more information about the fields of this structure, see diff --git a/man3/getpwent_r.3 b/man3/getpwent_r.3 index 362ece388..68d17f14a 100644 --- a/man3/getpwent_r.3 +++ b/man3/getpwent_r.3 @@ -70,7 +70,7 @@ The \fIpasswd\fP structure is defined in as follows: .PP .in +4n -.nf +.EX struct passwd { char *pw_name; /* username */ char *pw_passwd; /* user password */ @@ -80,7 +80,7 @@ struct passwd { char *pw_dir; /* home directory */ char *pw_shell; /* shell program */ }; -.fi +.EE .in .PP For more information about the fields of this structure, see @@ -154,20 +154,20 @@ the POSIX version of functions like Other systems use the prototype .PP .in +4n -.nf +.EX struct passwd * getpwent_r(struct passwd *pwd, char *buf, int buflen); -.fi +.EE .in .PP or, better, .PP .in +4n -.nf +.EX int getpwent_r(struct passwd *pwd, char *buf, int buflen, FILE **pw_fp); -.fi +.EE .in .SH NOTES The function diff --git a/man3/getpwnam.3 b/man3/getpwnam.3 index 9066f4688..c4b999f4e 100644 --- a/man3/getpwnam.3 +++ b/man3/getpwnam.3 @@ -87,7 +87,7 @@ that matches the user ID The \fIpasswd\fP structure is defined in \fI\fP as follows: .PP .in +4n -.nf +.EX struct passwd { char *pw_name; /* username */ char *pw_passwd; /* user password */ @@ -97,7 +97,7 @@ struct passwd { char *pw_dir; /* home directory */ char *pw_shell; /* shell program */ }; -.fi +.EE .in .PP See diff --git a/man3/getrpcent.3 b/man3/getrpcent.3 index dbfc70c05..95d598c7c 100644 --- a/man3/getrpcent.3 +++ b/man3/getrpcent.3 @@ -41,7 +41,7 @@ struct rpcent { char **r_aliases; /* alias list */ long r_number; /* RPC program number */ }; -.fi +.EE .in .PP The members of this structure are: diff --git a/man3/getservent.3 b/man3/getservent.3 index 0ca958b3e..563334e8e 100644 --- a/man3/getservent.3 +++ b/man3/getservent.3 @@ -114,14 +114,14 @@ structure is defined in as follows: .PP .in +4n -.nf +.EX struct servent { char *s_name; /* official service name */ char **s_aliases; /* alias list */ int s_port; /* port number */ char *s_proto; /* protocol to use */ } -.fi +.EE .in .PP The members of the diff --git a/man3/getservent_r.3 b/man3/getservent_r.3 index 60abeb060..8a05b9a9c 100644 --- a/man3/getservent_r.3 +++ b/man3/getservent_r.3 @@ -172,7 +172,7 @@ 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 +.EE .in .SS Program source \& diff --git a/man3/getspnam.3 b/man3/getspnam.3 index a08d019d8..9c8d37485 100644 --- a/man3/getspnam.3 +++ b/man3/getspnam.3 @@ -188,7 +188,7 @@ often with different prototypes. The shadow password structure is defined in \fI\fP as follows: .PP .in +4n -.nf +.EX struct spwd { char *sp_namp; /* Login name */ char *sp_pwdp; /* Encrypted password */ @@ -206,7 +206,7 @@ struct spwd { 1970-01-01 00:00:00 +0000 (UTC)) */ unsigned long sp_flag; /* Reserved */ }; -.fi +.EE .in .SH RETURN VALUE The functions that return a pointer return NULL if no more entries diff --git a/man3/getttyent.3 b/man3/getttyent.3 index 7bcf8c6ca..7bd269b78 100644 --- a/man3/getttyent.3 +++ b/man3/getttyent.3 @@ -58,7 +58,7 @@ struct ttyent { char *ty_window; /* command to start up window manager */ char *ty_comment; /* comment field */ }; -.fi +.EE .in .PP .I ty_status diff --git a/man3/glob.3 b/man3/glob.3 index 3144086ca..5b3510179 100644 --- a/man3/glob.3 +++ b/man3/glob.3 @@ -76,13 +76,13 @@ present as an extension): .PP .br .in +4n -.nf +.EX typedef struct { size_t gl_pathc; /* Count of paths matched so far */ char **gl_pathv; /* List of matched pathnames. */ size_t gl_offs; /* Slots to reserve in \fIgl_pathv\fP. */ } glob_t; -.fi +.EE .in .PP Results are stored in dynamically allocated storage. @@ -350,7 +350,7 @@ glob("../*.c", GLOB_DOOFFS | GLOB_APPEND, NULL, &globbuf); globbuf.gl_pathv[0] = "ls"; globbuf.gl_pathv[1] = "\-l"; execvp("ls", &globbuf.gl_pathv[0]); -.fi +.EE .in .SH SEE ALSO .BR ls (1), diff --git a/man3/gnu_get_libc_version.3 b/man3/gnu_get_libc_version.3 index 74dc8b1a5..fa7b97437 100644 --- a/man3/gnu_get_libc_version.3 +++ b/man3/gnu_get_libc_version.3 @@ -69,7 +69,7 @@ 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 +.EE .in .SS Program source \& diff --git a/man3/hash.3 b/man3/hash.3 index 7a068efc7..b1a6271c7 100644 --- a/man3/hash.3 +++ b/man3/hash.3 @@ -78,7 +78,7 @@ typedef struct { uint32_t (*hash)(const void *, size_t); int lorder; } HASHINFO; -.fi +.EE .in .PP The elements of this structure are as follows: diff --git a/man3/hsearch.3 b/man3/hsearch.3 index 878a15c40..128eccc5c 100644 --- a/man3/hsearch.3 +++ b/man3/hsearch.3 @@ -132,7 +132,7 @@ typedef struct entry { char *key; void *data; } ENTRY; -.fi +.EE .in .PP The field \fIkey\fP points to a null-terminated string which is the diff --git a/man3/if_nameindex.3 b/man3/if_nameindex.3 index cb194d9d2..9abafaaaa 100644 --- a/man3/if_nameindex.3 +++ b/man3/if_nameindex.3 @@ -126,12 +126,12 @@ on this page. An example of the output this program might produce is the following: .PP .in +4n -.nf +.EX $ \fB./a.out\fI 1: lo 2: wlan0 3: em1 -.fi +.EE .in .SS Program source .EX diff --git a/man3/inet.3 b/man3/inet.3 index 38872709d..6b0c88317 100644 --- a/man3/inet.3 +++ b/man3/inet.3 @@ -299,7 +299,7 @@ Here are some example runs: 226.0.0.31 .RB "$" " ./a.out 0x7f.1 " " # First byte is in hex" 127.0.0.1 -.fi +.EE .in .SS Program source \& diff --git a/man3/inet_net_pton.3 b/man3/inet_net_pton.3 index 396e1873d..0b3f8457b 100644 --- a/man3/inet_net_pton.3 +++ b/man3/inet_net_pton.3 @@ -278,12 +278,12 @@ An example run, showing that infers the number of bits in the network number: .PP .in +4n -.nf +.EX $ \fB./a.out 193.168\fP inet_net_pton() returned: 24 inet_net_ntop() yielded: 193.168.0/24 Raw address: c1a80000 -.fi +.EE .in .PP Demonstrate that @@ -291,12 +291,12 @@ Demonstrate that does not zero out unused bytes in its result buffer: .PP .in +4n -.nf +.EX $ \fB./a.out 193.168 0xffffffff\fP inet_net_pton() returned: 24 inet_net_ntop() yielded: 193.168.0/24 Raw address: c1a800ff -.fi +.EE .in .PP Demonstrate that @@ -306,12 +306,12 @@ if the supplied number of bytes in the presentation string exceeds the inferred value: .PP .in +4n -.nf +.EX $ \fB./a.out 193.168.1.128\fP inet_net_pton() returned: 32 inet_net_ntop() yielded: 193.168.1.128/32 Raw address: c1a80180 -.fi +.EE .in .PP Explicitly specifying the size of the network number overrides any @@ -321,12 +321,12 @@ inference about its size to populate the result buffer): .PP .in +4n -.nf +.EX $ \fB./a.out 193.168.1.128/24\fP inet_net_pton() returned: 24 inet_net_ntop() yielded: 193.168.1/24 Raw address: c1a80180 -.fi +.EE .in .SS Program source .EX diff --git a/man3/inet_pton.3 b/man3/inet_pton.3 index 5b13de82a..c1605402e 100644 --- a/man3/inet_pton.3 +++ b/man3/inet_pton.3 @@ -182,7 +182,7 @@ 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 +.EE .in .SS Program source \& diff --git a/man3/insque.3 b/man3/insque.3 index d8e7d5354..4978208b8 100644 --- a/man3/insque.3 +++ b/man3/insque.3 @@ -121,13 +121,13 @@ the arguments of these functions were of type \fIstruct qelem *\fP, defined as: .PP .in +4n -.nf +.EX struct qelem { struct qelem *q_forw; struct qelem *q_back; char q_data[1]; }; -.fi +.EE .in .PP This is still what you will get if @@ -161,7 +161,7 @@ Traversing completed list: b c That was a circular list -.fi +.EE .in .SS Program source \& diff --git a/man3/isalpha.3 b/man3/isalpha.3 index 7e7d90f92..3c2b569b3 100644 --- a/man3/isalpha.3 +++ b/man3/isalpha.3 @@ -327,11 +327,11 @@ it must be cast to as in the following example: .PP .in +4n -.nf +.EX char c; \&... res = toupper((unsigned char) c); -.fi +.EE .in .PP This is necessary because diff --git a/man3/makecontext.3 b/man3/makecontext.3 index 341962646..cca978eaf 100644 --- a/man3/makecontext.3 +++ b/man3/makecontext.3 @@ -169,7 +169,7 @@ func1: swapcontext(&uctx_func1, &uctx_func2) func2: returning func1: returning main: exiting -.fi +.EE .in .SS Program source \& diff --git a/man3/mallinfo.3 b/man3/mallinfo.3 index a8cbad544..ee0448592 100644 --- a/man3/mallinfo.3 +++ b/man3/mallinfo.3 @@ -40,7 +40,7 @@ and related functions. This structure is defined as follows: .PP .in +4n -.nf +.EX struct mallinfo { int arena; /* Non-mmapped space allocated (bytes) */ int ordblks; /* Number of free chunks */ @@ -53,7 +53,7 @@ struct mallinfo { int fordblks; /* Total free space (bytes) */ int keepcost; /* Top-most, releasable space (bytes) */ }; -.fi +.EE .in .PP The fields of the @@ -187,7 +187,7 @@ In the following example run of the program, and then every second allocated block is freed: .PP .in +4n -.nf +.EX $ \fB./a.out 1000 100 2\fP ============== Before allocating blocks ============== Total non\-mmapped bytes (arena): 0 @@ -224,7 +224,7 @@ Free bytes held in fastbins (fsmblks): 0 Total allocated space (uordblks): 52000 Total free space (fordblks): 83168 Topmost releasable block (keepcost): 31168 -.fi +.EE .in .SS Program source \& diff --git a/man3/malloc_info.3 b/man3/malloc_info.3 index e1a870849..c65ca822c 100644 --- a/man3/malloc_info.3 +++ b/man3/malloc_info.3 @@ -175,7 +175,7 @@ glibc 2.13 -.fi +.EE .in .SS Program source .EX diff --git a/man3/mallopt.3 b/man3/mallopt.3 index 025e36096..c4c679978 100644 --- a/man3/mallopt.3 +++ b/man3/mallopt.3 @@ -542,14 +542,14 @@ main(): returned from first free() call b7814000\-b7817000 rw\-p 00000000 00:00 0 bff53000\-bff74000 rw\-p 00000000 00:00 0 [stack] Aborted (core dumped) -.fi +.EE .in .PP The following runs show the results when employing other values for .BR M_CHECK_ACTION : .PP .in +4n -.nf +.EX $ \fB./a.out 1\fP # Diagnose error and continue main(): returned from first free() call *** glibc detected *** ./a.out: double free or corruption (top): 0x09cbe008 *** @@ -560,7 +560,7 @@ Aborted (core dumped) $ \fB./a.out 0\fP # Ignore error and continue main(): returned from first free() call main(): returned from second free() call -.fi +.EE .in .PP The next run shows how to set the same parameter using the @@ -568,12 +568,12 @@ The next run shows how to set the same parameter using the environment variable: .PP .in +4n -.nf +.EX $ \fBMALLOC_CHECK_=1 ./a.out\fP main(): returned from first free() call *** glibc detected *** ./a.out: free(): invalid pointer: 0x092c2008 *** main(): returned from second free() call -.fi +.EE .in .SS Program source \& diff --git a/man3/matherr.3 b/man3/matherr.3 index b05346798..531dbdf35 100644 --- a/man3/matherr.3 +++ b/man3/matherr.3 @@ -100,7 +100,7 @@ The function is invoked with one argument, a pointer to an structure, defined as follows: .PP .in +4n -.nf +.EX struct exception { int type; /* Exception type */ char *name; /* Name of function causing exception */ @@ -108,7 +108,7 @@ struct exception { double arg2; /* 2nd argument to function */ double retval; /* Function return value */ } -.fi +.EE .in .PP The @@ -326,11 +326,11 @@ is given an argument of 0.0, does not use .BR matherr (): .PP .in +4n -.nf +.EX .RB "$" " ./a.out 0.0" errno: Numerical result out of range x=-inf -.fi +.EE .in .PP In the following run, @@ -338,7 +338,7 @@ In the following run, is called, and returns 0: .PP .in +4n -.nf +.EX .RB "$" " ./a.out 0.0 0" matherr SING exception in log() function args: 0.000000, 0.000000 @@ -346,7 +346,7 @@ matherr SING exception in log() function log: SING error errno: Numerical argument out of domain x=-340282346638528859811704183484516925440.000000 -.fi +.EE .in .PP The message "log: SING error" was printed by the C library. @@ -356,13 +356,13 @@ In the following run, is called, and returns a nonzero value: .PP .in +4n -.nf +.EX .RB "$" " ./a.out 0.0 1" matherr SING exception in log() function args: 0.000000, 0.000000 retval: \-340282346638528859811704183484516925440.000000 x=-340282346638528859811704183484516925440.000000 -.fi +.EE .in .PP In this case, the C library did not print a message, and @@ -375,13 +375,13 @@ is called, changes the return value of the math function, and returns a nonzero value: .PP .in +4n -.nf +.EX .RB "$" " ./a.out 0.0 1 12345.0" matherr SING exception in log() function args: 0.000000, 0.000000 retval: \-340282346638528859811704183484516925440.000000 x=12345.000000 -.fi +.EE .in .SS Program source \& diff --git a/man3/mbstowcs.3 b/man3/mbstowcs.3 index c889a2b5a..4149eec00 100644 --- a/man3/mbstowcs.3 +++ b/man3/mbstowcs.3 @@ -138,7 +138,7 @@ Wide character string is: Grüße! (6 characters) ß alpha lower e alpha lower ! !alpha -.fi +.EE .in .SS Program source .EX diff --git a/man3/mcheck.3 b/man3/mcheck.3 index bf08d0c6b..0b1428400 100644 --- a/man3/mcheck.3 +++ b/man3/mcheck.3 @@ -192,7 +192,7 @@ About to free About to free a second time block freed twice Aborted (core dumped) -.fi +.EE .in .SS Program source \& diff --git a/man3/memchr.3 b/man3/memchr.3 index 1e0e8594d..b966a0f90 100644 --- a/man3/memchr.3 +++ b/man3/memchr.3 @@ -100,7 +100,7 @@ terminating null byte: .in +4n .EX char *p = rawmemchr(s,\ \(aq\\0\(aq); -.fi +.EE .in .SH RETURN VALUE The diff --git a/man3/mq_getattr.3 b/man3/mq_getattr.3 index 41d92b9a4..45caa7f9c 100644 --- a/man3/mq_getattr.3 +++ b/man3/mq_getattr.3 @@ -60,7 +60,7 @@ struct mq_attr { long mq_msgsize; /* Max. message size (bytes) */ long mq_curmsgs; /* # of messages currently in queue */ }; -.fi +.EE .in .PP The @@ -170,11 +170,11 @@ argument is NULL. Here is an example run of the program: .PP .in +4n -.nf +.EX $ \fB./a.out /testq\fP Maximum # of messages on queue: 10 Maximum message size: 8192 -.fi +.EE .in .PP Since Linux 3.5, the following @@ -184,14 +184,14 @@ files (described in can be used to control the defaults: .PP .in +4n -.nf +.EX $ \fBuname -sr\fP Linux 3.8.0 $ \fBcat /proc/sys/fs/mqueue/msg_default\fP 10 $ \fBcat /proc/sys/fs/mqueue/msgsize_default\fP 8192 -.fi +.EE .in .SS Program source \& diff --git a/man3/mq_open.3 b/man3/mq_open.3 index a296a428b..9ae564d75 100644 --- a/man3/mq_open.3 +++ b/man3/mq_open.3 @@ -136,7 +136,7 @@ struct mq_attr { long mq_curmsgs; /* # of messages currently in queue (ignored for mq_open()) */ }; -.fi +.EE .in .PP Only the diff --git a/man3/mq_receive.3 b/man3/mq_receive.3 index 68411703b..6a3e855ac 100644 --- a/man3/mq_receive.3 +++ b/man3/mq_receive.3 @@ -97,12 +97,12 @@ since the Epoch, 1970-01-01 00:00:00 +0000 (UTC), specified in the following structure: .PP .in +4n -.nf +.EX struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; -.fi +.EE .in .PP If no message is available, diff --git a/man3/mq_send.3 b/man3/mq_send.3 index 5485a8323..f38055208 100644 --- a/man3/mq_send.3 +++ b/man3/mq_send.3 @@ -106,12 +106,12 @@ since the Epoch, 1970-01-01 00:00:00 +0000 (UTC), specified in the following structure: .PP .in +4n -.nf +.EX struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; -.fi +.EE .in .PP If the message queue is full, diff --git a/man3/mtrace.3 b/man3/mtrace.3 index b1d317395..baa31e244 100644 --- a/man3/mtrace.3 +++ b/man3/mtrace.3 @@ -174,7 +174,7 @@ Memory not freed: 0x084c9378 0x64 at /home/cecilia/t_mtrace.c:12 0x084c93e0 0x64 at /home/cecilia/t_mtrace.c:12 0x084c9448 0x100 at /home/cecilia/t_mtrace.c:16 -.fi +.EE .in .PP The first two messages about unfreed memory correspond to the two diff --git a/man3/newlocale.3 b/man3/newlocale.3 index bb7dc4bfc..4b7b0b959 100644 --- a/man3/newlocale.3 +++ b/man3/newlocale.3 @@ -261,7 +261,7 @@ category to $ \fB./a.out fr_FR\fP 123456,789 Fri Mar 7 00:25:08 2014 -.fi +.EE .in .PP Set the @@ -280,7 +280,7 @@ category to $ \fB./a.out fr_FR it_IT\fP 123456,789 ven 07 mar 2014 00:26:01 CET -.fi +.EE .in .PP Specify the diff --git a/man3/ntp_gettime.3 b/man3/ntp_gettime.3 index 9926d6029..50e7b0d4c 100644 --- a/man3/ntp_gettime.3 +++ b/man3/ntp_gettime.3 @@ -39,7 +39,7 @@ Both of these APIs return information to the caller via the argument, a structure of the following type: .PP .in +4n -.nf +.EX struct ntptimeval { struct timeval time; /* Current time */ long int maxerror; /* Maximum error */ @@ -48,7 +48,7 @@ struct ntptimeval { /* Further padding bytes allowing for future expansion */ }; -.fi +.EE .in .PP The fields of this structure are as follows: @@ -59,7 +59,7 @@ The current time, expressed as a structure: .IP .in +4n -.nf +.EX struct timeval { time_t tv_sec; /* Seconds since the Epoch */ suseconds_t tv_usec; /* Microseconds */ diff --git a/man3/posix_openpt.3 b/man3/posix_openpt.3 index 5a5dc9119..a7192a3aa 100644 --- a/man3/posix_openpt.3 +++ b/man3/posix_openpt.3 @@ -104,7 +104,7 @@ posix_openpt(int flags) { return open("/dev/ptmx", flags); } -.fi +.EE .in .PP Calling diff --git a/man3/printf.3 b/man3/printf.3 index 494901bb0..615cea264 100644 --- a/man3/printf.3 +++ b/man3/printf.3 @@ -1083,7 +1083,7 @@ to five decimal places: #include #include fprintf(stdout, "pi = %.5f\en", 4 * atan(1.0)); -.fi +.EE .in .PP To print a date and time in the form "Sunday, July 3, 10:02", @@ -1098,7 +1098,7 @@ are pointers to strings: #include fprintf(stdout, "%s, %s %d, %.2d:%.2d\en", weekday, month, day, hour, min); -.fi +.EE .in .PP Many countries use the day-month-year order. diff --git a/man3/pthread_attr_init.3 b/man3/pthread_attr_init.3 index 23155154f..5f79ebc9a 100644 --- a/man3/pthread_attr_init.3 +++ b/man3/pthread_attr_init.3 @@ -119,7 +119,7 @@ Running the program on Linux/x86-32 with the NPTL threading implementation, we see the following: .PP .in +4n -.nf +.EX .\" Results from glibc 2.8, SUSE 11.0; Oct 2008 .RB "$" " ulimit \-s" " # No stack limit ==> default stack size is 2 MB" unlimited @@ -133,7 +133,7 @@ Thread attributes: Guard size = 4096 bytes Stack address = 0x40196000 Stack size = 0x201000 bytes -.fi +.EE .in .PP When we supply a stack size as a command-line argument, @@ -145,7 +145,7 @@ Running the program on Linux/x86-32 with the NPTL threading implementation, we see the following: .PP .in +4n -.nf +.EX .\" Results from glibc 2.8, SUSE 11.0; Oct 2008 .RB "$" " ./a.out 0x3000000" posix_memalign() allocated at 0x40197000 @@ -158,7 +158,7 @@ Thread attributes: Guard size = 0 bytes Stack address = 0x40197000 Stack size = 0x3000000 bytes -.fi +.EE .in .SS Program source \& diff --git a/man3/pthread_attr_setschedparam.3 b/man3/pthread_attr_setschedparam.3 index 7e4f110db..7cde4f0cd 100644 --- a/man3/pthread_attr_setschedparam.3 +++ b/man3/pthread_attr_setschedparam.3 @@ -60,11 +60,11 @@ in the buffer pointed to by Scheduling parameters are maintained in the following structure: .PP .in +4n -.nf +.EX struct sched_param { int sched_priority; /* Scheduling priority */ }; -.fi +.EE .in .PP As can be seen, only one scheduling parameter is supported. diff --git a/man3/pthread_cancel.3 b/man3/pthread_cancel.3 index 3b034ec31..0417ee4df 100644 --- a/man3/pthread_cancel.3 +++ b/man3/pthread_cancel.3 @@ -153,13 +153,13 @@ that its exit status was The following shell session shows what happens when we run the program: .PP .in +4n -.nf +.EX $ ./a.out thread_func(): started; cancellation disabled main(): sending cancellation request thread_func(): about to enable cancellation main(): thread was canceled -.fi +.EE .in .SS Program source \& diff --git a/man3/pthread_cleanup_push.3 b/man3/pthread_cleanup_push.3 index 0b9cf378e..9b7f96f1f 100644 --- a/man3/pthread_cleanup_push.3 +++ b/man3/pthread_cleanup_push.3 @@ -186,7 +186,7 @@ In the following shell session, the main thread sends a cancellation request to the other thread: .PP .in +4n -.nf +.EX $ \fB./a.out\fP New thread started cnt = 0 @@ -194,7 +194,7 @@ cnt = 1 Canceling thread Called clean-up handler Thread was canceled; cnt = 0 -.fi +.EE .in .PP From the above, we see that the thread was canceled, @@ -207,13 +207,13 @@ In the next run, the main program sets a global variable that causes other thread to terminate normally: .PP .in +4n -.nf +.EX $ \fB./a.out x\fP New thread started cnt = 0 cnt = 1 Thread terminated normally; cnt = 2 -.fi +.EE .in .PP From the above, we see that the clean-up handler was not executed (because @@ -228,14 +228,14 @@ and supplies a nonzero value for .IR cleanup_pop_arg : .PP .in +4n -.nf +.EX $ \fB./a.out x 1\fP New thread started cnt = 0 cnt = 1 Called clean-up handler Thread terminated normally; cnt = 0 -.fi +.EE .in .PP In the above, we see that although the thread was not canceled, diff --git a/man3/pthread_cleanup_push_defer_np.3 b/man3/pthread_cleanup_push_defer_np.3 index 64cac7b1b..b87498bc6 100644 --- a/man3/pthread_cleanup_push_defer_np.3 +++ b/man3/pthread_cleanup_push_defer_np.3 @@ -88,10 +88,10 @@ Other restrictions apply, as described in This sequence of calls: .PP .in +4n -.nf +.EX pthread_cleanup_push_defer_np(routine, arg); pthread_cleanup_pop_restore_np(execute); -.fi +.EE .in .PP is equivalent to (but shorter and more efficient than): @@ -99,7 +99,7 @@ is equivalent to (but shorter and more efficient than): .\" As far as I can see, LinuxThreads reverses the two substeps .\" in the push and pop below. .in +4n -.nf +.EX int oldtype; pthread_cleanup_push(routine, arg); @@ -107,7 +107,7 @@ pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype); \&... pthread_setcanceltype(oldtype, NULL); pthread_cleanup_pop(execute); -.fi +.EE .in .\" SH VERSIONS .\" Available since glibc 2.0 diff --git a/man3/pthread_create.3 b/man3/pthread_create.3 index 5cc7f4da7..038663e54 100644 --- a/man3/pthread_create.3 +++ b/man3/pthread_create.3 @@ -230,7 +230,7 @@ the stack size defaults to the value given by the "stack size" resource limit: .PP .in +4n -.nf +.EX .RB "$" " ulimit \-s" 8192 # The stack size limit is 8 MB (0x800000 bytes) .RB "$" " ./a.out hola salut servus" @@ -240,7 +240,7 @@ Thread 3: top of stack near 0xb6dce3b8; argv_string=servus Joined with thread 1; returned value was HOLA Joined with thread 2; returned value was SALUT Joined with thread 3; returned value was SERVUS -.fi +.EE .in .PP In the next run, the program explicitly sets a stack size of 1\ MB (using @@ -248,7 +248,7 @@ In the next run, the program explicitly sets a stack size of 1\ MB (using for the created threads: .PP .in +4n -.nf +.EX .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 @@ -256,7 +256,7 @@ Thread 3: top of stack near 0xb7b703b8; argv_string=servus Joined with thread 1; returned value was HOLA Joined with thread 2; returned value was SALUT Joined with thread 3; returned value was SERVUS -.fi +.EE .in .SS Program source \& diff --git a/man3/pthread_getattr_default_np.3 b/man3/pthread_getattr_default_np.3 index 5c27a4bb8..50836ac4d 100644 --- a/man3/pthread_getattr_default_np.3 +++ b/man3/pthread_getattr_default_np.3 @@ -104,7 +104,7 @@ various settings from the returned thread attributes object. When running the program, we see the following output: .PP .in +4n -.nf +.EX $ \fB./a.out\fP Stack size: 8388608 Guard size: 4096 @@ -112,7 +112,7 @@ Scheduling policy: SCHED_OTHER Scheduling priority: 0 Detach state: JOINABLE Inherit scheduler: INHERIT -.fi +.EE .in .PP .SS Program source diff --git a/man3/pthread_getattr_np.3 b/man3/pthread_getattr_np.3 index b8b79e09d..715193c87 100644 --- a/man3/pthread_getattr_np.3 +++ b/man3/pthread_getattr_np.3 @@ -127,7 +127,7 @@ In the first run, on an x86-32 system, a thread is created using default attributes: .PP .in +4n -.nf +.EX .RB "$" " ulimit \-s" " # No stack limit ==> default stack size is 2 MB" unlimited .RB "$" " ./a.out" @@ -135,7 +135,7 @@ Attributes of created thread: Guard size = 4096 bytes Stack address = 0x40196000 (EOS = 0x40397000) Stack size = 0x201000 (2101248) bytes -.fi +.EE .in .PP In the following run, we see that if a guard size is specified, @@ -143,7 +143,7 @@ it is rounded up to the next multiple of the system page size (4096 bytes on x86-32): .PP .in +4n -.nf +.EX .RB "$" " ./a.out \-g 4097" Thread attributes object after initializations: Guard size = 4097 bytes @@ -154,7 +154,7 @@ Attributes of created thread: Guard size = 8192 bytes Stack address = 0x40196000 (EOS = 0x40397000) Stack size = 0x201000 (2101248) bytes -.fi +.EE .in .\".in +4n .\".nf @@ -175,7 +175,7 @@ In the last run, the program manually allocates a stack for the thread. In this case, the guard size attribute is ignored. .PP .in +4n -.nf +.EX .RB "$" " ./a.out \-g 4096 \-s 0x8000 \-a" Allocated thread stack at 0x804d000 @@ -188,7 +188,7 @@ Attributes of created thread: Guard size = 0 bytes Stack address = 0x804d000 (EOS = 0x8055000) Stack size = 0x8000 (32768) bytes -.fi +.EE .in .SS Program source \& diff --git a/man3/pthread_getcpuclockid.3 b/man3/pthread_getcpuclockid.3 index e81a65a77..4f8fa7c7b 100644 --- a/man3/pthread_getcpuclockid.3 +++ b/man3/pthread_getcpuclockid.3 @@ -95,7 +95,7 @@ and the per-thread CPU time consumed by the two threads. The following shell session shows an example run: .PP .in +4n -.nf +.EX $ \fB./a.out\fP Main thread sleeping Subthread starting infinite loop @@ -103,7 +103,7 @@ Main thread consuming some CPU time... Process total CPU time: 1.368 Main thread CPU time: 0.376 Subthread CPU time: 0.992 -.fi +.EE .in .SS Program source \& diff --git a/man3/pthread_setname_np.3 b/man3/pthread_setname_np.3 index 29f610b50..71eabff92 100644 --- a/man3/pthread_setname_np.3 +++ b/man3/pthread_setname_np.3 @@ -149,7 +149,7 @@ The thread name after setting it is THREADFOO. a.out .RB "$ " "cat /proc/5990/task/5991/comm" THREADFOO -.fi +.EE .in .SS Program source \& diff --git a/man3/pthread_setschedparam.3 b/man3/pthread_setschedparam.3 index d137fe2dd..6b37a0f6a 100644 --- a/man3/pthread_setschedparam.3 +++ b/man3/pthread_setschedparam.3 @@ -62,11 +62,11 @@ specifies the new scheduling parameters for Scheduling parameters are maintained in the following structure: .PP .in +4n -.nf +.EX struct sched_param { int sched_priority; /* Scheduling priority */ }; -.fi +.EE .in .PP As can be seen, only one scheduling parameter is supported. @@ -197,7 +197,7 @@ Scheduler settings in \(aqattr\(aq Scheduler attributes of new thread policy=SCHED_RR, priority=20 -.fi +.EE .in .PP In the above output, one can see that the scheduling policy and priority @@ -211,7 +211,7 @@ ignore the scheduling attributes specified in the attributes object and instead take their scheduling attributes from the creating thread. .PP .in +4n -.nf +.EX # \fB./a.out \-mf10 \-ar20 \-i i\fP Scheduler settings of main thread policy=SCHED_FIFO, priority=10 @@ -222,7 +222,7 @@ Scheduler settings in \(aqattr\(aq Scheduler attributes of new thread policy=SCHED_FIFO, priority=10 -.fi +.EE .in .PP In the above output, one can see that the scheduling policy and priority diff --git a/man3/pthread_sigmask.3 b/man3/pthread_sigmask.3 index 03bd341f5..79f310eb9 100644 --- a/man3/pthread_sigmask.3 +++ b/man3/pthread_sigmask.3 @@ -97,7 +97,7 @@ and then creates a dedicated thread to fetch those signals via The following shell session demonstrates its use: .PP .in +4n -.nf +.EX .RB "$" " ./a.out &" [1] 5423 .RB "$" " kill \-QUIT %1" @@ -106,7 +106,7 @@ Signal handling thread got signal 3 Signal handling thread got signal 10 .RB "$" " kill \-TERM %1" [1]+ Terminated ./a.out -.fi +.EE .in .SS Program source \& diff --git a/man3/pthread_tryjoin_np.3 b/man3/pthread_tryjoin_np.3 index df04e7e27..b4d312612 100644 --- a/man3/pthread_tryjoin_np.3 +++ b/man3/pthread_tryjoin_np.3 @@ -75,12 +75,12 @@ specifying an absolute time measured since the Epoch (see .BR time (2)): .PP .in +4n -.nf +.EX struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; -.fi +.EE .in .SH RETURN VALUE On success, diff --git a/man3/readdir.3 b/man3/readdir.3 index 92279f149..bcd474120 100644 --- a/man3/readdir.3 +++ b/man3/readdir.3 @@ -56,7 +56,7 @@ In the glibc implementation, the structure is defined as follows: .PP .in +4n -.nf +.EX struct dirent { ino_t d_ino; /* Inode number */ off_t d_off; /* Not an offset; see below */ @@ -65,7 +65,7 @@ struct dirent { by all filesystem types */ char d_name[256]; /* Null-terminated filename */ }; -.fi +.EE .in .PP The only fields in the diff --git a/man3/realpath.3 b/man3/realpath.3 index 57efb816b..fc6047082 100644 --- a/man3/realpath.3 +++ b/man3/realpath.3 @@ -170,7 +170,7 @@ function. A typical source fragment would be .PP .in +4n -.nf +.EX #ifdef PATH_MAX path_max = PATH_MAX; #else @@ -178,7 +178,7 @@ A typical source fragment would be if (path_max <= 0) path_max = 4096; #endif -.fi +.EE .in .PP (But see the BUGS section.) diff --git a/man3/recno.3 b/man3/recno.3 index fa44aa786..62abef50c 100644 --- a/man3/recno.3 +++ b/man3/recno.3 @@ -76,7 +76,7 @@ is defined in the include file as follows: .PP .in +4n -.nf +.EX typedef struct { unsigned long flags; unsigned int cachesize; @@ -86,7 +86,7 @@ typedef struct { unsigned char bval; char *bfname; } RECNOINFO; -.fi +.EE .in .PP The elements of this structure are defined as follows: diff --git a/man3/regex.3 b/man3/regex.3 index ea536dd0f..7590e8714 100644 --- a/man3/regex.3 +++ b/man3/regex.3 @@ -191,12 +191,12 @@ is defined in .IR . .PP .in +4n -.nf +.EX typedef struct { regoff_t rm_so; regoff_t rm_eo; } regmatch_t; -.fi +.EE .in .PP Each diff --git a/man3/rpc.3 b/man3/rpc.3 index 2b0fb11a3..06c3051cf 100644 --- a/man3/rpc.3 +++ b/man3/rpc.3 @@ -30,14 +30,14 @@ To take use of these routines, include the header file The prototypes below make use of the following types: .PP .in +4n -.nf +.EX .BI "typedef int " bool_t ; .PP .BI "typedef bool_t (*" xdrproc_t ") (XDR *, void *, ...);" .PP .BI "typedef bool_t (*" resultproc_t ") (caddr_t " resp , .BI " struct sockaddr_in *" raddr ); -.fi +.EE .in .PP See the header files for the declarations of the @@ -150,9 +150,9 @@ Each time it receives a response, this routine calls whose form is: .IP .in +4n -.nf +.EX .BI "eachresult(char *" out ", struct sockaddr_in *" addr ); -.fi +.EE .in .IP where @@ -250,10 +250,10 @@ For both UDP and TCP, the supported values of and their argument types and what they do are: .IP .in +4n -.nf +.EX \fBCLSET_TIMEOUT\fP \fIstruct timeval\fP // set total timeout \fBCLGET_TIMEOUT\fP \fIstruct timeval\fP // get total timeout -.fi +.EE .in .IP Note: if you set the timeout using @@ -263,18 +263,18 @@ the timeout parameter passed to will be ignored in all future calls. .IP .in +4n -.nf +.EX \fBCLGET_SERVER_ADDR\fP \fIstruct sockaddr_in \fP // get server's address -.fi +.EE .in .IP The following operations are valid for UDP only: .IP .in +4n -.nf +.EX \fBCLSET_RETRY_TIMEOUT\fP \fIstruct timeval\fP // set the retry timeout \fBCLGET_RETRY_TIMEOUT\fP \fIstruct timeval\fP // get the retry timeout -.fi +.EE .in .IP The retry timeout is the time that "UDP RPC" @@ -816,7 +816,7 @@ has the following form: .in +4n .EX dispatch(struct svc_req *request, SVCXPRT *xprt); -.fi +.EE .in .IP The diff --git a/man3/scanf.3 b/man3/scanf.3 index 5bbe92bcb..800ec4e30 100644 --- a/man3/scanf.3 +++ b/man3/scanf.3 @@ -752,7 +752,7 @@ if (n == 1) { } else { fprintf(stderr, "No matching characters\\n"); } -.fi +.EE .in .PP As shown in the above example, it is necessary to call diff --git a/man3/sched_getcpu.3 b/man3/sched_getcpu.3 index fc2a27263..7489d3124 100644 --- a/man3/sched_getcpu.3 +++ b/man3/sched_getcpu.3 @@ -102,7 +102,7 @@ call: int c, s; s = getcpu(&c, NULL, NULL); cpu = (s == \-1) ? s : c; -.fi +.EE .in .SH SEE ALSO .BR getcpu (2), diff --git a/man3/sem_wait.3 b/man3/sem_wait.3 index d135cab29..bfc7f56f7 100644 --- a/man3/sem_wait.3 +++ b/man3/sem_wait.3 @@ -81,12 +81,12 @@ in seconds and nanoseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). This structure is defined as follows: .PP .in +4n -.nf +.EX struct timespec { time_t tv_sec; /* Seconds */ long tv_nsec; /* Nanoseconds [0 .. 999999999] */ }; -.fi +.EE .in .PP If the timeout has already expired by the time of the call, @@ -177,7 +177,7 @@ of the timeout, in seconds, for The following shows what happens on two different runs of the program: .PP .in +4n -.nf +.EX .RB "$" " ./a.out 2 3" About to call sem_timedwait() sem_post() from handler @@ -185,7 +185,7 @@ sem_timedwait() succeeded .RB "$" " ./a.out 2 1" About to call sem_timedwait() sem_timedwait() timed out -.fi +.EE .in .SS Program source \& diff --git a/man3/setaliasent.3 b/man3/setaliasent.3 index a0e061e72..f6b3daca5 100644 --- a/man3/setaliasent.3 +++ b/man3/setaliasent.3 @@ -84,7 +84,7 @@ struct aliasent { char **alias_members; /* alias name list */ int alias_local; }; -.fi +.EE .in .SH RETURN VALUE The functions @@ -131,7 +131,7 @@ void alias_setent(void); void alias_endent(void); alias_ent *alias_getent(void); alias_ent *alias_getbyname(char *name); -.fi +.EE .in .SH EXAMPLE The following example compiles with diff --git a/man3/sigqueue.3 b/man3/sigqueue.3 index a7515b343..cc05d0850 100644 --- a/man3/sigqueue.3 +++ b/man3/sigqueue.3 @@ -161,7 +161,7 @@ uinfo.si_code = SI_QUEUE; uinfo.si_pid = getpid(); /* Process ID of sender */ uinfo.si_uid = getuid(); /* Real UID of sender */ uinfo.si_value = val; /* Argument supplied to sigqueue() */ -.fi +.EE .in .SH SEE ALSO .BR kill (2), diff --git a/man3/statvfs.3 b/man3/statvfs.3 index 7252c6c88..18b92180d 100644 --- a/man3/statvfs.3 +++ b/man3/statvfs.3 @@ -48,7 +48,7 @@ is a pointer to a structure defined approximately as follows: .PP .in +4n -.nf +.EX struct statvfs { unsigned long f_bsize; /* Filesystem block size */ unsigned long f_frsize; /* Fragment size */ @@ -64,7 +64,7 @@ struct statvfs { unsigned long f_flag; /* Mount flags */ unsigned long f_namemax; /* Maximum filename length */ }; -.fi +.EE .in .PP Here the types diff --git a/man3/strcat.3 b/man3/strcat.3 index 58f014ba7..2230dc109 100644 --- a/man3/strcat.3 +++ b/man3/strcat.3 @@ -118,7 +118,7 @@ strncat(char *dest, const char *src, size_t n) return dest; } -.fi +.EE .in .SH RETURN VALUE The diff --git a/man3/strcpy.3 b/man3/strcpy.3 index 2f656b1e4..322e86a8e 100644 --- a/man3/strcpy.3 +++ b/man3/strcpy.3 @@ -103,7 +103,7 @@ strncpy(char *dest, const char *src, size_t n) return dest; } -.fi +.EE .in .SH RETURN VALUE The @@ -169,7 +169,7 @@ you can force termination using something like the following: strncpy(buf, str, buflen \- 1); if (buflen > 0) buf[buflen \- 1]= \(aq\\0\(aq; -.fi +.EE .in .PP (Of course, the above technique ignores the fact that, if diff --git a/man3/strftime.3 b/man3/strftime.3 index d85bd54e1..d078cc4e4 100644 --- a/man3/strftime.3 +++ b/man3/strftime.3 @@ -578,7 +578,7 @@ my_strftime(char *s, size_t max, const char *fmt, { return strftime(s, max, fmt, tm); } -.fi +.EE .in .PP Nowadays, @@ -615,7 +615,7 @@ Result string is "11" Result string is "00011" .RB "$" " ./a.out \(aq%_5m\(aq" Result string is " 11" -.fi +.EE .in .SS Program source .EX diff --git a/man3/strtok.3 b/man3/strtok.3 index 76800f844..98d72e668 100644 --- a/man3/strtok.3 +++ b/man3/strtok.3 @@ -217,7 +217,7 @@ to be used to separate the "major" tokens into subtokens. An example of the output produced by this program is the following: .PP .in +4n -.nf +.EX .RB "$" " ./a.out \(aqa/bbb///cc;xxx:yyy:\(aq \(aq:;\(aq \(aq/\(aq" 1: a/bbb///cc \-\-> a @@ -227,7 +227,7 @@ An example of the output produced by this program is the following: \-\-> xxx 3: yyy \-\-> yyy -.fi +.EE .in .SS Program source \& diff --git a/man3/strtol.3 b/man3/strtol.3 index d27385270..e7e3496ba 100644 --- a/man3/strtol.3 +++ b/man3/strtol.3 @@ -205,7 +205,7 @@ BSD also has .EX .BI "quad_t strtoq(const char *" nptr ", char **" endptr ", int " base ); .EX -.fi +.EE .in with completely analogous definition. Depending on the wordsize of the current architecture, this @@ -243,7 +243,7 @@ strtol: Invalid argument No digits were found .RB "$" " ./a.out 4000000000" strtol: Numerical result out of range -.fi +.EE .in .SS Program source \& diff --git a/man3/strverscmp.3 b/man3/strverscmp.3 index 6319f6b06..93dc9d5bf 100644 --- a/man3/strverscmp.3 +++ b/man3/strverscmp.3 @@ -120,10 +120,10 @@ to compare the two strings given as its command-line arguments. An example of its use is the following: .PP .in +4n -.nf +.EX $ i\fB./a.out jan1 jan10\fP jan1 < jan10 -.fi +.EE .in .SS Program source \& diff --git a/man3/toupper.3 b/man3/toupper.3 index 404b7b842..eb7ce18b9 100644 --- a/man3/toupper.3 +++ b/man3/toupper.3 @@ -152,11 +152,11 @@ it must be cast to as in the following example: .PP .in +4n -.nf +.EX char c; \&... res = toupper((unsigned char) c); -.fi +.EE .in .PP This is necessary because diff --git a/man3/ttyslot.3 b/man3/ttyslot.3 index deab237f7..526cf64db 100644 --- a/man3/ttyslot.3 +++ b/man3/ttyslot.3 @@ -167,11 +167,11 @@ also provides the declaration with the following feature test macro definitions: .PP .in +4n -.nf +.EX (_XOPEN_SOURCE >= 500 || (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED)) && ! (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) -.fi +.EE .in .PP Minix also has diff --git a/man3/xdr.3 b/man3/xdr.3 index 9644ba42d..e3fd693f3 100644 --- a/man3/xdr.3 +++ b/man3/xdr.3 @@ -23,11 +23,11 @@ The prototypes below are declared in and make use of the following types: .PP .in +4n -.nf +.EX .BI "typedef int " bool_t ; .PP .BI "typedef bool_t (*" xdrproc_t ") (XDR *, void *,...);" -.fi +.EE .in .PP For the declaration of the diff --git a/man4/fuse.4 b/man4/fuse.4 index 5b02aa812..95126810a 100644 --- a/man4/fuse.4 +++ b/man4/fuse.4 @@ -61,7 +61,7 @@ Every message that is read by the daemon begins with a header described by the following structure: .PP .in +4n -.nf +.EX struct fuse_in_header { uint32_t len; /* Total length of the data, including this header */ @@ -74,7 +74,7 @@ struct fuse_in_header { uint32_t pid; /* PID of the requesting process */ uint32_t padding; }; -.fi +.EE .in .PP The header is followed by a variable-length data portion @@ -90,7 +90,7 @@ to the file descriptor. All replies must start with the following header: .PP .in +4n -.nf +.EX struct fuse_out_header { uint32_t len; /* Total length of data written to the file descriptor */ @@ -98,7 +98,7 @@ struct fuse_out_header { uint64_t unique; /* The value from the corresponding request */ }; -.fi +.EE .in .PP This header is also followed by (potentially empty) variable-sized @@ -119,14 +119,14 @@ followed by a description of the semantics of the message. .BR FUSE_INIT .IP .in +4n -.nf +.EX struct fuse_init_in { uint32_t major; uint32_t minor; uint32_t max_readahead; /* Since protocol v7.6 */ uint32_t flags; /* Since protocol v7.6 */ }; -.fi +.EE .in .IP This is the first request sent by the kernel to the daemon. @@ -145,7 +145,7 @@ may be incomplete or incorrect for older or more recent protocol versions. The reply for this request has the following format: .IP .in +4n -.nf +.EX struct fuse_init_out { uint32_t major; uint32_t minor; @@ -158,7 +158,7 @@ struct fuse_init_out { uint32_t time_gran; /* Since v7.6 */ uint32_t unused[9]; }; -.fi +.EE .in .IP If the major version supported by the kernel is larger than that supported @@ -179,14 +179,14 @@ both parties should use the protocol corresponding to said minor version. .BR FUSE_GETATTR .IP .in +4n -.nf +.EX struct fuse_getattr_in { uint32_t getattr_flags; uint32_t dummy; uint64_t fh; /* Set only if (getattr_flags & FUSE_GETATTR_FH) }; -.fi +.EE .in .IP The requested operation is to compute the attributes to be returned @@ -214,7 +214,7 @@ The computed attributes and the requested cache timeout should then be returned in the following structure: .IP .in +4n -.nf +.EX struct fuse_attr_out { /* Attribute cache duration (seconds + nanoseconds) */ uint64_t attr_valid; @@ -239,19 +239,19 @@ struct fuse_attr_out { uint32_t padding; } attr; }; -.fi +.EE .in .IP .TP .BR FUSE_ACCESS .IP .in +4n -.nf +.EX struct fuse_access_in { uint32_t mask; uint32_t padding; }; -.fi +.EE .in .IP If the @@ -266,13 +266,13 @@ may be indicated by returning .TP .BR FUSE_OPEN " and " FUSE_OPENDIR .in +4n -.nf +.EX struct fuse_open_in { uint32_t flags; /* The flags that were passed to the open(2) */ uint32_t unused; }; -.fi +.EE .in .IP The requested operation is to open the node indicated by @@ -342,11 +342,11 @@ The bytes should be returned directly following the usual reply header. .TP .BR FUSE_INTERRUPT .in +4n -.nf +.EX struct fuse_interrupt_in { uint64_t unique; }; -.fi +.EE .in .IP The requested action is to cancel the pending operation indicated by @@ -370,7 +370,7 @@ indicated by The expected reply is of the form: .IP .in +4n -.nf +.EX struct fuse_entry_out { uint64_t nodeid; /* Inode ID */ uint64_t generation; /* Inode generation */ @@ -380,7 +380,7 @@ struct fuse_entry_out { uint32_t attr_valid_nsec; struct fuse_attr attr; }; -.fi +.EE .in .IP The combination of @@ -396,14 +396,14 @@ is as for .TP .BR FUSE_FLUSH .in +4n -.nf +.EX struct fuse_flush_in { uint64_t fh; uint32_t unused; uint32_t padding; uint64_t lock_owner; }; -.fi +.EE .in .IP The requested action is to flush any pending changes to the indicated @@ -414,14 +414,14 @@ still needs to be issued once the flush operation is complete. .TP .BR FUSE_RELEASE " and " FUSE_RELEASEDIR .in +4n -.nf +.EX struct fuse_release_in { uint64_t fh; uint32_t flags; uint32_t release_flags; uint64_t lock_owner; }; -.fi +.EE .in .IP These are the converse of @@ -445,7 +445,7 @@ There is no input data associated with this request. The expected reply data has the following structure: .IP .in +4n -.nf +.EX struct fuse_kstatfs { uint64_t blocks; uint64_t bfree; @@ -462,7 +462,7 @@ struct fuse_kstatfs { struct fuse_statfs_out { struct fuse_kstatfs st; }; -.fi +.EE .in .IP For the interpretation of these fields, see @@ -552,7 +552,7 @@ The following messages are not yet documented in this manual page: .BR FUSE_SYMLINK .BR FUSE_UNLINK .BR FUSE_WRITE -.fi +.EE .in .SH SEE ALSO .BR fusermount (1), diff --git a/man4/loop.4 b/man4/loop.4 index d43ce00e7..5b7196dd9 100644 --- a/man4/loop.4 +++ b/man4/loop.4 @@ -78,7 +78,7 @@ structure, defined in as: .IP .in +4n -.nf +.EX struct loop_info { int lo_number; /* ioctl r/o */ dev_t lo_device; /* ioctl r/o */ @@ -94,7 +94,7 @@ struct loop_info { unsigned long lo_init[2]; char reserved[4]; }; -.fi +.EE .in .IP The encryption type @@ -164,7 +164,7 @@ structure, which has some additional fields and a larger range for some other fields: .IP .in +4n -.nf +.EX struct loop_info64 { uint64_t lo_device; /* ioctl r/o */ uint64_t lo_inode; /* ioctl r/o */ @@ -180,7 +180,7 @@ struct loop_info64 { uint8_t lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */ uint64_t lo_init[2]; }; -.fi +.EE .in .SS /dev/loop-control Since Linux 3.1, @@ -229,14 +229,14 @@ and then associates the loop device with the backing store. The following shell session demonstrates the use of the program: .PP .in +4n -.nf +.EX $ \fBdd if=/dev/zero of=file.img bs=1MiB count=10\fP 10+0 records in 10+0 records out 10485760 bytes (10 MB) copied, 0.00609385 s, 1.7 GB/s $ \fBsudo ./mnt_loop file.img\fP loopname = /dev/loop5 -.fi +.EE .in .SS Program source \& diff --git a/man4/rtc.4 b/man4/rtc.4 index 738de43a0..a231f2f2b 100644 --- a/man4/rtc.4 +++ b/man4/rtc.4 @@ -126,7 +126,7 @@ requests are defined on file descriptors connected to RTC devices: Returns this RTC's time in the following structure: .IP .in +4n -.nf +.EX struct rtc_time { int tm_sec; int tm_min; @@ -138,7 +138,7 @@ struct rtc_time { int tm_yday; /* unused */ int tm_isdst; /* unused */ }; -.fi +.EE .in .IP The fields in this structure have the same meaning and ranges as for the @@ -253,13 +253,13 @@ to read or write the RTC's alarm time (respectively) with this structure: .PP .RS .in +4n -.nf +.EX struct rtc_wkalrm { unsigned char enabled; unsigned char pending; struct rtc_time time; }; -.fi +.EE .in .RE .IP diff --git a/man4/st.4 b/man4/st.4 index 9c8b2db38..d1d12c264 100644 --- a/man4/st.4 +++ b/man4/st.4 @@ -90,7 +90,7 @@ mknod \-m 666 /dev/nst0 c 9 128 mknod \-m 666 /dev/nst0l c 9 160 mknod \-m 666 /dev/nst0m c 9 192 mknod \-m 666 /dev/nst0a c 9 224 -.fi +.EE .in .PP There is no corresponding block device. @@ -247,13 +247,13 @@ The driver returns an error if the drive rejects an operation. .PP .in +4n -.nf +.EX /* Structure for MTIOCTOP \- mag tape op command: */ struct mtop { short mt_op; /* operations defined below */ int mt_count; /* how many of them */ }; -.fi +.EE .in .PP Magnetic Tape operations for normal tape use: @@ -637,7 +637,7 @@ mt_cmd.mt_op = MTSETDRVBUFFER; mt_cmd.mt_count = MT_ST_BOOLEANS | MT_ST_BUFFER_WRITES | MT_ST_ASYNC_WRITES; ioctl(fd, MTIOCTOP, mt_cmd); -.fi +.EE .in .RE .IP "" @@ -691,7 +691,7 @@ This request takes an argument of type .IR "(struct mtget\ *)" . .PP .in +4n -.nf +.EX /* structure for MTIOCGET \- mag tape get status command */ struct mtget { long mt_type; @@ -704,7 +704,7 @@ struct mtget { daddr_t mt_fileno; daddr_t mt_blkno; }; -.fi +.EE .in .IP \fImt_type\fP 11 The header file defines many values for @@ -823,12 +823,12 @@ or a Tandberg-compatible SCSI-1 drive (Tandberg, Archive Viper, Wangtek, ... ). .PP .in +4n -.nf +.EX /* structure for MTIOCPOS \- mag tape get position command */ struct mtpos { long mt_blkno; /* current block number */ }; -.fi +.EE .in .SH RETURN VALUE .TP 14 diff --git a/man5/acct.5 b/man5/acct.5 index aa153c446..55bc87760 100644 --- a/man5/acct.5 +++ b/man5/acct.5 @@ -46,7 +46,7 @@ and is defined in as follows: .PP .in +4n -.nf +.EX #define ACCT_COMM 16 typedef u_int16_t comp_t; @@ -81,7 +81,7 @@ enum { /* Bits that may be set in ac_flag field */ ACORE = 0x08, /* Dumped core */ AXSIG = 0x10 /* Killed by a signal */ }; -.fi +.EE .in .PP The @@ -121,7 +121,7 @@ fields is widened from 16 to 32 bits The records are defined as follows: .PP .in +4n -.nf +.EX struct acct_v3 { char ac_flag; /* Flags */ char ac_version; /* Always set to ACCT_VERSION (3) */ @@ -144,7 +144,7 @@ struct acct_v3 { comp_t ac_swaps; /* Number of swaps (unused) */ char ac_comm[ACCT_COMM]; /* Command name */ }; -.fi +.EE .in .SH VERSIONS The diff --git a/man5/core.5 b/man5/core.5 index 6ed4e9d4a..cd3c9b1d8 100644 --- a/man5/core.5 +++ b/man5/core.5 @@ -403,10 +403,10 @@ It can be useful to set in the parent shell before running a program, for example: .PP .in +4n -.nf +.EX .RB "$" " echo 0x7 > /proc/self/coredump_filter" .RB "$" " ./some_program" -.fi +.EE .in .PP This file is provided only if the kernel was built with the @@ -452,7 +452,7 @@ The following shell session demonstrates the use of this program .IR core_pattern_pipe_test ): .PP .in +4n -.nf +.EX .RB "$" " cc \-o core_pattern_pipe_test core_pattern_pipe_test.c" .RB "$" " su" Password: @@ -471,7 +471,7 @@ argc[2]= argc[3]= argc[4]= Total bytes in core dump: 282624 -.fi +.EE .in .SS Program source \& diff --git a/man5/elf.5 b/man5/elf.5 index d72024e9a..b7b23e8c5 100644 --- a/man5/elf.5 +++ b/man5/elf.5 @@ -110,7 +110,7 @@ ElfN_Word uint32_t ElfN_Sxword int64_t ElfN_Xword uint64_t .\" Elf32_Size Unsigned object size -.fi +.EE .in .PP (Note: the *BSD terminology is a bit different. @@ -159,7 +159,7 @@ typedef struct { uint16_t e_shnum; uint16_t e_shstrndx; } ElfN_Ehdr; -.fi +.EE .in .PP The fields have the following meanings: @@ -647,7 +647,7 @@ typedef struct { uint32_t p_flags; uint32_t p_align; } Elf32_Phdr; -.fi +.EE .in .PP .in +4n @@ -662,7 +662,7 @@ typedef struct { uint64_t p_memsz; uint64_t p_align; } Elf64_Phdr; -.fi +.EE .in .PP The main difference between the 32-bit and the 64-bit program header lies @@ -893,7 +893,7 @@ typedef struct { uint32_t sh_addralign; uint32_t sh_entsize; } Elf32_Shdr; -.fi +.EE .in .PP .in +4n @@ -910,7 +910,7 @@ typedef struct { uint64_t sh_addralign; uint64_t sh_entsize; } Elf64_Shdr; -.fi +.EE .in .PP No real differences exist between the 32-bit and 64-bit section headers. @@ -1454,7 +1454,7 @@ typedef struct { unsigned char st_other; uint16_t st_shndx; } Elf32_Sym; -.fi +.EE .in .PP .in +4n @@ -1467,7 +1467,7 @@ typedef struct { Elf64_Addr st_value; uint64_t st_size; } Elf64_Sym; -.fi +.EE .in .PP The 32-bit and 64-bit versions have the same members, just in a different @@ -1622,7 +1622,7 @@ typedef struct { Elf32_Addr r_offset; uint32_t r_info; } Elf32_Rel; -.fi +.EE .in .PP .in +4n @@ -1631,7 +1631,7 @@ typedef struct { Elf64_Addr r_offset; uint64_t r_info; } Elf64_Rel; -.fi +.EE .in .PP Relocation structures that need an addend: @@ -1643,7 +1643,7 @@ typedef struct { uint32_t r_info; int32_t r_addend; } Elf32_Rela; -.fi +.EE .in .PP .in +4n @@ -1653,7 +1653,7 @@ typedef struct { uint64_t r_info; int64_t r_addend; } Elf64_Rela; -.fi +.EE .in .TP \n[l1_indent] .IR r_offset @@ -1704,7 +1704,7 @@ typedef struct { } d_un; } Elf32_Dyn; extern Elf32_Dyn _DYNAMIC[]; -.fi +.EE .in .PP .in +4n @@ -1717,7 +1717,7 @@ typedef struct { } d_un; } Elf64_Dyn; extern Elf64_Dyn _DYNAMIC[]; -.fi +.EE .in .TP \n[l1_indent] .IR d_tag @@ -1865,7 +1865,7 @@ An example for parsing out two consecutive notes should clarify their layout in memory: .PP .in +4n -.nf +.EX void *memory, *name, *desc; Elf64_Nhdr *note, *next_note; @@ -1885,7 +1885,7 @@ desc = note->n_descsz == 0 ? NULL : next_note = memory + sizeof(*note) + ALIGN_UP(note->n_namesz, 4) + ALIGN_UP(note->n_descsz, 4); -.fi +.EE .in .PP Keep in mind that the interpretation of @@ -1907,7 +1907,7 @@ typedef struct { Elf32_Word n_descsz; Elf32_Word n_type; } Elf32_Nhdr; -.fi +.EE .in .PP .in +4n @@ -1917,7 +1917,7 @@ typedef struct { Elf64_Word n_descsz; Elf64_Word n_type; } Elf64_Nhdr; -.fi +.EE .in .TP \n[l1_indent] .IR n_namesz diff --git a/man5/slabinfo.5 b/man5/slabinfo.5 index 6ce69fa5d..382cc8e58 100644 --- a/man5/slabinfo.5 +++ b/man5/slabinfo.5 @@ -47,7 +47,7 @@ sigqueue 100 100 160 25 1 : tunables 0 0 0 : slabdata 4 4 0 sighand_cache 355 405 2112 15 8 : tunables 0 0 0 : slabdata 27 27 0 kmalloc-8192 96 96 8192 4 8 : tunables 0 0 0 : slabdata 24 24 0 \&... -.fi +.EE .in .PP The first line of output includes a version number, diff --git a/man7/aio.7 b/man7/aio.7 index 053172db5..90a38e3d4 100644 --- a/man7/aio.7 +++ b/man7/aio.7 @@ -79,7 +79,7 @@ An argument of this type is employed with all of the functions listed above. This structure has the following form: .PP .in +4n -.nf +.EX #include struct aiocb { @@ -100,7 +100,7 @@ struct aiocb { /* Operation codes for \(aqaio_lio_opcode\(aq: */ enum { LIO_READ, LIO_WRITE, LIO_NOP }; -.fi +.EE .in .PP The fields of this structure are as follows: @@ -219,7 +219,7 @@ and these are satisfied by two lines of input containing "abc" and "x". .PP .in +4n -.nf +.EX $ \fB./a.out /dev/stdin /dev/stdin\fP opened /dev/stdin on descriptor 3 opened /dev/stdin on descriptor 4 @@ -241,7 +241,7 @@ All I/O requests completed aio_return(): for request 0 (descriptor 3): 4 for request 1 (descriptor 4): 2 -.fi +.EE .in .SS Program source \& diff --git a/man7/arp.7 b/man7/arp.7 index 2b5f76cb2..19f61bf57 100644 --- a/man7/arp.7 +++ b/man7/arp.7 @@ -83,7 +83,7 @@ They take a pointer to a as their argument. .PP .in +4n -.nf +.EX struct arpreq { struct sockaddr arp_pa; /* protocol address */ struct sockaddr arp_ha; /* hardware address */ @@ -91,7 +91,7 @@ struct arpreq { struct sockaddr arp_netmask; /* netmask of protocol address */ char arp_dev[16]; }; -.fi +.EE .in .PP .BR SIOCSARP ", " SIOCDARP " and " SIOCGARP diff --git a/man7/capabilities.7 b/man7/capabilities.7 index dbd2a377c..c70d164f3 100644 --- a/man7/capabilities.7 +++ b/man7/capabilities.7 @@ -940,7 +940,7 @@ the kernel calculates the new capabilities of the process using the following algorithm: .PP .in +4n -.nf +.EX P'(ambient) = (file is privileged) ? 0 : P(ambient) P'(permitted) = (P(inheritable) & F(inheritable)) | @@ -949,7 +949,7 @@ P'(permitted) = (P(inheritable) & F(inheritable)) | P'(effective) = F(effective) ? P'(permitted) : P'(ambient) P'(inheritable) = P(inheritable) [i.e., unchanged] -.fi +.EE .in .PP where: @@ -1354,7 +1354,7 @@ into an environment where the only way of gaining capabilities is by executing a program with associated file capabilities: .PP .in +4n -.nf +.EX prctl(PR_SET_SECUREBITS, /* SECBIT_KEEP_CAPS off */ SECBIT_KEEP_CAPS_LOCKED | @@ -1364,7 +1364,7 @@ prctl(PR_SET_SECUREBITS, SECBIT_NOROOT_LOCKED); /* Setting/locking SECURE_NO_CAP_AMBIENT_RAISE is not required */ -.fi +.EE .in .SS Interaction with user namespaces For a discussion of the interaction of capabilities and user namespaces, see diff --git a/man7/cgroup_namespaces.7 b/man7/cgroup_namespaces.7 index 9a416d63d..f2ad7c343 100644 --- a/man7/cgroup_namespaces.7 +++ b/man7/cgroup_namespaces.7 @@ -73,14 +73,14 @@ hierarchy, and put the shell into that cgroup: .PP .EX .in +4n -.nf +.EX # \fBmkdir \-p /sys/fs/cgroup/freezer/sub\fP # \fBecho $$\fP # Show PID of this shell 30655 # \fBsh \-c \(aqecho 30655 > /sys/fs/cgroup/freezer/sub/cgroup.procs\(aq\fP # \fBcat /proc/self/cgroup | grep freezer\fP 7:freezer:/sub -.fi +.EE .in .EE .PP diff --git a/man7/cgroups.7 b/man7/cgroups.7 index 5f432cf27..40cd2325f 100644 --- a/man7/cgroups.7 +++ b/man7/cgroups.7 @@ -172,9 +172,9 @@ Thus, one might mount the controller as follows: .PP .in +4n -.nf +.EX mount \-t cgroup \-o cpu none /sys/fs/cgroup/cpu -.fi +.EE .in .PP It is possible to comount multiple controllers against the same hierarchy. @@ -185,9 +185,9 @@ and controllers are comounted against a single hierarchy: .PP .in +4n -.nf +.EX mount \-t cgroup \-o cpu,cpuacct none /sys/fs/cgroup/cpu,cpuacct -.fi +.EE .in .PP Comounting controllers has the effect that a process is in the same cgroup for @@ -202,9 +202,9 @@ for another. It is possible to comount all v1 controllers against the same hierarchy: .PP .in +4n -.nf +.EX mount \-t cgroup \-o all cgroup /sys/fs/cgroup -.fi +.EE .in .PP (One can achieve the same result by omitting @@ -618,7 +618,7 @@ An example of the contents of this file (reformatted for readability) is the following: .IP .in +4n -.nf +.EX #subsys_name hierarchy num_cgroups enabled cpuset 4 1 1 cpu 8 1 1 @@ -632,7 +632,7 @@ perf_event 5 1 1 net_prio 9 1 1 hugetlb 0 1 0 pids 2 1 1 -.fi +.EE .in .IP The fields in this file are, from left to right: diff --git a/man7/ddp.7 b/man7/ddp.7 index 1689e6dce..f08c448a2 100644 --- a/man7/ddp.7 +++ b/man7/ddp.7 @@ -67,7 +67,7 @@ An AppleTalk socket address is defined as a combination of a network number, a node number, and a port number. .PP .in +4n -.nf +.EX struct at_addr { unsigned short s_net; unsigned char s_node; @@ -78,7 +78,7 @@ struct sockaddr_atalk { unsigned char sat_port; /* port */ struct at_addr sat_addr; /* net/node */ }; -.fi +.EE .in .PP .I sat_family diff --git a/man7/fanotify.7 b/man7/fanotify.7 index ae5c5a6a7..ed2175aeb 100644 --- a/man7/fanotify.7 +++ b/man7/fanotify.7 @@ -143,7 +143,7 @@ After a successful the read buffer contains one or more of the following structures: .PP .in +4n -.nf +.EX struct fanotify_event_metadata { __u32 event_len; __u8 vers; @@ -153,7 +153,7 @@ struct fanotify_event_metadata { __s32 fd; __s32 pid; }; -.fi +.EE .in .PP For performance reasons, it is recommended to use a large @@ -348,12 +348,12 @@ a structure of the following form to the fanotify file descriptor: .PP .in +4n -.nf +.EX struct fanotify_response { __s32 fd; __u32 response; }; -.fi +.EE .in .PP The fields of this structure are as follows: @@ -548,7 +548,7 @@ event occurred. Execution of the program ends when the user presses the ENTER key. .SS Example output .in +4n -.nf +.EX # ./fanotify_example /home Press enter key to terminate. Listening for events. @@ -556,7 +556,7 @@ FAN_OPEN_PERM: File /home/user/temp/notes FAN_CLOSE_WRITE: File /home/user/temp/notes Listening for events stopped. -.fi +.EE .in .SS Program source .EX diff --git a/man7/feature_test_macros.7 b/man7/feature_test_macros.7 index 63860f467..6c98e5987 100644 --- a/man7/feature_test_macros.7 +++ b/man7/feature_test_macros.7 @@ -69,7 +69,7 @@ manual page): .in -4n Feature Test Macro Requirements for glibc (see .BR feature_test_macros (7)): -.fi +.EE .in .PP .BR acct (): @@ -807,7 +807,7 @@ _BSD_SOURCE defined _SVID_SOURCE defined _ATFILE_SOURCE defined _GNU_SOURCE defined -.fi +.EE .in .SS Program source \& diff --git a/man7/inode.7 b/man7/inode.7 index 35fdb1c4b..508c00913 100644 --- a/man7/inode.7 +++ b/man7/inode.7 @@ -256,12 +256,12 @@ S_IFIFO 0010000 FIFO Thus, to test for a regular file (for example), one could write: .PP .in +4n -.nf +.EX stat(pathname, &sb); if ((sb.st_mode & S_IFMT) == S_IFREG) { /* Handle regular file */ } -.fi +.EE .in .PP Because tests of the above form are common, additional @@ -295,12 +295,12 @@ socket? (Not in POSIX.1-1996.) The preceding code snippet could thus be rewritten as: .PP .in +4n -.nf +.EX stat(pathname, &sb); if (S_ISREG(sb.st_mode)) { /* Handle regular file */ } -.fi +.EE .in .PP The definitions of most of the above file type test macros diff --git a/man7/inotify.7 b/man7/inotify.7 index 193feca5c..52fdd0298 100644 --- a/man7/inotify.7 +++ b/man7/inotify.7 @@ -118,7 +118,7 @@ struct inotify_event { uint32_t len; /* Size of \fIname\fP field */ char name[]; /* Optional null-terminated name */ }; -.fi +.EE .in .PP .I wd @@ -875,7 +875,7 @@ event occurred. Execution of the program ended when the user pressed the ENTER key. .SS Example output .in +4n -.nf +.EX $ \fB./a.out /tmp /home/user/temp\fP Press enter key to terminate. Listening for events. @@ -885,7 +885,7 @@ IN_OPEN: /tmp/ [directory] IN_CLOSE_NOWRITE: /tmp/ [directory] Listening for events stopped. -.fi +.EE .in .SS Program source .EX diff --git a/man7/ip.7 b/man7/ip.7 index 9fd0d41b4..302d26d26 100644 --- a/man7/ip.7 +++ b/man7/ip.7 @@ -145,7 +145,7 @@ On raw sockets is set to the IP protocol. .PP .in +4n -.nf +.EX struct sockaddr_in { sa_family_t sin_family; /* address family: AF_INET */ in_port_t sin_port; /* port in network byte order */ @@ -156,7 +156,7 @@ struct sockaddr_in { struct in_addr { uint32_t s_addr; /* address in network byte order */ }; -.fi +.EE .in .PP .I sin_family @@ -664,14 +664,14 @@ or .BR sendmsg (2). .IP .in +4n -.nf +.EX struct in_pktinfo { unsigned int ipi_ifindex; /* Interface index */ struct in_addr ipi_spec_dst; /* Local address */ struct in_addr ipi_addr; /* Header Destination address */ }; -.fi +.EE .in .IP .I ipi_ifindex @@ -744,7 +744,7 @@ struct sock_extended_err { }; struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *); -.fi +.EE .in .IP .I ee_errno diff --git a/man7/keyrings.7 b/man7/keyrings.7 index e6ec21878..a6a99f7ad 100644 --- a/man7/keyrings.7 +++ b/man7/keyrings.7 @@ -552,7 +552,7 @@ is the following: 32100fab I--Q--- 4 perm 1f3f0000 1000 65534 keyring _uid.1000: 2 32a387ea I--Q--- 1 perm 3f010000 1000 1000 keyring _pid: 2 3ce56aea I--Q--- 5 perm 3f030000 1000 1000 keyring _ses: 1 -.fi +.EE .in .IP The fields shown in each line of this file are as follows: @@ -715,11 +715,11 @@ has at least one key on the system. An example of the data that one might see in this file is the following: .IP .in +4n -.nf +.EX 0: 10 9/9 2/1000000 22/25000000 42: 9 9/9 8/200 106/20000 1000: 11 11/11 10/200 271/20000 -.fi +.EE .in .IP The fields shown in each line are as follows: diff --git a/man7/locale.7 b/man7/locale.7 index d9cc420ac..bce2d1a66 100644 --- a/man7/locale.7 +++ b/man7/locale.7 @@ -307,7 +307,7 @@ struct lconv { char p_sign_posn; char n_sign_posn; }; -.fi +.EE .in .SS POSIX.1-2008 extensions to the locale API POSIX.1-2008 standardized a number of extensions to the locale API, diff --git a/man7/mount_namespaces.7 b/man7/mount_namespaces.7 index 55bdb51c2..c9b9ea2c4 100644 --- a/man7/mount_namespaces.7 +++ b/man7/mount_namespaces.7 @@ -285,13 +285,13 @@ and then view the mounts in .IR /proc/self/mountinfo : .PP .in +4n -.nf +.EX sh1# \fBmount \-\-make\-shared /mntS\fP sh1# \fBmount \-\-make\-private /mntP\fP sh1# \fBcat /proc/self/mountinfo | grep \(aq/mnt\(aq | sed \(aqs/ \- .*//\(aq\fP 77 61 8:17 / /mntS rw,relatime shared:1 83 61 8:15 / /mntP rw,relatime -.fi +.EE .in .PP From the @@ -312,10 +312,10 @@ is the root directory, which is mounted as private: .PP .in +4n -.nf +.EX sh1# \fBcat /proc/self/mountinfo | awk \(aq$1 == 61\(aq | sed \(aqs/ \- .*//\(aq\fP 61 0 8:2 / / rw,relatime -.fi +.EE .in .PP On a second terminal, @@ -323,12 +323,12 @@ we create a new mount namespace where we run a second shell and inspect the mounts: .PP .in +4n -.nf +.EX $ \fBPS1=\(aqsh2# \(aq sudo unshare \-m \-\-propagation unchanged sh\fP sh2# \fBcat /proc/self/mountinfo | grep \(aq/mnt\(aq | sed \(aqs/ \- .*//\(aq\fP 222 145 8:17 / /mntS rw,relatime shared:1 225 145 8:15 / /mntP rw,relatime -.fi +.EE .in .PP The new mount namespace received a copy of the initial mount namespace's @@ -350,7 +350,7 @@ and and inspect the set-up: .PP .in +4n -.nf +.EX sh2# \fBmkdir /mntS/a\fP sh2# \fBmount /dev/sdb6 /mntS/a\fP sh2# \fBmkdir /mntP/b\fP @@ -360,7 +360,7 @@ sh2# \fBcat /proc/self/mountinfo | grep \(aq/mnt\(aq | sed \(aqs/ \- .*//\(aq\fP 225 145 8:15 / /mntP rw,relatime 178 222 8:22 / /mntS/a rw,relatime shared:2 230 225 8:23 / /mntP/b rw,relatime -.fi +.EE .in .PP From the above, it can be seen that @@ -378,12 +378,12 @@ but the new mount created under the private mount point did not propagate: .PP .in +4n -.nf +.EX sh1# \fBcat /proc/self/mountinfo | grep \(aq/mnt\(aq | sed \(aqs/ \- .*//\(aq\fP 77 61 8:17 / /mntS rw,relatime shared:1 83 61 8:15 / /mntP rw,relatime 179 77 8:22 / /mntS/a rw,relatime shared:2 -.fi +.EE .in .\" .SS MS_SLAVE example @@ -400,36 +400,36 @@ We can demonstrate the effect of slaving by first marking two mount points as shared in the initial mount namespace: .PP .in +4n -.nf +.EX sh1# \fBmount \-\-make\-shared /mntX\fP sh1# \fBmount \-\-make\-shared /mntY\fP sh1# \fBcat /proc/self/mountinfo | grep \(aq/mnt\(aq | sed \(aqs/ \- .*//\(aq\fP 132 83 8:23 / /mntX rw,relatime shared:1 133 83 8:22 / /mntY rw,relatime shared:2 -.fi +.EE .in .PP On a second terminal, we create a new mount namespace and inspect the mount points: .PP .in +4n -.nf +.EX sh2# \fBunshare \-m \-\-propagation unchanged sh\fP sh2# \fBcat /proc/self/mountinfo | grep \(aq/mnt\(aq | sed \(aqs/ \- .*//\(aq\fP 168 167 8:23 / /mntX rw,relatime shared:1 169 167 8:22 / /mntY rw,relatime shared:2 -.fi +.EE .in .PP In the new mount namespace, we then mark one of the mount points as a slave: .PP .in +4n -.nf +.EX sh2# \fBmount \-\-make\-slave /mntY\fP sh2# \fBcat /proc/self/mountinfo | grep \(aq/mnt\(aq | sed \(aqs/ \- .*//\(aq\fP 168 167 8:23 / /mntX rw,relatime shared:1 169 167 8:22 / /mntY rw,relatime master:2 -.fi +.EE .in .PP From the above output, we see that @@ -443,12 +443,12 @@ and .IR /mntY : .PP .in +4n -.nf +.EX sh2# \fBmkdir /mntX/a\fP sh2# \fBmount /dev/sda3 /mntX/a\fP sh2# \fBmkdir /mntY/b\fP sh2# \fBmount /dev/sda5 /mntY/b\fP -.fi +.EE .in .PP When we inspect the state of the mount points in the new mount namespace, @@ -460,13 +460,13 @@ was created as a new shared mount was created as a private mount: .PP .in +4n -.nf +.EX sh2# \fBcat /proc/self/mountinfo | grep \(aq/mnt\(aq | sed \(aqs/ \- .*//\(aq\fP 168 167 8:23 / /mntX rw,relatime shared:1 169 167 8:22 / /mntY rw,relatime master:2 173 168 8:3 / /mntX/a rw,relatime shared:3 175 169 8:5 / /mntY/b rw,relatime -.fi +.EE .in .PP Returning to the first terminal (in the initial mount namespace), @@ -479,12 +479,12 @@ but the mount was not propagated: .PP .in +4n -.nf +.EX sh1# \fBcat /proc/self/mountinfo | grep \(aq/mnt\(aq | sed \(aqs/ \- .*//\(aq\fP 132 83 8:23 / /mntX rw,relatime shared:1 133 83 8:22 / /mntY rw,relatime shared:2 174 132 8:3 / /mntX/a rw,relatime shared:3 -.fi +.EE .in .PP Now we create a new mount point under @@ -492,7 +492,7 @@ Now we create a new mount point under in the first shell: .PP .in +4n -.nf +.EX sh1# \fBmkdir /mntY/c\fP sh1# \fBmount /dev/sda1 /mntY/c\fP sh1# \fBcat /proc/self/mountinfo | grep '/mnt' | sed 's/ \- .*//'\fP @@ -500,7 +500,7 @@ sh1# \fBcat /proc/self/mountinfo | grep '/mnt' | sed 's/ \- .*//'\fP 133 83 8:22 / /mntY rw,relatime shared:2 174 132 8:3 / /mntX/a rw,relatime shared:3 178 133 8:1 / /mntY/c rw,relatime shared:4 -.fi +.EE .in .PP When we examine the mount points in the second mount namespace, @@ -509,14 +509,14 @@ to the slave mount point, and that the new mount is itself a slave mount (to peer group 4): .PP .in +4n -.nf +.EX sh2# \fBcat /proc/self/mountinfo | grep \(aq/mnt\(aq | sed \(aqs/ \- .*//\(aq\fP 168 167 8:23 / /mntX rw,relatime shared:1 169 167 8:22 / /mntY rw,relatime master:2 173 168 8:3 / /mntX/a rw,relatime shared:3 175 169 8:5 / /mntY/b rw,relatime 179 169 8:1 / /mntY/c rw,relatime master:4 -.fi +.EE .in .\" .SS MS_UNBINDABLE example @@ -528,12 +528,12 @@ The problem is illustrated by the following shell session. Suppose we have a system with the following mount points: .PP .in +4n -.nf +.EX # \fBmount | awk \(aq{print $1, $2, $3}\(aq\fP /dev/sda1 on / /dev/sdb6 on /mntX /dev/sdb7 on /mntY -.fi +.EE .in .PP Suppose furthermore that we wish to recursively bind mount @@ -541,7 +541,7 @@ the root directory under several users' home directories. We do this for the first user, and inspect the mount points: .PP .in +4n -.nf +.EX # \fBmount \-\-rbind / /home/cecilia/\fP # \fBmount | awk \(aq{print $1, $2, $3}\(aq\fP /dev/sda1 on / @@ -550,14 +550,14 @@ We do this for the first user, and inspect the mount points: /dev/sda1 on /home/cecilia /dev/sdb6 on /home/cecilia/mntX /dev/sdb7 on /home/cecilia/mntY -.fi +.EE .in .PP When we repeat this operation for the second user, we start to see the explosion problem: .PP .in +4n -.nf +.EX # \fBmount \-\-rbind / /home/henry\fP # \fBmount | awk \(aq{print $1, $2, $3}\(aq\fP /dev/sda1 on / @@ -572,7 +572,7 @@ we start to see the explosion problem: /dev/sda1 on /home/henry/home/cecilia /dev/sdb6 on /home/henry/home/cecilia/mntX /dev/sdb7 on /home/henry/home/cecilia/mntY -.fi +.EE .in .PP Under @@ -588,7 +588,7 @@ Upon repeating the step for a third user, it becomes obvious that the explosion is exponential in nature: .PP .in +4n -.nf +.EX # \fBmount \-\-rbind / /home/otto\fP # \fBmount | awk \(aq{print $1, $2, $3}\(aq\fP /dev/sda1 on / @@ -615,7 +615,7 @@ it becomes obvious that the explosion is exponential in nature: /dev/sda1 on /home/otto/home/henry/home/cecilia /dev/sdb6 on /home/otto/home/henry/home/cecilia/mntX /dev/sdb7 on /home/otto/home/henry/home/cecilia/mntY -.fi +.EE .in .PP The mount explosion problem in the above scenario can be avoided @@ -625,15 +625,15 @@ directory will not replicate the unbindable mounts. We make such a mount for the first user: .PP .in +4n -.nf +.EX # \fBmount \-\-rbind \-\-make\-unbindable / /home/cecilia\fP -.fi +.EE .in .PP Before going further, we show that unbindable mounts are indeed unbindable: .PP .in +4n -.nf +.EX # \fBmkdir /mntZ\fP # \fBmount \-\-bind /home/cecilia /mntZ\fP mount: wrong fs type, bad option, bad superblock on /home/cecilia, @@ -641,16 +641,16 @@ mount: wrong fs type, bad option, bad superblock on /home/cecilia, In some cases useful info is found in syslog \- try dmesg | tail or so. -.fi +.EE .in .PP Now we create unbindable recursive bind mounts for the other two users: .PP .in +4n -.nf +.EX # \fBmount \-\-rbind \-\-make\-unbindable / /home/henry\fP # \fBmount \-\-rbind \-\-make\-unbindable / /home/otto\fP -.fi +.EE .in .PP Upon examining the list of mount points, @@ -659,7 +659,7 @@ because the unbindable mounts were not replicated under each user's directory: .PP .in +4n -.nf +.EX # \fBmount | awk \(aq{print $1, $2, $3}\(aq\fP /dev/sda1 on / /dev/sdb6 on /mntX @@ -673,7 +673,7 @@ under each user's directory: /dev/sda1 on /home/otto /dev/sdb6 on /home/otto/mntX /dev/sdb7 on /home/otto/mntY -.fi +.EE .in .\" .SS Propagation type transitions @@ -865,11 +865,11 @@ filesystem remains visible at the correct location in the chroot-ed environment. .PP .in +4n -.nf +.EX # \fBmkdir \-p /mnt/proc\fP # \fBmount \-\-bind / /mnt\fP # \fBmount \-\-bind /proc /mnt/proc\fP -.fi +.EE .in .PP Next, we ensure that the @@ -877,13 +877,13 @@ Next, we ensure that the mount is a shared mount in a new peer group (with no peers): .PP .in +4n -.nf +.EX # \fBmount \-\-make\-private /mnt\fP # Isolate from any previous peer group # \fBmount \-\-make\-shared /mnt\fP # \fBcat /proc/self/mountinfo | grep \(aq/mnt\(aq | sed \(aqs/ \- .*//\(aq\fP 239 61 8:2 / /mnt ... shared:102 248 239 0:4 / /mnt/proc ... shared:5 -.fi +.EE .in .PP Next, we bind mount @@ -892,14 +892,14 @@ onto .IR /tmp/etc : .PP .in +4n -.nf +.EX # \fBmkdir \-p /tmp/etc\fP # \fBmount \-\-bind /mnt/etc /tmp/etc\fP # \fBcat /proc/self/mountinfo | egrep \(aq/mnt|/tmp/\(aq | sed \(aqs/ \- .*//\(aq\fP 239 61 8:2 / /mnt ... shared:102 248 239 0:4 / /mnt/proc ... shared:5 267 40 8:2 /etc /tmp/etc ... shared:102 -.fi +.EE .in .PP Initially, these two mount points are in the same peer group, @@ -913,14 +913,14 @@ shared as well, so that it can propagate events to the next slave in the chain: .PP .in +4n -.nf +.EX # \fBmount \-\-make\-slave /tmp/etc\fP # \fBmount \-\-make\-shared /tmp/etc\fP # \fBcat /proc/self/mountinfo | egrep \(aq/mnt|/tmp/\(aq | sed \(aqs/ \- .*//\(aq\fP 239 61 8:2 / /mnt ... shared:102 248 239 0:4 / /mnt/proc ... shared:5 267 40 8:2 /etc /tmp/etc ... shared:105 master:102 -.fi +.EE .in .PP Then we bind mount @@ -934,7 +934,7 @@ a slave of .IR /tmp/etc : .PP .in +4n -.nf +.EX # \fBmkdir \-p /mnt/tmp/etc\fP # \fBmount \-\-bind /tmp/etc /mnt/tmp/etc\fP # \fBmount \-\-make\-slave /mnt/tmp/etc\fP @@ -961,21 +961,21 @@ directory, which renders the mount with ID 267 unreachable from the (new) root directory: .PP .in +4n -.nf +.EX # \fBchroot /mnt\fP -.fi +.EE .in .PP When we examine the state of the mounts inside the chroot-ed environment, we see the following: .PP .in +4n -.nf +.EX # \fBcat /proc/self/mountinfo | sed \(aqs/ \- .*//\(aq\fP 239 61 8:2 / / ... shared:102 248 239 0:4 / /proc ... shared:5 273 239 8:2 /etc /tmp/etc ... master:105 propagate_from:102 -.fi +.EE .in .PP Above, we see that the mount with ID 273 diff --git a/man7/namespaces.7 b/man7/namespaces.7 index 5cb0f8f96..d2da9c1f4 100644 --- a/man7/namespaces.7 +++ b/man7/namespaces.7 @@ -117,7 +117,7 @@ supports being manipulated by .BR setns (2): .PP .in +4n -.nf +.EX $ \fBls \-l /proc/$$/ns\fP total 0 lrwxrwxrwx. 1 mtk mtk 0 Apr 28 12:46 cgroup \-> cgroup:[4026531835] @@ -128,7 +128,7 @@ lrwxrwxrwx. 1 mtk mtk 0 Apr 28 12:46 pid \-> pid:[4026531836] lrwxrwxrwx. 1 mtk mtk 0 Apr 28 12:46 pid_for_children \-> pid:[4026531834] lrwxrwxrwx. 1 mtk mtk 0 Apr 28 12:46 user \-> user:[4026531837] lrwxrwxrwx. 1 mtk mtk 0 Apr 28 12:46 uts \-> uts:[4026531838] -.fi +.EE .in .PP Bind mounting (see @@ -164,10 +164,10 @@ The content of this symbolic link is a string containing the namespace type and inode number as in the following example: .PP .in +4n -.nf +.EX $ \fBreadlink /proc/$$/ns/uts\fP uts:[4026531838] -.fi +.EE .in .PP The symbolic links in this subdirectory are as follows: diff --git a/man7/netdevice.7 b/man7/netdevice.7 index d1097effe..a8f950f02 100644 --- a/man7/netdevice.7 +++ b/man7/netdevice.7 @@ -213,7 +213,7 @@ Get or set the interface's hardware parameters using Setting the parameters is a privileged operation. .IP .in +4n -.nf +.EX struct ifmap { unsigned long mem_start; unsigned long mem_end; @@ -222,7 +222,7 @@ struct ifmap { unsigned char dma; unsigned char port; }; -.fi +.EE .in .IP The interpretation of the ifmap structure depends on the device driver @@ -262,7 +262,7 @@ Unlike the others, this ioctl passes an structure: .IP .in +4n -.nf +.EX struct ifconf { int ifc_len; /* size of buffer */ union { @@ -270,7 +270,7 @@ struct ifconf { struct ifreq *ifc_req; /* array of structures */ }; }; -.fi +.EE .in .IP If diff --git a/man7/netlink.7 b/man7/netlink.7 index 973ab6f04..ac5bfa156 100644 --- a/man7/netlink.7 +++ b/man7/netlink.7 @@ -166,7 +166,7 @@ After each the payload follows. .PP .in +4n -.nf +.EX struct nlmsghdr { __u32 nlmsg_len; /* Length of message including header */ __u16 nlmsg_type; /* Type of message content */ @@ -174,7 +174,7 @@ struct nlmsghdr { __u32 nlmsg_seq; /* Sequence number */ __u32 nlmsg_pid; /* Sender port ID */ }; -.fi +.EE .in .PP .I nlmsg_type @@ -189,12 +189,12 @@ structure, message terminates a multipart message. .PP .in +4n -.nf +.EX struct nlmsgerr { int error; /* Negative errno or 0 for acknowledgements */ struct nlmsghdr msg; /* Message header that caused the error */ }; -.fi +.EE .in .PP A netlink family usually specifies more message types, see the @@ -315,14 +315,14 @@ netlink multicast groups not equal 0). .PP .in +4n -.nf +.EX struct sockaddr_nl { sa_family_t nl_family; /* AF_NETLINK */ unsigned short nl_pad; /* Zero */ pid_t nl_pid; /* Port ID */ __u32 nl_groups; /* Multicast groups mask */ }; -.fi +.EE .in .PP .I nl_pid @@ -492,7 +492,7 @@ netlink socket which will listen to the (IPv4 addresses add/delete events) multicast groups. .PP .in +4n -.nf +.EX struct sockaddr_nl sa; memset(&sa, 0, sizeof(sa)); @@ -501,7 +501,7 @@ sa.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR; fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); bind(fd, (struct sockaddr *) &sa, sizeof(sa)); -.fi +.EE .in .PP The next example demonstrates how to send a netlink message to the @@ -510,7 +510,7 @@ Note that the application must take care of message sequence numbers in order to reliably track acknowledgements. .PP .in +4n -.nf +.EX struct nlmsghdr *nh; /* The nlmsghdr with payload to send */ struct sockaddr_nl sa; struct iovec iov = { nh, nh\->nlmsg_len }; @@ -525,13 +525,13 @@ nh\->nlmsg_seq = ++sequence_number; nh\->nlmsg_flags |= NLM_F_ACK; sendmsg(fd, &msg, 0); -.fi +.EE .in .PP And the last example is about reading netlink message. .PP .in +4n -.nf +.EX int len; char buf[8192]; /* 8192 to avoid message truncation on platforms with page size > 4096 */ @@ -556,7 +556,7 @@ for (nh = (struct nlmsghdr *) buf; NLMSG_OK (nh, len); /* Continue with parsing payload */ ... } -.fi +.EE .in .SH SEE ALSO .BR cmsg (3), diff --git a/man7/packet.7 b/man7/packet.7 index adbd4dbef..afc3f633d 100644 --- a/man7/packet.7 +++ b/man7/packet.7 @@ -116,7 +116,7 @@ The structure is a device-independent physical-layer address. .PP .in +4n -.nf +.EX struct sockaddr_ll { unsigned short sll_family; /* Always AF_PACKET */ unsigned short sll_protocol; /* Physical-layer protocol */ @@ -126,7 +126,7 @@ struct sockaddr_ll { unsigned char sll_halen; /* Length of address */ unsigned char sll_addr[8]; /* Physical-layer address */ }; -.fi +.EE .in .PP The fields of this structure are as follows: @@ -205,14 +205,14 @@ They both expect a structure as argument: .IP .in +4n -.nf +.EX struct packet_mreq { int mr_ifindex; /* interface index */ unsigned short mr_type; /* action */ unsigned short mr_alen; /* address length */ unsigned char mr_address[8]; /* physical-layer address */ }; -.fi +.EE .in .IP .I mr_ifindex @@ -251,7 +251,7 @@ The structure can be read with It is defined as .IP .in +4n -.nf +.EX struct tpacket_auxdata { __u32 tp_status; __u32 tp_len; /* packet length */ @@ -261,7 +261,7 @@ struct tpacket_auxdata { __u16 tp_vlan_tci; __u16 tp_padding; }; -.fi +.EE .in .TP .BR PACKET_FANOUT " (since Linux 3.1)" @@ -412,12 +412,12 @@ in the Linux kernel source tree. Retrieve packet socket statistics in the form of a structure .IP .in +4n -.nf +.EX struct tpacket_stats { unsigned int tp_packets; /* Total packet count */ unsigned int tp_drops; /* Dropped packet count */ }; -.fi +.EE .in .IP Receiving statistics resets the internal counters. @@ -596,13 +596,13 @@ to specify an interface, which doesn't provide physical-layer independence. .PP .in +4n -.nf +.EX struct sockaddr_pkt { unsigned short spkt_family; unsigned char spkt_device[14]; unsigned short spkt_protocol; }; -.fi +.EE .in .PP .I spkt_family diff --git a/man7/pkeys.7 b/man7/pkeys.7 index c0f412d2b..c442c4d7d 100644 --- a/man7/pkeys.7 +++ b/man7/pkeys.7 @@ -173,12 +173,12 @@ It then tries to access the page, which we now expect to cause a fatal signal to the application. .PP .in +4n -.nf +.EX .RB "$" " ./a.out" buffer contains: 73 about to read buffer again... Segmentation fault (core dumped) -.fi +.EE .in .SS Program source \& diff --git a/man7/pthreads.7 b/man7/pthreads.7 index 0cf116750..e4d05f13d 100644 --- a/man7/pthreads.7 +++ b/man7/pthreads.7 @@ -233,7 +233,7 @@ wcrtomb() if its final argument is NULL wcsrtombs() if its final argument is NULL wcstombs() wctomb() -.fi +.EE .in .SS Async-cancel-safe functions An async-cancel-safe function is one that can be safely called @@ -248,7 +248,7 @@ POSIX.1-2001 and POSIX.1-2008: pthread_cancel() pthread_setcancelstate() pthread_setcanceltype() -.fi +.EE .in .SS Cancellation points POSIX.1 specifies that certain functions must, @@ -264,7 +264,7 @@ POSIX.1-2001 and/or POSIX.1-2008: .\" FIXME .\" Document the list of all functions that are cancellation points in glibc .in +4n -.nf +.EX accept() aio_suspend() clock_nanosleep() @@ -323,14 +323,14 @@ waitid() waitpid() write() writev() -.fi +.EE .in .PP The following functions may be cancellation points according to POSIX.1-2001 and/or POSIX.1-2008: .PP .in +4n -.nf +.EX access() asctime() asctime_r() @@ -556,7 +556,7 @@ wcsftime() wordexp() wprintf() wscanf() -.fi +.EE .in .PP An implementation may also mark other functions @@ -860,7 +860,7 @@ the system's threading implementation, for example: .EX bash$ getconf GNU_LIBPTHREAD_VERSION NPTL 2.3.4 -.fi +.EE .in .PP With older glibc versions, a command such as the following should @@ -871,7 +871,7 @@ be sufficient to determine the default threading implementation: bash$ $( ldd /bin/ls | grep libc.so | awk \(aq{print $3}\(aq ) | \\ egrep \-i \(aqthreads|nptl\(aq Native POSIX Threads Library by Ulrich Drepper et al -.fi +.EE .in .SS Selecting the threading implementation: LD_ASSUME_KERNEL On systems with a glibc that supports both LinuxThreads and NPTL @@ -894,7 +894,7 @@ For example: bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\ awk \(aq{print $3}\(aq ) | egrep \-i \(aqthreads|nptl\(aq linuxthreads-0.10 by Xavier Leroy -.fi +.EE .in .SH SEE ALSO .ad l diff --git a/man7/sched.7 b/man7/sched.7 index 45c32c22a..9f01ddbaf 100644 --- a/man7/sched.7 +++ b/man7/sched.7 @@ -245,7 +245,7 @@ is thus obtained by adding the relative deadline to the arrival time. The following diagram clarifies these terms: .PP .in +4n -.nf +.EX arrival/wakeup absolute deadline | start time | | | | @@ -254,7 +254,7 @@ arrival/wakeup absolute deadline |<- comp. time ->| |<------- relative deadline ------>| |<-------------- period ------------------->| -.fi +.EE .in .PP When setting a @@ -275,7 +275,7 @@ Thus, for scheduling, we have: .PP .in +4n -.nf +.EX arrival/wakeup absolute deadline | start time | | | | @@ -284,7 +284,7 @@ arrival/wakeup absolute deadline |<-- Runtime ------->| |<----------- Deadline ----------->| |<-------------- Period ------------------->| -.fi +.EE .in .PP The three deadline-scheduling parameters correspond to the @@ -755,10 +755,10 @@ A process's autogroup (task group) membership can be viewed via the file .IR /proc/[pid]/autogroup : .PP .in +4n -.nf +.EX $ \fBcat /proc/1/autogroup\fP /autogroup-1 nice 0 -.fi +.EE .in .PP This file can also be used to modify the CPU bandwidth allocated @@ -879,9 +879,9 @@ the following to modify the autogroup nice value for of the processes in a terminal session: .PP .in +4n -.nf +.EX $ \fBecho 10 > /proc/self/autogroup\fP -.fi +.EE .in .SS Real-time features in the mainline Linux kernel .\" FIXME . Probably this text will need some minor tweaking @@ -899,7 +899,7 @@ These patches are named: .in +4n .EX patch-\fIkernelversion\fP-rt\fIpatchversion\fP -.fi +.EE .in .PP and can be downloaded from diff --git a/man7/session-keyring.7 b/man7/session-keyring.7 index 82a88d8d7..b808f73c4 100644 --- a/man7/session-keyring.7 +++ b/man7/session-keyring.7 @@ -86,19 +86,19 @@ These operations are also exposed through the utility as: .PP .in +4n -.nf +.EX keyctl session keyctl session - [ ...] keyctl session [ ...] -.fi +.EE .in .PP and: .PP .in +4n -.nf +.EX keyctl new_session -.fi +.EE .in .SH SEE ALSO .ad l diff --git a/man7/sock_diag.7 b/man7/sock_diag.7 index 86257bed4..206d01eca 100644 --- a/man7/sock_diag.7 +++ b/man7/sock_diag.7 @@ -72,12 +72,12 @@ It is followed by a header specific to the address family that starts with a common part shared by all address families: .PP .in +4n -.nf +.EX struct sock_diag_req { __u8 sdiag_family; __u8 sdiag_protocol; }; -.fi +.EE .in .PP The fields of this structure are as follows: @@ -129,7 +129,7 @@ API. For UNIX domain sockets the request is represented in the following structure: .PP .in +4n -.nf +.EX struct unix_diag_req { __u8 sdiag_family; __u8 sdiag_protocol; @@ -139,7 +139,7 @@ struct unix_diag_req { __u32 udiag_show; __u32 udiag_cookie[2]; }; -.fi +.EE .in .PP The fields of this structure are as follows: @@ -194,12 +194,12 @@ The payload associated with this attribute is represented in the following structure: .IP .in +4n -.nf +.EX struct unix_diag_vfs { __u32 udiag_vfs_dev; __u32 udiag_vfs_ino; }; -.fi +.EE .in .IP The fields of this structure are as follows: @@ -237,12 +237,12 @@ The payload associated with this attribute is represented in the following structure: .IP .in +4n -.nf +.EX struct unix_diag_rqlen { __u32 udiag_rqueue; __u32 udiag_wqueue; }; -.fi +.EE .in .IP The fields of this structure are as follows: @@ -292,7 +292,7 @@ of sockets, as well as when all its elements are set to \-1. The response to a query for UNIX domain sockets is represented as an array of .PP .in +4n -.nf +.EX struct unix_diag_msg { __u8 udiag_family; __u8 udiag_type; @@ -301,7 +301,7 @@ struct unix_diag_msg { __u32 udiag_ino; __u32 udiag_cookie[2]; }; -.fi +.EE .in .PP followed by netlink attributes. @@ -340,7 +340,7 @@ For IPv4 and IPv6 sockets, the request is represented in the following structure: .PP .in +4n -.nf +.EX struct inet_diag_req_v2 { __u8 sdiag_family; __u8 sdiag_protocol; @@ -349,7 +349,7 @@ struct inet_diag_req_v2 { __u32 idiag_states; struct inet_diag_sockid id; }; -.fi +.EE .in .PP where @@ -357,7 +357,7 @@ where is defined as follows: .PP .in +4n -.nf +.EX struct inet_diag_sockid { __be16 idiag_sport; __be16 idiag_dport; @@ -366,7 +366,7 @@ struct inet_diag_sockid { __u32 idiag_if; __u32 idiag_cookie[2]; }; -.fi +.EE .in .PP The fields of @@ -411,14 +411,14 @@ The payload associated with this attribute is represented in the following structure: .IP .in +4n -.nf +.EX struct inet_diag_meminfo { __u32 idiag_rmem; __u32 idiag_wmem; __u32 idiag_fmem; __u32 idiag_tmem; }; -.fi +.EE .in .IP The fields of this structure are as follows: @@ -495,7 +495,7 @@ when all its elements are set to \-1. The response to a query for IPv4 or IPv6 sockets is represented as an array of .PP .in +4n -.nf +.EX struct inet_diag_msg { __u8 idiag_family; __u8 idiag_state; @@ -510,7 +510,7 @@ struct inet_diag_msg { __u32 idiag_uid; __u32 idiag_inode; }; -.fi +.EE .in .PP followed by netlink attributes. diff --git a/man7/socket.7 b/man7/socket.7 index 45f36e002..193435d0c 100644 --- a/man7/socket.7 +++ b/man7/socket.7 @@ -274,9 +274,9 @@ The structure includes the following field, which can be used to identify the type of socket address actually stored in the structure: .PP .in +4n -.nf +.EX sa_family_t ss_family; -.fi +.EE .in .PP The @@ -497,11 +497,11 @@ Sets or gets the CPU affinity of a socket. Expects an integer flag. .IP .in +4n -.nf +.EX int cpu = 1; socklen_t len = sizeof(cpu); setsockopt(fd, SOL_SOCKET, SO_INCOMING_CPU, &cpu, &len); -.fi +.EE .in .IP Because all of the packets for a single stream @@ -680,7 +680,7 @@ The following sequence of calls would have the effect noted in the comments: .IP .in +4n -.nf +.EX int ov = 4; // Set peek offset to 4 setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov)); @@ -688,7 +688,7 @@ recv(fd, buf, 2, MSG_PEEK); // Peeks "cc"; offset set to 6 recv(fd, buf, 2, MSG_PEEK); // Peeks "dd"; offset set to 8 recv(fd, buf, 2, 0); // Reads "aa"; offset set to 6 recv(fd, buf, 2, MSG_PEEK); // Peeks "ee"; offset set to 8 -.fi +.EE .in .TP .B SO_PEERCRED @@ -1039,9 +1039,9 @@ These operations can be accessed using .BR ioctl (2): .PP .in +4n -.nf +.EX .IB error " = ioctl(" ip_socket ", " ioctl_type ", " &value_result ");" -.fi +.EE .in .TP .B SIOCGSTAMP diff --git a/man7/spufs.7 b/man7/spufs.7 index 675e02762..8a5fb6299 100644 --- a/man7/spufs.7 +++ b/man7/spufs.7 @@ -570,7 +570,7 @@ file contains the contents of the SPU MFC DMA queue, represented as the following structure: .IP .in +4n -.nf +.EX struct spu_dma_info { uint64_t dma_info_type; uint64_t dma_info_mask; @@ -579,7 +579,7 @@ struct spu_dma_info { uint64_t dma_info_atomic_command_status; struct mfc_cq_sr dma_info_command_data[16]; }; -.fi +.EE .in .IP The last member of this data structure is the actual DMA queue, @@ -589,14 +589,14 @@ The structure is defined as: .IP .in +4n -.nf +.EX struct mfc_cq_sr { uint64_t mfc_cq_data0_RW; uint64_t mfc_cq_data1_RW; uint64_t mfc_cq_data2_RW; uint64_t mfc_cq_data3_RW; }; -.fi +.EE .in .IP The @@ -606,14 +606,14 @@ file contains similar information, but describes the proxy DMA queue The file is in the following format: .IP .in +4n -.nf +.EX struct spu_proxydma_info { uint64_t proxydma_info_type; uint64_t proxydma_info_mask; uint64_t proxydma_info_status; struct mfc_cq_sr proxydma_info_command_data[8]; }; -.fi +.EE .in .IP Accessing these files requires that the SPU context is scheduled out - @@ -655,7 +655,7 @@ Writes to this file need to be in the format of a MFC DMA command, defined as follows: .IP .in +4n -.nf +.EX struct mfc_dma_command { int32_t pad; /* reserved */ uint32_t lsa; /* local storage address */ @@ -665,7 +665,7 @@ struct mfc_dma_command { uint16_t class; /* class ID */ uint16_t cmd; /* command opcode */ }; -.fi +.EE .in .IP Writes are required to be exactly diff --git a/man7/udplite.7 b/man7/udplite.7 index d47c5c6d6..e216216d8 100644 --- a/man7/udplite.7 +++ b/man7/udplite.7 @@ -141,7 +141,7 @@ Where glibc support is missing, the following definitions are needed: .\" The following two are defined in the kernel in linux/net/udplite.h #define UDPLITE_SEND_CSCOV 10 #define UDPLITE_RECV_CSCOV 11 -.fi +.EE .in .SH SEE ALSO .BR ip (7), diff --git a/man7/unix.7 b/man7/unix.7 index 5b29d4d9a..3b5848937 100644 --- a/man7/unix.7 +++ b/man7/unix.7 @@ -66,7 +66,7 @@ struct sockaddr_un { sa_family_t sun_family; /* AF_UNIX */ char sun_path[108]; /* pathname */ }; -.fi +.EE .in .PP The @@ -383,13 +383,13 @@ Thus structure is defined in as follows: .IP .in +4n -.nf +.EX struct ucred { pid_t pid; /* process ID of the sending process */ uid_t uid; /* user ID of the sending process */ gid_t gid; /* group ID of the sending process */ }; -.fi +.EE .in .IP Since glibc 2.8, the @@ -673,7 +673,7 @@ if (getsockname(sfd, (struct sockaddr *) addrp, &addrlen)) == \-1) /* handle error */ ; printf("sun_path = %s\\n", ((struct sockaddr_un *) addrp)\->sun_path); -.fi +.EE .in .PP This sort of messiness can be avoided if it is guaranteed @@ -699,7 +699,7 @@ and repeatedly executing the client. Execution of the server program ends when it receives the "DOWN" command. .SS Example output .in +4n -.nf +.EX $ \fB./server &\fP [1] 25887 $ \fB./client 3 4\fP @@ -710,7 +710,7 @@ $ \fB./client DOWN\fP Result = 0 [1]+ Done ./server $ -.fi +.EE .in .SS Program source .EX diff --git a/man7/user_namespaces.7 b/man7/user_namespaces.7 index 7af73639c..cb5f4e981 100644 --- a/man7/user_namespaces.7 +++ b/man7/user_namespaces.7 @@ -460,10 +460,10 @@ file is the same) from a shell in the initial namespace shows: .PP .in +4n -.nf +.EX $ \fBcat /proc/$$/uid_map\fP 0 0 4294967295 -.fi +.EE .in .PP This mapping tells us @@ -933,14 +933,14 @@ The following shell session demonstrates its use. First, we look at the run-time environment: .PP .in +4n -.nf +.EX $ \fBuname \-rs\fP # Need Linux 3.8 or later Linux 3.8.0 $ \fBid \-u\fP # Running as unprivileged user 1000 $ \fBid \-g\fP 1000 -.fi +.EE .in .PP Now start a new shell in new user @@ -956,19 +956,19 @@ and group ID 1000 mapped to 0 inside the user namespace: .PP .in +4n -.nf +.EX $ \fB./userns_child_exec \-p \-m \-U \-M '0 1000 1' \-G '0 1000 1' bash\fP -.fi +.EE .in .PP The shell has PID 1, because it is the first process in the new PID namespace: .PP .in +4n -.nf +.EX bash$ \fBecho $$\fP 1 -.fi +.EE .in Mounting a new .I /proc @@ -977,20 +977,20 @@ in the new PID namespace shows that the shell can't see any processes outside the PID namespace: .PP .in +4n -.nf +.EX bash$ \fBmount \-t proc proc /proc\fP bash$ \fBps ax\fP PID TTY STAT TIME COMMAND 1 pts/3 S 0:00 bash 22 pts/3 R+ 0:00 ps ax -.fi +.EE .in .PP Inside the user namespace, the shell has user and group ID 0, and a full set of permitted and effective capabilities: .PP .in +4n -.nf +.EX bash$ \fBcat /proc/$$/status | egrep '^[UG]id'\fP Uid: 0 0 0 0 Gid: 0 0 0 0 @@ -998,7 +998,7 @@ bash$ \fBcat /proc/$$/status | egrep '^Cap(Prm|Inh|Eff)'\fP CapInh: 0000000000000000 CapPrm: 0000001fffffffff CapEff: 0000001fffffffff -.fi +.EE .in .SS Program source \& diff --git a/man7/vdso.7 b/man7/vdso.7 index 2e4998ff4..f6e7c93f6 100644 --- a/man7/vdso.7 +++ b/man7/vdso.7 @@ -583,5 +583,5 @@ Documentation/ia64/fsys.txt Documentation/vDSO/* (includes examples of using the vDSO) find arch/ -iname '*vdso*' -o -iname '*gate*' -.fi +.EE .in diff --git a/man7/x25.7 b/man7/x25.7 index e2a346255..dd9b47fac 100644 --- a/man7/x25.7 +++ b/man7/x25.7 @@ -53,12 +53,12 @@ for representing network addresses as defined in ITU-T recommendation X.121. .PP .in +4n -.nf +.EX struct sockaddr_x25 { sa_family_t sx25_family; /* must be AF_X25 */ x25_address sx25_addr; /* X.121 Address */ }; -.fi +.EE .in .PP .I sx25_addr diff --git a/man8/ld.so.8 b/man8/ld.so.8 index 04d9b3fe8..f24ab2db0 100644 --- a/man8/ld.so.8 +++ b/man8/ld.so.8 @@ -240,9 +240,9 @@ the shared objects required by .IR myprog : .IP .in +4n -.nf +.EX $ \fBLD_ASSUME_KERNEL=2.2.5 ./myprog\fP -.fi +.EE .in .IP On systems that provide multiple versions of a shared object