intro.1, locale.1, ioctl_list.2, listxattr.2, memfd_create.2, nfsservctl.2, open_by_handle_at.2, perf_event_open.2, poll.2, process_vm_readv.2, ptrace.2, select.2, select_tut.2, semop.2, sendmmsg.2, shmget.2, sigaction.2, spu_run.2, umask.2, wait4.2, nan.3, setlocale.3, feature_test_macros.7, glob.7, posixoptions.7, rtld-audit.7: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-08-19 12:56:40 +02:00
parent 9c40f2b9ba
commit 408731d435
26 changed files with 387 additions and 410 deletions

View File

@ -75,8 +75,8 @@ See also
.PP
A session might go like:
.PP
.RS
.nf
.in +4n
.EX
.RB "knuth login: " aeb
.RB "Password: " ********
.RB "$ " date
@ -116,8 +116,8 @@ drwxr\-xr\-x 2 aeb 1024 Aug 6 23:51 bin
.RB "$ " "grep maja tel2"
maja 0501\-1136285
$
.fi
.RE
.EE
.in
.PP
Here typing Control-D ended the session.
.PP

View File

@ -194,13 +194,13 @@ and
in the shell profile file so that the custom locale will be used in the
subsequent user sessions:
.PP
.nf
.EX
$ \fBmkdir -p $HOME/.locale\fP
$ \fBI18NPATH=./wrk/ localedef -f UTF-8 -i fi_SE $HOME/.locale/fi_SE.UTF-8\fP
$ \fBLOCPATH=$HOME/.locale LC_ALL=fi_SE.UTF-8 date\fP
$ \fBecho "export LOCPATH=\\$HOME/.locale" >> $HOME/.bashrc\fP
$ \fBecho "export LANG=fi_SE.UTF-8" >> $HOME/.bashrc\fP
.fi
.EE
.SH SEE ALSO
.BR localedef (1),
.BR charmap (5),

View File

@ -871,14 +871,14 @@ For
most drivers use CD_FRAMESIZE, but the Optics Storage
driver uses OPT_BLOCKSIZE instead (both have the numerical value
2048).
.PP
.nf
CDROMREADCOOKED char [CD_FRAMESIZE]
CDROMREADMODE1 char [CD_FRAMESIZE or OPT_BLOCKSIZE]
CDROMREADMODE2 char [CD_FRAMESIZE_RAW0]
CDROMREADRAW char [CD_FRAMESIZE_RAW]
.fi
.PP
.BR EQL_ENSLAVE ,
.BR EQL_EMANCIPATE ,
.BR EQL_GETSLAVECFG ,
@ -891,16 +891,16 @@ take a
The
.I ifr_data
field is a pointer to another structure as follows:
.PP
.nf
EQL_ENSLAVE const struct slaving_request *
EQL_EMANCIPATE const struct slaving_request *
EQL_GETSLAVECFG struct slave_config * // I-O
EQL_SETSLAVECFG const struct slave_config *
EQL_GETMASTERCFG struct master_config *
EQL_SETMASTERCFG const struct master_config *
.fi
.PP
.B FDRAWCMD
takes a
.IR "struct floppy raw_cmd\ *" .
@ -972,14 +972,14 @@ and
.B SIOCDELRT
take an input pointer whose type depends on
the protocol:
.PP
.nf
Most protocols const struct rtentry *
AX.25 const struct ax25_route *
NET/ROM const struct nr_route_struct *
INET6 const struct in6_rtmsg *
.fi
.PP
.B SIOCGIFCONF
takes a
.IR "struct ifconf\ *" .
@ -992,12 +992,12 @@ bytes, into which the kernel writes a list of type
.PP
.B SIOCSIFHWADDR
takes an input pointer whose type depends on the protocol:
.PP
.nf
Most protocols const struct ifreq *
AX.25 const char [AX25_ADDR_LEN]
.fi
.PP
.B TIOCLINUX
takes a
.IR "const char\ *" .
@ -1011,8 +1011,8 @@ after an N-byte pad.
.I struct selection
is implicitly defined in
.IR drivers/char/selection.c
.PP
.nf
TIOCLINUX-2 1 + const struct selection *
TIOCLINUX-3 void
TIOCLINUX-4 void
@ -1020,8 +1020,8 @@ is implicitly defined in
TIOCLINUX-6 char *
TIOCLINUX-7 char *
TIOCLINUX-10 1 + const char *
.fi
.PP
// Duplicate ioctls
.PP
This list does not include ioctls in the range

View File

