getresuid.2, mremap.2, poll.2, remap_file_pages.2, setresuid.2, splice.2, sync_file_range.2, syscall.2, tee.2, vmsplice.2, INFINITY.3, aio_init.3, asprintf.3, assert_perror.3, basename.3, bsd_signal.3, canonicalize_file_name.3, clog10.3, crypt.3, dl_iterate_phdr.3, dlopen.3, encrypt.3, exp10.3, fcloseall.3, fenv.3, fopencookie.3, ftw.3, getaddrinfo_a.3, getloadavg.3, getutent.3, grantpt.3, hsearch.3, lseek64.3, memmem.3, mempcpy.3, pow10.3, program_invocation_name.3, ptsname.3, putgrent.3, sched_getcpu.3, sincos.3, strchr.3, strfry.3, strnlen.3, strptime.3, strstr.3, strverscmp.3, swab.3, sysv_signal.3, tsearch.3, unlockpt.3, wcwidth.3: Add reference to feature_test_macros(7)

Some pages simply list feature test macro requirements in
the form:

    #define #GNU_SOURCE
    #include <someheader.h>

For these pages, add a "See feature_test_macros(7)" comment
on the "#define" line.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2010-10-31 05:31:47 +01:00
parent f95b57bdc7
commit b80f966bb0
52 changed files with 57 additions and 56 deletions

View File

@ -28,7 +28,7 @@
.SH NAME
getresuid, getresgid \- get real, effective and saved user/group IDs
.SH SYNOPSIS
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <unistd.h>
.sp

View File

@ -33,7 +33,7 @@
mremap \- remap a virtual memory address
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <sys/mman.h>
.sp

View File

@ -37,7 +37,7 @@ poll, ppoll \- wait for some event on a file descriptor
.sp
.BI "int poll(struct pollfd *" fds ", nfds_t " nfds ", int " timeout );
.sp
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <poll.h>
.sp
.BI "int ppoll(struct pollfd *" fds ", nfds_t " nfds ", "

View File

@ -28,7 +28,7 @@
remap_file_pages \- create a nonlinear file mapping
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <sys/mman.h>
.sp
.BI "int remap_file_pages(void *" addr ", size_t " size ", int " prot ,

View File

@ -27,7 +27,7 @@
.SH NAME
setresuid, setresgid \- set real, effective and saved user or group ID
.SH SYNOPSIS
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <unistd.h>
.sp

View File

@ -28,7 +28,7 @@
splice \- splice data to/from a pipe
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <fcntl.h>
.BI "ssize_t splice(int " fd_in ", loff_t *" off_in ", int " fd_out ,

View File

@ -32,7 +32,7 @@
sync_file_range \- sync a file segment with disk
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <fcntl.h>
.BI "int sync_file_range(int " fd ", off64_t " offset ", off64_t " nbytes ,

View File

@ -40,7 +40,7 @@
syscall \- indirect system call
.SH SYNOPSIS
.nf
.BR "#define _GNU_SOURCE " " /* or _BSD_SOURCE or _SVID_SOURCE */"
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <unistd.h>
.BR "#include <sys/syscall.h> " "/* For SYS_xxx definitions */"

View File

@ -28,7 +28,7 @@
tee \- duplicating pipe content
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <fcntl.h>
.BI "ssize_t tee(int " fd_in ", int " fd_out ", size_t " len \

View File

@ -28,7 +28,7 @@
vmsplice \- splice user pages into a pipe
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <fcntl.h>
.B #include <sys/uio.h>

View File

@ -25,7 +25,7 @@
INFINITY, NAN, HUGE_VAL, HUGE_VALF, HUGE_VALL \- floating-point constants
.SH SYNOPSIS
.nf
.B #define _ISOC99_SOURCE
.BR "#define _ISOC99_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <math.h>
.sp

View File

@ -26,7 +26,7 @@
aio_init \- POSIX asynchronous I/O initialization
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B "#include <aio.h>"
.BI "void aio_init(const struct aioinit *" init );

View File

@ -26,7 +26,7 @@
.SH NAME
asprintf, vasprintf \- print to allocated string
.SH SYNOPSIS
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <stdio.h>
.sp

View File

@ -28,7 +28,7 @@
assert_perror \- test errnum and abort
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <assert.h>
.sp
.BI "void assert_perror(int " errnum );

View File