@ -106,10 +106,10 @@ The
.I list
of names is returned as an unordered array of null-terminated character
strings (attribute names are separated by null bytes (\(aq\\0\(aq)), like this:
.PP
.fam C
.RS
.nf
user.name1\\0system.name1\\0user.name2\\0
.fi
.RE
@ -119,10 +119,10 @@ Filesystems that implement POSIX ACLs using
extended attributes might return a
.I list
like this:
.PP
.fam C
.RS
.nf
system.posix_acl_access\\0system.posix_acl_default\\0
.fi
.RE
@ -217,7 +217,7 @@ user.empty: <no value>
.EE
.in
.SS Program source (listxattr.c)
.nf
.EX
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
@ -330,7 +330,7 @@ main(int argc, char *argv[])
free(buf);
exit(EXIT_SUCCESS);
}
.fi
.EE
.SH SEE ALSO
.BR getfattr (1),
.BR setfattr (1),

View File

@ -358,7 +358,7 @@ Existing seals: WRITE SHRINK
.in
.SS Program source: t_memfd_create.c
\&
.nf
.EX
#include <sys/memfd.h>
#include <fcntl.h>
#include <stdlib.h>
@ -437,10 +437,10 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
.fi
.EE
.SS Program source: t_get_seals.c
\&
.nf
.EX
#include <sys/memfd.h>
#include <fcntl.h>
#include <unistd.h>
@ -486,7 +486,7 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
.fi
.EE
.SH SEE ALSO
.BR fcntl (2),
.BR ftruncate (2),

View File

@ -20,19 +20,20 @@ It has been replaced by a set of files in the
filesystem; see
.BR nfsd (7).
.PP
.nf
.in +4n
.EX
/*
* These are the commands understood by nfsctl().
*/
#define NFSCTL_SVC 0 /* This is a server process. */
#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
#define NFSCTL_EXPORT 3 /* Export a filesystem. */
#define NFSCTL_UNEXPORT 4 /* Unexport a filesystem. */
#define NFSCTL_UGIDUPDATE 5 /* Update a client's UID/GID map
(only in Linux 2.4.x and earlier). */
#define NFSCTL_GETFH 6 /* Get a file handle (used by mountd)
(only in Linux 2.4.x and earlier). */
#define NFSCTL_SVC 0 /* This is a server process. */
#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
#define NFSCTL_EXPORT 3 /* Export a filesystem. */
#define NFSCTL_UNEXPORT 4 /* Unexport a filesystem. */
#define NFSCTL_UGIDUPDATE 5 /* Update a client's UID/GID map
(only in Linux 2.4.x and earlier). */
#define NFSCTL_GETFH 6 /* Get a file handle (used by mountd)
(only in Linux 2.4.x and earlier). */
struct nfsctl_arg {
int ca_version; /* safeguard */
@ -50,7 +51,8 @@ union nfsctl_res {
struct knfs_fh cr_getfh;
unsigned int cr_debug;
};
.fi
.EE
.in
.SH RETURN VALUE
On success, zero is returned.
On error, \-1 is returned, and

View File

@ -505,7 +505,7 @@ open_by_handle_at: Stale NFS file handle
.in
.SS Program source: t_name_to_handle_at.c
\&
.nf
.EX
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
@ -575,10 +575,10 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
.fi
.EE
.SS Program source: t_open_by_handle_at.c
\&
.nf
.EX
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
@ -715,7 +715,7 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
.fi
.EE
.SH SEE ALSO
.BR open (2),
.BR libblkid (3),

View File

@ -540,9 +540,9 @@ then we are measuring a hardware CPU cache event.
To calculate the appropriate
.I config
value use the following equation:
.PP
.RS 4
.nf
(perf_hw_cache_id) | (perf_hw_cache_op_id << 8) |
(perf_hw_cache_op_result_id << 16)
.fi
@ -1618,8 +1618,8 @@ these fields can be used to compute the time
delta since
.I time_enabled
(in nanoseconds) using rdtsc or similar.
.IP
.nf
u64 quot, rem;
u64 delta;
quot = (cyc >> time_shift);
@ -1638,8 +1638,8 @@ are read in the
seqcount loop described above.
This delta can then be added to
enabled and possible running (if idx), improving the scaling:
.IP
.nf
enabled += delta;
if (idx)
running += delta;
@ -3265,8 +3265,8 @@ the wrong thing on AMD machines until Linux 2.6.35.
The following is a short example that measures the total
instruction count of a call to
.BR printf (3).
.nf
.PP
.EX
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@ -3319,7 +3319,7 @@ main(int argc, char **argv)
close(fd);
}
.fi
.EE
.SH SEE ALSO
.BR fcntl (2),
.BR mmap (2),

View File

@ -264,25 +264,29 @@ Other than the difference in the precision of the
argument, the following
.BR ppoll ()
call:
.nf
ready = ppoll(&fds, nfds, tmo_p, &sigmask);
.fi
.PP
.in +4n
.EX
ready = ppoll(&fds, nfds, tmo_p, &sigmask);
.EE
.in
.PP
is equivalent to
.I atomically
executing the following calls:
.nf
.PP
.in +4n
.EX
sigset_t origmask;
int timeout;
sigset_t origmask;
int timeout;
timeout = (tmo_p == NULL) ? \-1 :
(tmo_p\->tv_sec * 1000 + tmo_p\->tv_nsec / 1000000);
pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);
ready = poll(&fds, nfds, timeout);
pthread_sigmask(SIG_SETMASK, &origmask, NULL);
.fi
timeout = (tmo_p == NULL) ? \-1 :
(tmo_p\->tv_sec * 1000 + tmo_p\->tv_nsec / 1000000);
pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);
ready = poll(&fds, nfds, timeout);
pthread_sigmask(SIG_SETMASK, &origmask, NULL);
.EE
.in
.PP
See the description of
.BR pselect (2)

View File

@ -309,7 +309,7 @@ and writes the first 10 bytes into
and the second 10 bytes into
.IR buf2 .
.PP
.nf
.EX
#include <sys/uio.h>
int
@ -335,7 +335,7 @@ main(void)
else
return 0;
}
.fi
.EE
.SH SEE ALSO
.BR readv (2),
.BR writev (2)

View File

@ -404,8 +404,8 @@ field includes information
.BR __SI_FAULT ,
etc.) that are not otherwise exposed to user space.
.PP
.in +10n
.nf
.in +4n
.EX
struct ptrace_peeksiginfo_args {
u64 off; /* Ordinal position in queue at which
to start copying signals */
@ -1181,16 +1181,18 @@ flag may cause
to return 0 ("no wait results available yet")
even if the tracer knows there should be a notification.
Example:
.nf
errno = 0;
ptrace(PTRACE_CONT, pid, 0L, 0L);
if (errno == ESRCH) {
/* tracee is dead */
r = waitpid(tracee, &status, __WALL | WNOHANG);
/* r can still be 0 here! */
}
.fi
.PP
.in +4n
.EX
errno = 0;
ptrace(PTRACE_CONT, pid, 0L, 0L);
if (errno == ESRCH) {
/* tracee is dead */
r = waitpid(tracee, &status, __WALL | WNOHANG);
/* r can still be 0 here! */
}
.EE
.in
.\" FIXME .
.\" waitid usage? WNOWAIT?
.\" describe how wait notifications queue (or not queue)
@ -1815,18 +1817,20 @@ the tracer can read and write data to
the tracee using informational commands.
These commands leave the tracee in ptrace-stopped state:
.PP
.nf
ptrace(PTRACE_PEEKTEXT/PEEKDATA/PEEKUSER, pid, addr, 0);
ptrace(PTRACE_POKETEXT/POKEDATA/POKEUSER, pid, addr, long_val);
ptrace(PTRACE_GETREGS/GETFPREGS, pid, 0, &struct);
ptrace(PTRACE_SETREGS/SETFPREGS, pid, 0, &struct);
ptrace(PTRACE_GETREGSET, pid, NT_foo, &iov);
ptrace(PTRACE_SETREGSET, pid, NT_foo, &iov);
ptrace(PTRACE_GETSIGINFO, pid, 0, &siginfo);
ptrace(PTRACE_SETSIGINFO, pid, 0, &siginfo);
ptrace(PTRACE_GETEVENTMSG, pid, 0, &long_var);
ptrace(PTRACE_SETOPTIONS, pid, 0, PTRACE_O_flags);
.fi
.in +4n
.EX
ptrace(PTRACE_PEEKTEXT/PEEKDATA/PEEKUSER, pid, addr, 0);
ptrace(PTRACE_POKETEXT/POKEDATA/POKEUSER, pid, addr, long_val);
ptrace(PTRACE_GETREGS/GETFPREGS, pid, 0, &struct);
ptrace(PTRACE_SETREGS/SETFPREGS, pid, 0, &struct);
ptrace(PTRACE_GETREGSET, pid, NT_foo, &iov);
ptrace(PTRACE_SETREGSET, pid, NT_foo, &iov);
ptrace(PTRACE_GETSIGINFO, pid, 0, &siginfo);
ptrace(PTRACE_SETSIGINFO, pid, 0, &siginfo);
ptrace(PTRACE_GETEVENTMSG, pid, 0, &long_var);
ptrace(PTRACE_SETOPTIONS, pid, 0, PTRACE_O_flags);
.EE
.in
.PP
Note that some errors are not reported.
For example, setting signal information
@ -2714,29 +2718,39 @@ file descriptor.
The usual symptom of this bug is that when you attach to
a quiescent process with the command
.PP
strace \-p <process-ID>
.in +4n
.EX
strace \-p <process-ID>
.EE
.in
.PP
then, instead of the usual
and expected one-line output such as
.nf
restart_syscall(<... resuming interrupted call ...>_
.fi
.PP
.in +4n
.EX
restart_syscall(<... resuming interrupted call ...>_
.EE
.in
.PP
or
.nf
select(6, [5], NULL, [5], NULL_
.fi
.PP
.in +4n
.EX
select(6, [5], NULL, [5], NULL_
.EE
.in
.PP
('_' denotes the cursor position), you observe more than one line.
For example:
.nf
.PP
.in +4n
.EX
clock_gettime(CLOCK_MONOTONIC, {15370, 690928118}) = 0
epoll_wait(4,_
.fi
.EE
.in
.PP
What is not visible here is that the process was blocked in
.BR epoll_wait (2)
before

View File

@ -219,23 +219,28 @@ Other than the difference in the precision of the
argument, the following
.BR pselect ()
call:
.nf
ready = pselect(nfds, &readfds, &writefds, &exceptfds,
timeout, &sigmask);
.fi
.PP
.in +4n
.EX
ready = pselect(nfds, &readfds, &writefds, &exceptfds,
timeout, &sigmask);
.EE
.in
.PP
is equivalent to
.I atomically
executing the following calls:
.nf
.PP
.in +4n
.EX
sigset_t origmask;
sigset_t origmask;
pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);
ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);
pthread_sigmask(SIG_SETMASK, &origmask, NULL);
.fi
pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);
ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);
pthread_sigmask(SIG_SETMASK, &origmask, NULL);
.EE
.in
.PP
.PP
The reason that
.BR pselect ()
@ -553,9 +558,9 @@ The final argument of the
system call is not a
.I "sigset_t\ *"
pointer, but is instead a structure of the form:
.PP
.in +4
.nf
.EX
struct {
const kernel_sigset_t *ss; /* Pointer to signal set */
size_t ss_len; /* Size (in bytes) of object
@ -651,7 +656,7 @@ but the glibc wrapper hides this behavior by internally copying the
.I timeout
to a local variable and passing that variable to the system call.
.SH EXAMPLE
.nf
.EX
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
@ -688,7 +693,7 @@ main(void)
exit(EXIT_SUCCESS);
}
.fi
.EE
.SH SEE ALSO
.BR accept (2),
.BR connect (2),

View File

@ -251,7 +251,7 @@ call would enable
by using an empty signal mask.
Our program would look like:
.PP
.nf
.EX
static volatile sig_atomic_t got_SIGCHLD = 0;
static void
@ -305,7 +305,7 @@ main(int argc, char *argv[])
/* main body of program */
}
}
.fi
.EE
.SS Practical
So what is the point of
.BR select ()?
@ -474,12 +474,14 @@ function, you can call
with a finite timeout and no file descriptors as
follows:
.PP
.nf
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 200000; /* 0.2 seconds */
select(0, NULL, NULL, NULL, &tv);
.fi
.in +4n
.EX
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 200000; /* 0.2 seconds */
select(0, NULL, NULL, NULL, &tv);
.EE
.in
.PP
This is guaranteed to work only on UNIX systems, however.
.SH RETURN VALUE
@ -532,7 +534,7 @@ Here is an example that better demonstrates the true utility of
The listing below is a TCP forwarding program that forwards
from one TCP port to another.
.PP
.nf
.EX
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@ -797,7 +799,7 @@ main(int argc, char *argv[])
}
exit(EXIT_SUCCESS);
}
.fi
.EE
.PP
The above program properly forwards most kinds of TCP connections
including OOB signal data transmitted by \fBtelnet\fP servers.