@ -132,7 +132,7 @@ after
.br
.nf
.B " #define _GNU_SOURCE"
.BR " #define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B " #include <string.h>"

View File

@ -24,7 +24,7 @@
.SH NAME
bsd_signal \- signal handling with BSD semantics
.SH SYNOPSIS
.B #define _XOPEN_SOURCE
.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <signal.h>
.sp

View File

@ -6,7 +6,7 @@
.SH NAME
canonicalize_file_name \- return the canonicalized filename
.SH SYNOPSIS
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <stdlib.h>
.sp

View File

@ -5,7 +5,7 @@
.SH NAME
clog10, clog10f, clog10l \- base-10 logarithm of a complex number
.SH SYNOPSIS
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <complex.h>
.sp

View File

@ -37,7 +37,7 @@
crypt, crypt_r \- password and data encryption
.SH SYNOPSIS
.nf
.B #define _XOPEN_SOURCE
.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <unistd.h>
.sp

View File

@ -26,7 +26,7 @@
dl_iterate_phdr \- walk through list of shared objects
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <link.h>
\fBint dl_iterate_phdr(\fP

View File

@ -330,7 +330,7 @@ returns.
Glibc adds two functions not described by POSIX, with prototypes
.sp
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <dlfcn.h>
.sp
.BI "int dladdr(void *" addr ", Dl_info *" info );

View File

@ -25,19 +25,19 @@
.SH NAME
encrypt, setkey, encrypt_r, setkey_r \- encrypt 64-bit messages
.SH SYNOPSIS
.B #define _XOPEN_SOURCE
.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <unistd.h>
.sp
.BI "void encrypt(char " block "[64], int " edflag );
.sp
.B #define _XOPEN_SOURCE
.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <stdlib.h>
.sp
.BI "void setkey(const char *" key );
.sp
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B "#include <crypt.h>"
.sp

View File

@ -35,7 +35,7 @@
exp10, exp10f, exp10l \- base-10 exponential function
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <math.h>
.sp

View File

@ -26,7 +26,7 @@
fcloseall \- close all open streams
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <stdio.h>
.sp
.B int fcloseall(void);

View File

@ -285,7 +285,7 @@ to set individual floating-point traps, and
to query the state.
.sp
.nf
.B "#define _GNU_SOURCE"
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B "#include <fenv.h>"
.sp

View File

@ -26,7 +26,7 @@
fopencookie \- opening a custom stream
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <stdio.h>
.BI "FILE *fopencookie(void *" cookie ", const char *" mode ,

View File

@ -43,7 +43,7 @@ ftw, nftw \- file tree walk
.BI " int " typeflag ),
.BI " int " nopenfd );
.sp
.B #define _XOPEN_SOURCE 500
.BR "#define _XOPEN_SOURCE 500" " /* See feature_test_macros(7) */"
.B #include <ftw.h>
.sp
.BI "int nftw(const char *" dirpath ,

View File

@ -30,7 +30,7 @@ getaddrinfo_a, gai_suspend, gai_error, gai_cancel \- asynchronous
network address and service translation
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <netdb.h>
.sp
.BI "int getaddrinfo_a(int " "mode" ", struct gaicb *" "list[]" ,

View File

@ -34,7 +34,7 @@
getloadavg \- get system load averages
.SH SYNOPSIS
.nf
.B #define _BSD_SOURCE
.BR "#define _BSD_SOURCE" " /* See feature_test_macros(7) */"
.B #include <stdlib.h>
.sp
.BI "int getloadavg(double " loadavg[] ", int " nelem );

View File

@ -208,7 +208,8 @@ The above functions are not thread-safe.
Glibc adds reentrant versions
.sp
.nf
.BR "#define _GNU_SOURCE" " /* or _SVID_SOURCE or _BSD_SOURCE */"
.BR "#define _GNU_SOURCE" " /* or _SVID_SOURCE or _BSD_SOURCE;
.R "\& see feature_test_macros(7) */
.B #include <utmp.h>
.sp
.BI "int getutent_r(struct utmp *" ubuf ", struct utmp **" ubufp );

View File

@ -6,7 +6,7 @@
grantpt \- grant access to the slave pseudoterminal
.SH SYNOPSIS
.nf
.B #define _XOPEN_SOURCE
.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <stdlib.h>
.sp

View File