View File

@ -522,26 +522,28 @@ The following code segment uses
.BR semop ()
to atomically wait for the value of semaphore 0 to become zero,
and then increment the semaphore value by one.
.nf
.PP
.in +4n
.EX
struct sembuf sops[2];
int semid;
struct sembuf sops[2];
int semid;
/* Code to set \fIsemid\fP omitted */
/* Code to set \fIsemid\fP omitted */
sops[0].sem_num = 0; /* Operate on semaphore 0 */
sops[0].sem_op = 0; /* Wait for value to equal 0 */
sops[0].sem_flg = 0;
sops[0].sem_num = 0; /* Operate on semaphore 0 */
sops[0].sem_op = 0; /* Wait for value to equal 0 */
sops[0].sem_flg = 0;
sops[1].sem_num = 0; /* Operate on semaphore 0 */
sops[1].sem_op = 1; /* Increment value by one */
sops[1].sem_flg = 0;
sops[1].sem_num = 0; /* Operate on semaphore 0 */
sops[1].sem_op = 1; /* Increment value by one */
sops[1].sem_flg = 0;
if (semop(semid, sops, 2) == \-1) {
perror("semop");
exit(EXIT_FAILURE);
}
.fi
if (semop(semid, sops, 2) == \-1) {
perror("semop");
exit(EXIT_FAILURE);
}
.EE
.in
.SH SEE ALSO
.BR clone (2),
.BR semctl (2),

View File

@ -175,7 +175,7 @@ and
in two distinct UDP datagrams using one system call.
The contents of the first datagram originates from a pair of buffers.
.PP
.nf
.EX
#define _GNU_SOURCE
#include <netinet/ip.h>
#include <stdio.h>
@ -232,7 +232,7 @@ main(void)
exit(0);
}
.fi
.EE
.SH SEE ALSO
.BR recvmmsg (2),
.BR sendmsg (2),

View File

@ -124,7 +124,6 @@ the base-2 logarithm of the desired page size in the six bits at the offset
.BR SHM_HUGE_SHIFT .
Thus, the above two constants are defined as:
.IP
.nf
.in +4
.EX
#define SHM_HUGE_2MB (21 << SHM_HUGE_SHIFT)

View File

@ -546,9 +546,11 @@ will contain
.BR SIGTRAP
and have the ptrace event in the high byte:
.PP
.nf
(SIGTRAP | PTRACE_EVENT_foo << 8).
.fi
.in +4n
.EX
(SIGTRAP | PTRACE_EVENT_foo << 8).
.EE
.in
.PP
For a
.RB non- ptrace (2)

View File

@ -210,7 +210,7 @@ program with the
.BR spu_run ()
system call.
.PP
.nf
.EX
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
@ -258,7 +258,7 @@ int main(void)
exit(EXIT_SUCCESS);
}
.fi
.EE
.\" .SH AUTHORS
.\" Arnd Bergmann <arndb@de.ibm.com>, Jeremy Kerr <jk@ozlabs.org>
.SH SEE ALSO

View File

@ -92,18 +92,22 @@ In the usual case where the
argument to
.BR open (2)
is specified as:
.nf
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH
.fi
.PP
.in +4n
.EX
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH
.EE
.in
.PP
(octal 0666) when creating a new file, the permissions on the
resulting file will be:
.nf
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
.fi
.PP
.in +4n
.EX
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
.EE
.in
.PP
(because 0666 & ~022 = 0644; i.e., rw\-r\-\-r\-\-).
.SH RETURN VALUE
This system call always succeeds and the previous value of the mask

View File

@ -88,31 +88,39 @@ Other than the use of the
argument, the following
.BR wait3 ()
call:
.nf
wait3(wstatus, options, rusage);
.fi
.PP
.in +4n
.EX
wait3(wstatus, options, rusage);
.EE
.in
.PP
is equivalent to:
.nf
waitpid(\-1, wstatus, options);
.fi
.PP
.in +4n
.EX
waitpid(\-1, wstatus, options);
.EE
.in
.PP
Similarly, the following
.BR wait4 ()
call:
.nf
wait4(pid, wstatus, options, rusage);
.fi
.PP
.in +4n
.EX
wait4(pid, wstatus, options, rusage);
.EE
.in
.PP
is equivalent to:
.nf
waitpid(pid, wstatus, options);
.fi
.PP
.in +4n
.EX
waitpid(pid, wstatus, options);
.EE
.in
.PP
In other words,
.BR wait3 ()
waits of any child, while

View File

@ -46,9 +46,11 @@ The call
.I nan("char-sequence")
is equivalent to:
.PP
.nf
strtod("NAN(char-sequence)", NULL);
.fi
.in +4n
.EX
strtod("NAN(char-sequence)", NULL);
.EE
.in
.PP
Similarly, calls to
.BR nanf ()

View File

@ -143,11 +143,13 @@ On startup of the main program, the portable
.B """C"""
locale is selected as default.
A program may be made portable to all locales by calling:
.nf
setlocale(LC_ALL, "");
.fi
.PP
.in +4n
.EX
setlocale(LC_ALL, "");
.EE
.in
.PP
after program initialization, by using the values returned
from a
.BR localeconv (3)

View File

@ -95,13 +95,13 @@ definitions must be made before including any header files:
.PP
Alternatively, equivalent definitions can be included in the
compilation command:
.RS
.nf
.PP
.in +4n
.EX
cc \-D_BSD_SOURCE
cc \-D_XOPEN_SOURCE # Or any value < 500
.fi
.RE
.EE
.in
.PP
Note that, as described below,
.BR "some feature test macros are defined by default" ,
@ -113,14 +113,14 @@ In a few cases, manual pages use a shorthand for expressing the
feature test macro requirements (this example from
.BR readahead (2)):
.PP
.RS
.nf
.in +4n
.EX
.B #define _GNU_SOURCE
.B #include <fcntl.h>
.PP
.BI "ssize_t readahead(int " fd ", off64_t *" offset ", size_t " count );
.fi
.RE
.EE
.in
.PP
This format is employed in cases where only a single
feature test macro can be used to expose the function
@ -155,23 +155,21 @@ with a value of 600 or greater produces the same effects as defining
.BR _POSIX_C_SOURCE
with a value of 200112L or greater.
Where one sees
.RS
.nf
_POSIX_C_SOURCE >= 200112L
.fi
.RE
.IP
.in +4n
.EX
_POSIX_C_SOURCE >= 200112L
.EE
.in
.IP
in the feature test macro requirements in the SYNOPSIS of a man page,
it is implicit that the following has the same effect:
.RS
.nf
_XOPEN_SOURCE >= 600
.fi
.RE
.IP
.in +4n
.EX
_XOPEN_SOURCE >= 600
.EE
.in
.IP *
Defining
.BR _XOPEN_SOURCE
@ -179,23 +177,21 @@ with a value of 700 or greater produces the same effects as defining
.BR _POSIX_C_SOURCE
with a value of 200809L or greater.
Where one sees
.RS
.nf
_POSIX_C_SOURCE >= 200809L
.fi
.RE
.IP
.in +4n
.EX
_POSIX_C_SOURCE >= 200809L
.EE
.in
.IP
in the feature test macro requirements in the SYNOPSIS of a man page,
it is implicit that the following has the same effect:
.RS
.nf
_XOPEN_SOURCE >= 700
.fi
.RE
.IP
.in +4n
.EX
_XOPEN_SOURCE >= 700
.EE
.in
.\" The details in glibc 2.0 are simpler, but combining a
.\" a description of them with the details in later glibc versions
.\" would make for a complicated description.

View File