@ -46,7 +46,7 @@ hsearch_r \- hash table management
.sp
.B "void hdestroy(void);"
.sp
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <search.h>
.sp

View File

@ -24,7 +24,7 @@
.SH NAME
lseek64 \- reposition 64-bit read/write file offset
.SH SYNOPSIS
.B #define _LARGEFILE64_SOURCE
.BR "#define _LARGEFILE64_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <sys/types.h>
.br

View File

@ -30,7 +30,7 @@
memmem \- locate a substring
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <string.h>
.sp
.BI "void *memmem(const void *" haystack ", size_t " haystacklen ,

View File

@ -8,13 +8,13 @@
mempcpy, wmempcpy \- copy memory area
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <string.h>
.sp
.BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n );
.sp
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <wchar.h>
.sp

View File

@ -25,7 +25,7 @@
pow10, pow10f, pow10l \- base-10 power functions
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <math.h>
.sp
.BI "double pow10(double " x );

View File

@ -24,7 +24,7 @@ program_invocation_name, program_invocation_short_name \- \
obtain name used to invoke calling program
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <errno.h>
.BI "extern char *" program_invocation_name ;

View File

@ -8,13 +8,13 @@
ptsname, ptsname_r \- get the name of the slave pseudoterminal
.SH SYNOPSIS
.nf
.B #define _XOPEN_SOURCE
.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <stdlib.h>
.sp
.BI "char *ptsname(int " fd ");"
.sp
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <stdlib.h>
.sp

View File

@ -5,7 +5,7 @@
.SH NAME
putgrent \- write a group database entry to a file
.SH SYNOPSIS
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <grp.h>
.sp

View File

@ -26,7 +26,7 @@
sched_getcpu \- determine CPU on which the calling thread is running
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <sched.h>
.B int sched_getcpu(void);

View File

@ -8,7 +8,7 @@
sincos, sincosf, sincosl \- calculate sin and cos simultaneously
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <math.h>
.sp
.BI "void sincos(double " x ", double *" sin ", double *" cos );

View File

@ -39,7 +39,7 @@ strchr, strrchr, strchrnul \- locate character in string
.sp
.BI "char *strrchr(const char *" s ", int " c );
.sp
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <string.h>
.sp
.BI "char *strchrnul(const char *" s ", int " c );

View File

@ -30,7 +30,7 @@
strfry \- randomize a string
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <string.h>
.sp

View File

@ -13,7 +13,7 @@
strnlen \- determine the length of a fixed-size string
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.sp
.B #include <string.h>
.sp

View File

@ -30,7 +30,7 @@
.SH NAME
strptime \- convert a string representation of time to a time tm structure
.SH SYNOPSIS
.BR "#define _XOPEN_SOURCE" " /* glibc2 needs this */"
.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <time.h>
.sp

View File

@ -37,7 +37,7 @@ strstr, strcasestr \- locate a substring
.sp
.BI "char *strstr(const char *" haystack ", const char *" needle );
.sp
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.sp
.B #include <string.h>
.sp

View File

@ -25,7 +25,7 @@
strverscmp \- compare two version strings
.SH SYNOPSIS
.nf
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <string.h>
.sp

View File

@ -31,7 +31,7 @@
swab \- swap adjacent bytes
.SH SYNOPSIS
.nf
.B #define _XOPEN_SOURCE
.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
.B #include <unistd.h>
.sp
.BI "void swab(const void *" from ", void *" to ", ssize_t " n );

View File

@ -24,7 +24,7 @@
.SH NAME
sysv_signal \- signal handling with System V semantics
.SH SYNOPSIS
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <signal.h>
.sp

View File

@ -41,7 +41,7 @@ tsearch, tfind, tdelete, twalk, tdestroy \- manage a binary tree
.BI " const VISIT " which ,
.BI " const int " depth "));"
.sp
.B #define _GNU_SOURCE
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <search.h>
.sp

View File

@ -6,7 +6,7 @@
unlockpt \- unlock a pseudoterminal master/slave pair
.SH SYNOPSIS
.nf
.B #define _XOPEN_SOURCE
.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
.br
.B #include <stdlib.h>
.sp

View File

@ -15,7 +15,7 @@
wcwidth \- determine columns needed for a wide character
.SH SYNOPSIS
.nf
.B #define _XOPEN_SOURCE
.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
.B #include <wchar.h>
.sp
.BI "int wcwidth(wchar_t " c );