@ -177,13 +177,13 @@ by the
category in the current locale.
.PP
(iv) Named character classes, like
.PP
.nf
[:alnum:] [:alpha:] [:blank:] [:cntrl:]
[:digit:] [:graph:] [:lower:] [:print:]
[:punct:] [:space:] [:upper:] [:xdigit:]
.fi
.PP
so that one can say "\fI[[:lower:]]\fP" instead of "\fI[a\-z]\fP", and have
things work in Denmark, too, where there are three letters past \(aqz\(aq
in the alphabet.

View File

@ -47,26 +47,23 @@ Much more precise detail can be found in the POSIX standard itself,
versions of which can nowadays be accessed freely on the web.
.SS ADV - _POSIX_ADVISORY_INFO - _SC_ADVISORY_INFO
The following advisory functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR posix_fadvise (),
.IR posix_fallocate (),
.IR posix_memalign (),
.IR posix_madvise ().
.br
.in -4
.in
.fi
.SS AIO - _POSIX_ASYNCHRONOUS_IO - _SC_ASYNCHRONOUS_IO
The header
.I <aio.h>
is present.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR aio_cancel (),
.IR aio_error (),
.IR aio_fsync (),
@ -75,8 +72,7 @@ The following functions are present:
.IR aio_suspend (),
.IR aio_write (),
.IR lio_listio ().
.br
.in -4
.in
.fi
.SS BAR - _POSIX_BARRIERS - _SC_BARRIERS
This option implies the
@ -85,17 +81,15 @@ and
.B _POSIX_THREAD_SAFE_FUNCTIONS
options.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR pthread_barrier_destroy (),
.IR pthread_barrier_init (),
.IR pthread_barrier_wait (),
.IR pthread_barrierattr_destroy (),
.IR pthread_barrierattr_init ().
.in -4
.br
.in
.fi
.\" .SS BE
.\" Batch environment.
@ -114,16 +108,15 @@ This option implies the
.B _POSIX_TIMERS
option.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR pthread_condattr_getclock (),
.IR pthread_condattr_setclock (),
.IR clock_nanosleep ().
.in -4
.in
.fi
.PP
If
.B CLOCK_REALTIME
is changed by the function
@ -155,10 +148,9 @@ Internet Protocol Version 6 is supported.
If this option is in effect (as it always is under POSIX.1-2001),
then the system implements POSIX-style job control,
and the following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR setpgid (),
.IR tcdrain (),
.IR tcflush (),
@ -166,7 +158,7 @@ and the following functions are present:
.IR tcsendbreak (),
.IR tcsetattr (),
.IR tcsetpgrp ().
.in -4
.in
.fi
.SS MF - _POSIX_MAPPED_FILES - _SC_MAPPED_FILES
Shared memory is supported.
@ -198,10 +190,9 @@ The include file
.I <mqueue.h>
is present.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR mq_close (),
.IR mq_getattr (),
.IR mq_notify (),
@ -210,8 +201,7 @@ The following functions are present:
.IR mq_send (),
.IR mq_setattr (),
.IR mq_unlink ().
.br
.in -4
.in
.fi
.SS MON - _POSIX_MONOTONIC_CLOCK - _SC_MONOTONIC_CLOCK
.B CLOCK_MONOTONIC
@ -220,15 +210,15 @@ This option implies the
.B _POSIX_TIMERS
option.
Affected functions are
.PP
.nf
.in +4
.in +4n
.IR aio_suspend (),
.IR clock_getres (),
.IR clock_gettime (),
.IR clock_settime (),
.IR timer_create ().
.in -4
.in
.fi
.SS --- - _POSIX_MULTI_PROCESS - _SC_MULTI_PROCESS
This option has been deleted.
@ -245,23 +235,21 @@ This property may be dependent on the path prefix of the component.
.SS PIO - _POSIX_PRIORITIZED_IO - _SC_PRIORITIZED_IO
This option says that one can specify priorities for asynchronous I/O.
This affects the functions
.br
.PP
.nf
.in +4
.in +4n
.IR aio_read (),
.IR aio_write ().
.in -4
.in
.fi
.SS PS - _POSIX_PRIORITY_SCHEDULING - _SC_PRIORITY_SCHEDULING
The include file
.I <sched.h>
is present.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR sched_get_priority_max (),
.IR sched_get_priority_min (),
.IR sched_getparam (),
@ -270,21 +258,19 @@ The following functions are present:
.IR sched_setparam (),
.IR sched_setscheduler (),
.IR sched_yield ().
.in -4
.in
.fi
If also
.B _POSIX_SPAWN
is in effect, then the following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR posix_spawnattr_getschedparam (),
.IR posix_spawnattr_getschedpolicy (),
.IR posix_spawnattr_setschedparam (),
.IR posix_spawnattr_setschedpolicy ().
.in -4
.in
.fi
.SS RS - _POSIX_RAW_SOCKETS
Raw sockets are supported.
@ -299,10 +285,10 @@ Conversely,
under POSIX.1-2001 the
.B _POSIX_THREADS
option implies this option.
.nf
.PP
The following functions are present:
.in +4
.in +4n
.nf
.IR pthread_rwlock_destroy (),
.IR pthread_rwlock_init (),
.IR pthread_rwlock_rdlock (),
@ -312,52 +298,46 @@ The following functions are present:
.IR pthread_rwlock_wrlock (),
.IR pthread_rwlockattr_destroy (),
.IR pthread_rwlockattr_init ().
.in -4
.in
.fi
.SS RTS - _POSIX_REALTIME_SIGNALS - _SC_REALTIME_SIGNALS
Realtime signals are supported.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR sigqueue (),
.IR sigtimedwait (),
.IR sigwaitinfo ().
.br
.in -4
.in
.fi
.SS --- - _POSIX_REGEXP - _SC_REGEXP
If this option is in effect (as it always is under POSIX.1-2001)
then POSIX regular expressions are supported
and the following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR regcomp (),
.IR regerror (),
.IR regexec (),
.IR regfree ().
.br
.in -4
.in
.fi
.SS --- - _POSIX_SAVED_IDS - _SC_SAVED_IDS
If this option is in effect (as it always is under POSIX.1-2001),
then a process has a saved set-user-ID and a saved set-group-ID.
Affected functions are
.br
.PP
.nf
.in +4
.in +4n
.IR exec (),
.IR kill (),
.IR seteuid (),
.IR setegid (),
.IR setgid (),
.IR setuid ().
.br
.in -4
.in
.fi
.\" .SS SD
.\" Software development
@ -366,10 +346,9 @@ The include file
.I <semaphore.h>
is present.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR sem_close (),
.IR sem_destroy (),
.IR sem_getvalue (),
@ -379,21 +358,18 @@ The following functions are present:
.IR sem_trywait (),
.IR sem_unlink (),
.IR sem_wait ().
.br
.in -4
.in
.fi
.SS SHM - _POSIX_SHARED_MEMORY_OBJECTS - _SC_SHARED_MEMORY_OBJECTS
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR mmap (),
.IR munmap (),
.IR shm_open (),
.IR shm_unlink ().
.br
.in -4
.in
.fi
.SS --- - _POSIX_SHELL - _SC_SHELL
If this option is in effect (as it always is under POSIX.1-2001),
@ -410,10 +386,9 @@ If
is in effect, then the include file
.I <spawn.h>
and the following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR posix_spawn (),
.IR posix_spawn_file_actions_addclose (),
.IR posix_spawn_file_actions_adddup2 (),
@ -431,22 +406,20 @@ and the following functions are present:
.IR posix_spawnattr_setpgroup (),
.IR posix_spawnattr_setsigmask (),
.IR posix_spawnp ().
.in -4
.br
.in
.fi
If also
.B _POSIX_PRIORITY_SCHEDULING
is in effect, then
the following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR posix_spawnattr_getschedparam (),
.IR posix_spawnattr_getschedpolicy (),
.IR posix_spawnattr_setschedparam (),
.IR posix_spawnattr_setschedpolicy ().
.in -4
.in
.fi
.SS SPI - _POSIX_SPIN_LOCKS - _SC_SPIN_LOCKS
This option implies the
@ -455,17 +428,15 @@ and
.B _POSIX_THREAD_SAFE_FUNCTIONS
options.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR pthread_spin_destroy (),
.IR pthread_spin_init (),
.IR pthread_spin_lock (),
.IR pthread_spin_trylock (),
.IR pthread_spin_unlock ().
.in -4
.br
.in -4n
.fi
.SS SS - _POSIX_SPORADIC_SERVER - _SC_SPORADIC_SERVER
The scheduling policy
@ -475,14 +446,12 @@ This option implies the
.B _POSIX_PRIORITY_SCHEDULING
option.
Affected functions are
.br
.PP
.nf
.in +4
.in +n4
.IR sched_setparam (),
.IR sched_setscheduler ().
.in -4
.br
.in
.fi
.SS SIO - _POSIX_SYNCHRONIZED_IO - _SC_SYNCHRONIZED_IO
Affected functions are
@ -492,29 +461,25 @@ Affected functions are
.IR fdatasync ().
.SS TSA - _POSIX_THREAD_ATTR_STACKADDR - _SC_THREAD_ATTR_STACKADDR
Affected functions are
.br
.PP
.nf
.in +4
.in +4n
.IR pthread_attr_getstack (),
.IR pthread_attr_getstackaddr (),
.IR pthread_attr_setstack (),
.IR pthread_attr_setstackaddr ().
.in -4
.br
.in
.fi
.SS TSS - _POSIX_THREAD_ATTR_STACKSIZE - _SC_THREAD_ATTR_STACKSIZE
Affected functions are
.br
.PP
.nf
.in +4
.in +4n
.IR pthread_attr_getstack (),
.IR pthread_attr_getstacksize (),
.IR pthread_attr_setstack (),
.IR pthread_attr_setstacksize ().
.in -4
.br
.in
.fi
.SS TCT - _POSIX_THREAD_CPUTIME - _SC_THREAD_CPUTIME
The clockID CLOCK_THREAD_CPUTIME_ID is supported.
@ -522,52 +487,45 @@ This option implies the
.B _POSIX_TIMERS
option.
Affected functions are
.br
.PP
.nf
.in +4
.in +4n
.IR pthread_getcpuclockid (),
.IR clock_getres (),
.IR clock_gettime (),
.IR clock_settime (),
.IR timer_create ().
.in -4
.br
.in
.fi
.SS TPI - _POSIX_THREAD_PRIO_INHERIT - _SC_THREAD_PRIO_INHERIT
Affected functions are
.br
.PP
.nf
.in +4
.in +4n
.IR pthread_mutexattr_getprotocol (),
.IR pthread_mutexattr_setprotocol ().
.in -4
.br
.in
.fi
.SS TPP - _POSIX_THREAD_PRIO_PROTECT - _SC_THREAD_PRIO_PROTECT
Affected functions are
.br
.PP
.nf
.in +4
.in +4n
.IR pthread_mutex_getprioceiling (),
.IR pthread_mutex_setprioceiling (),
.IR pthread_mutexattr_getprioceiling (),
.IR pthread_mutexattr_getprotocol (),
.IR pthread_mutexattr_setprioceiling (),
.IR pthread_mutexattr_setprotocol ().
.in -4
.br
.in
.fi
.SS TPS - _POSIX_THREAD_PRIORITY_SCHEDULING - _SC_THREAD_PRIORITY_SCHEDULING
If this option is in effect, the different threads inside a process
can run with different priorities and/or different schedulers.
Affected functions are
.br
.PP
.nf
.in +4
.in +4n
.IR pthread_attr_getinheritsched (),
.IR pthread_attr_getschedpolicy (),
.IR pthread_attr_getscope (),
@ -577,15 +535,13 @@ Affected functions are
.IR pthread_getschedparam (),
.IR pthread_setschedparam (),
.IR pthread_setschedprio ().
.in -4
.br
.in
.fi
.SS TSH - _POSIX_THREAD_PROCESS_SHARED - _SC_THREAD_PROCESS_SHARED
Affected functions are
.br
.PP
.nf
.in +4
.in +4n
.IR pthread_barrierattr_getpshared (),
.IR pthread_barrierattr_setpshared (),
.IR pthread_condattr_getpshared (),
@ -594,15 +550,13 @@ Affected functions are
.IR pthread_mutexattr_setpshared (),
.IR pthread_rwlockattr_getpshared (),
.IR pthread_rwlockattr_setpshared ().
.in -4
.br
.in
.fi
.SS TSF - _POSIX_THREAD_SAFE_FUNCTIONS - _SC_THREAD_SAFE_FUNCTIONS
Affected functions are
.br
.PP
.nf
.in +4
.in +4n
.IR readdir_r (),
.IR getgrgid_r (),
.IR getgrnam_r (),
@ -622,31 +576,27 @@ Affected functions are
.IR ctime_r (),
.IR gmtime_r (),
.IR localtime_r ().
.in -4
.br
.in
.fi
.SS TSP - _POSIX_THREAD_SPORADIC_SERVER - _SC_THREAD_SPORADIC_SERVER
This option implies the
.B _POSIX_THREAD_PRIORITY_SCHEDULING
option.
Affected functions are
.br
.PP
.nf
.in +4
.in +4n
.IR sched_getparam (),
.IR sched_setparam (),
.IR sched_setscheduler ().
.in -4
.br
.in
.fi
.SS THR - _POSIX_THREADS - _SC_THREADS
Basic support for POSIX threads is available.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR pthread_atfork (),
.IR pthread_attr_destroy (),
.IR pthread_attr_getdetachstate (),
@ -695,15 +645,13 @@ The following functions are present:
.IR pthread_setcanceltype (),
.IR pthread_setspecific (),
.IR pthread_testcancel ().
.in -4
.br
.in
.fi
.SS TMO - _POSIX_TIMEOUTS - _SC_TIMEOUTS
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR mq_timedreceive (),
.IR mq_timedsend (),
.IR pthread_mutex_timedlock (),
@ -711,15 +659,13 @@ The following functions are present:
.IR pthread_rwlock_timedwrlock (),
.IR sem_timedwait (),
.IR posix_trace_timedgetnext_event ().
.in -4
.br
.in
.fi
.SS TMR - _POSIX_TIMERS - _SC_TIMERS
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR clock_getres (),
.IR clock_gettime (),
.IR clock_settime (),
@ -729,16 +675,14 @@ The following functions are present:
.IR timer_gettime (),
.IR timer_getoverrun (),
.IR timer_settime ().
.in -4
.br
.in
.fi
.SS TRC - _POSIX_TRACE - _SC_TRACE
POSIX tracing is available.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR posix_trace_attr_destroy (),
.IR posix_trace_attr_getclockres (),
.IR posix_trace_attr_getcreatetime (),
@ -770,18 +714,16 @@ The following functions are present:
.IR posix_trace_start (),
.IR posix_trace_stop (),
.IR posix_trace_trygetnext_event ().
.in -4
.br
.in
.fi
.SS TEF - _POSIX_TRACE_EVENT_FILTER - _SC_TRACE_EVENT_FILTER
This option implies the
.B _POSIX_TRACE
option.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR posix_trace_eventset_add (),
.IR posix_trace_eventset_del (),
.IR posix_trace_eventset_empty (),
@ -790,8 +732,7 @@ The following functions are present:
.IR posix_trace_get_filter (),
.IR posix_trace_set_filter (),
.IR posix_trace_trid_eventid_open ().
.in -4
.br
.in
.fi
.SS TRI - _POSIX_TRACE_INHERIT - _SC_TRACE_INHERIT
Tracing children of the traced process is supported.
@ -799,24 +740,21 @@ This option implies the
.B _POSIX_TRACE
option.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR posix_trace_attr_getinherited (),
.IR posix_trace_attr_setinherited ().
.in -4
.br
.in
.fi
.SS TRL - _POSIX_TRACE_LOG - _SC_TRACE_LOG
This option implies the
.B _POSIX_TRACE
option.
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR posix_trace_attr_getlogfullpolicy (),
.IR posix_trace_attr_getlogsize (),
.IR posix_trace_attr_setlogfullpolicy (),
@ -825,20 +763,17 @@ The following functions are present:
.IR posix_trace_create_withlog (),
.IR posix_trace_open (),
.IR posix_trace_rewind ().
.in -4
.br
.in
.fi
.SS TYM - _POSIX_TYPED_MEMORY_OBJECTS - _SC_TYPED_MEMORY_OBJECT
The following functions are present:
.br
.PP
.nf
.in +4
.in +4n
.IR posix_mem_offset (),
.IR posix_typed_mem_get_info (),
.IR posix_typed_mem_open ().
.in -4
.br
.in
.fi
.SS --- - _POSIX_VDISABLE
Always present (probably 0).

View File

@ -415,8 +415,8 @@ depend on the hardware platform.
(The appropriate definition is supplied by
.IR <link.h> .)
Here is the definition for x86-32:
.PP
.nf
.BI "unsigned int la_i86_gnu_pltexit(Elf32_Sym *" sym ", unsigned int " ndx ,
.BI " uintptr_t *" refcook ", uintptr_t *" defcook ,
.BI " const La_i86_regs *" inregs ", La_i86_retval *" outregs ,
@ -501,7 +501,7 @@ This is reportedly fixed in glibc 2.10.
.\" glibc bug filed: http://sourceware.org/bugzilla/show_bug.cgi?id=9733
.\" Reportedly, this is fixed on 16 Mar 2009 (i.e., for glibc 2.10)
.SH EXAMPLE
.nf
.EX
#include <link.h>
#include <stdio.h>
@ -599,7 +599,7 @@ la_i86_gnu_pltenter(Elf32_Sym *sym, unsigned int ndx,
return sym\->st_value;
}
.fi
.EE
.SH SEE ALSO
.BR ldd (1),
.BR dlopen (3),