2006-04-21 06:47:08 +00:00
|
|
|
.\" This manpage is Copyright (C) 2006, Michael Kerrisk
|
|
|
|
.\"
|
intro.1, _exit.2, access.2, alarm.2, alloc_hugepages.2, arch_prctl.2, bind.2, chdir.2, chmod.2, chown.2, chroot.2, clock_getres.2, clock_nanosleep.2, close.2, connect.2, delete_module.2, dup.2, execve.2, exit_group.2, faccessat.2, fchmodat.2, fchownat.2, fcntl.2, fork.2, fstatat.2, fsync.2, futimesat.2, get_robust_list.2, getdents.2, getdomainname.2, getgid.2, getgroups.2, gethostname.2, getpagesize.2, getpid.2, getresuid.2, getrlimit.2, getrusage.2, gettid.2, gettimeofday.2, getuid.2, getunwind.2, idle.2, init_module.2, intro.2, iopl.2, kcmp.2, kexec_load.2, kill.2, link.2, linkat.2, llseek.2, lookup_dcookie.2, madvise.2, mincore.2, mkdirat.2, mknodat.2, mmap.2, mmap2.2, mount.2, mprotect.2, mq_getsetattr.2, msgctl.2, msgget.2, msgop.2, msync.2, nice.2, open.2, openat.2, pause.2, perfmonctl.2, personality.2, pipe.2, poll.2, posix_fadvise.2, prctl.2, pread.2, process_vm_readv.2, quotactl.2, read.2, readahead.2, readdir.2, readlinkat.2, readv.2, reboot.2, recvmmsg.2, remap_file_pages.2, rename.2, renameat.2, rmdir.2, rt_sigqueueinfo.2, select.2, select_tut.2, semctl.2, semget.2, semop.2, sendmmsg.2, set_tid_address.2, seteuid.2, setfsgid.2, setfsuid.2, setgid.2, setresuid.2, setuid.2, setup.2, sgetmask.2, shmctl.2, shmget.2, shmop.2, sigaction.2, sigaltstack.2, signal.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, splice.2, stat.2, statfs.2, stime.2, subpage_prot.2, swapon.2, symlink.2, symlinkat.2, sync.2, sync_file_range.2, syscalls.2, sysctl.2, sysfs.2, syslog.2, tee.2, time.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, times.2, tkill.2, umask.2, umount.2, uname.2, unlink.2, unlinkat.2, uselib.2, ustat.2, utime.2, utimensat.2, vfork.2, vhangup.2, vm86.2, vmsplice.2, wait.2, wait4.2, write.2, CPU_SET.3, INFINITY.3, abort.3, abs.3, acos.3, acosh.3, adjtime.3, aio_init.3, asin.3, asinh.3, asprintf.3, assert.3, assert_perror.3, atan.3, atan2.3, atanh.3, atexit.3, atof.3, atoi.3, basename.3, bcmp.3, bcopy.3, bindresvport.3, bsd_signal.3, bsearch.3, bstring.3, byteorder.3, bzero.3, catgets.3, catopen.3, cbrt.3, ceil.3, clearenv.3, clock.3, clock_getcpuclockid.3, closedir.3, confstr.3, copysign.3, cos.3, cosh.3, ctermid.3, ctime.3, difftime.3, dirfd.3, div.3, dl_iterate_phdr.3, dprintf.3, drand48.3, drand48_r.3, dysize.3, ecvt.3, ecvt_r.3, end.3, endian.3, erf.3, erfc.3, ether_aton.3, euidaccess.3, exit.3, exp.3, exp10.3, exp2.3, expm1.3, fabs.3, fcloseall.3, fexecve.3, ffs.3, fgetgrent.3, fgetpwent.3, finite.3, flockfile.3, floor.3, fmod.3, fnmatch.3, fopencookie.3, fpathconf.3, fpurge.3, frexp.3, fseeko.3, ftok.3, futimes.3, gcvt.3, get_nprocs_conf.3, getaddrinfo.3, getaddrinfo_a.3, getauxval.3, getcontext.3, getcwd.3, getdate.3, getdirentries.3, getdtablesize.3, getenv.3, getfsent.3, getgrent.3, getgrnam.3, getgrouplist.3, gethostbyname.3, gethostid.3, getifaddrs.3, getipnodebyname.3, getline.3, getlogin.3, getmntent.3, getnetent.3, getnetent_r.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwnam.3, getrpcent_r.3, gets.3, getservent.3, getservent_r.3, getumask.3, getusershell.3, getutmp.3, getw.3, glob.3, gnu_get_libc_version.3, gsignal.3, hypot.3, if_nameindex.3, if_nametoindex.3, ilogb.3, index.3, inet.3, inet_ntop.3, inet_pton.3, infnan.3, initgroups.3, insque.3, intro.3, isalpha.3, isatty.3, j0.3, ldexp.3, localeconv.3, log.3, log10.3, log1p.3, log2.3, logb.3, lrint.3, lround.3, lsearch.3, lseek64.3, makecontext.3, makedev.3, mallinfo.3, malloc.3, malloc_get_state.3, malloc_info.3, malloc_stats.3, malloc_trim.3, malloc_usable_size.3, mallopt.3, matherr.3, mcheck.3, memccpy.3, memchr.3, memcmp.3, memcpy.3, memfrob.3, memmem.3, memmove.3, memset.3, mkdtemp.3, mkfifo.3, mkfifoat.3, mkstemp.3, mktemp.3, modf.3, mq_close.3, mq_getattr.3, mq_notify.3, mq_open.3, mq_receive.3, mq_send.3, mq_unlink.3, mtrace.3, on_exit.3, opendir.3, posix_fallocate.3, posix_memalign.3, posix_openpt.3, pow.3, pow10.3, profil.3, psignal.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_detach.3, pthread_equal.3, pthread_exit.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_join.3, pthread_kill.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_setschedprio.3, pthread_sigmask.3, pthread_sigqueue.3, pthread_testcancel.3, pthread_tryjoin_np.3, pthread_yield.3, putenv.3, putpwent.3, puts.3, qecvt.3, qsort.3, raise.3, rand.3, random.3, random_r.3, re_comp.3, readdir.3, realpath.3, regex.3, remainder.3, remove.3, resolver.3, rewinddir.3, rint.3, round.3, scalb.3, scalbln.3, scandir.3, sched_getcpu.3, seekdir.3, sem_close.3, sem_destroy.3, sem_getvalue.3, sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sem_wait.3, setenv.3, setlocale.3, setlogmask.3, shm_open.3, siginterrupt.3, sigpause.3, sigqueue.3, sigset.3, sigsetops.3, sigvec.3, sigwait.3, sin.3, sinh.3, sleep.3, sockatmark.3, sqrt.3, statvfs.3, stdio_ext.3, stpcpy.3, strcasecmp.3, strcat.3, strchr.3, strcmp.3, strcoll.3, strcpy.3, strdup.3, strerror.3, strfry.3, strftime.3, string.3, strlen.3, strpbrk.3, strptime.3, strsep.3, strsignal.3, strspn.3, strstr.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, strxfrm.3, swab.3, sysconf.3, syslog.3, system.3, sysv_signal.3, tan.3, tanh.3, tcgetpgrp.3, tcgetsid.3, telldir.3, tempnam.3, timegm.3, timeradd.3, tmpfile.3, tmpnam.3, toascii.3, toupper.3, trunc.3, tsearch.3, ttyslot.3, tzset.3, ulimit.3, undocumented.3, unlocked_stdio.3, usleep.3, y0.3, cpuid.4, full.4, initrd.4, mouse.4, msr.4, sd.4, st.4, acct.5, core.5, services.5, slabinfo.5, aio.7, capabilities.7, credentials.7, feature_test_macros.7, hier.7, inotify.7, libc.7, locale.7, man-pages.7, man.7, math_error.7, mq_overview.7, numa.7, path_resolution.7, pipe.7, pthreads.7, pty.7, rtld-audit.7, sem_overview.7, shm_overview.7, sigevent.7, signal.7, suffixes.7, svipc.7, termio.7, time.7, udplite.7, units.7, uri.7, sln.8: s/LICENSE_START(verbatim)/LICENSE_START(VERBATIM)/
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-10 09:29:01 +00:00
|
|
|
.\" %%%LICENSE_START(VERBATIM)
|
2006-04-21 06:47:08 +00:00
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2006-04-21 06:47:08 +00:00
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2006-04-21 06:47:08 +00:00
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
intro.1, _exit.2, access.2, alarm.2, alloc_hugepages.2, arch_prctl.2, bind.2, chdir.2, chmod.2, chown.2, chroot.2, clock_getres.2, clock_nanosleep.2, close.2, connect.2, delete_module.2, dup.2, execve.2, exit_group.2, faccessat.2, fchmodat.2, fchownat.2, fcntl.2, fork.2, fstatat.2, fsync.2, futimesat.2, get_robust_list.2, getdents.2, getdomainname.2, getgid.2, getgroups.2, gethostname.2, getpagesize.2, getpid.2, getresuid.2, getrlimit.2, getrusage.2, gettid.2, gettimeofday.2, getuid.2, getunwind.2, idle.2, init_module.2, intro.2, iopl.2, kcmp.2, kexec_load.2, kill.2, link.2, linkat.2, llseek.2, lookup_dcookie.2, madvise.2, mincore.2, mkdirat.2, mknodat.2, mmap.2, mmap2.2, mount.2, mprotect.2, mq_getsetattr.2, msgctl.2, msgget.2, msgop.2, msync.2, nice.2, open.2, openat.2, pause.2, perfmonctl.2, personality.2, pipe.2, poll.2, posix_fadvise.2, prctl.2, pread.2, process_vm_readv.2, quotactl.2, read.2, readahead.2, readdir.2, readlinkat.2, readv.2, reboot.2, recvmmsg.2, remap_file_pages.2, rename.2, renameat.2, rmdir.2, rt_sigqueueinfo.2, select.2, select_tut.2, semctl.2, semget.2, semop.2, sendmmsg.2, set_tid_address.2, seteuid.2, setfsgid.2, setfsuid.2, setgid.2, setresuid.2, setuid.2, setup.2, sgetmask.2, shmctl.2, shmget.2, shmop.2, sigaction.2, sigaltstack.2, signal.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, splice.2, stat.2, statfs.2, stime.2, subpage_prot.2, swapon.2, symlink.2, symlinkat.2, sync.2, sync_file_range.2, syscalls.2, sysctl.2, sysfs.2, syslog.2, tee.2, time.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, times.2, tkill.2, umask.2, umount.2, uname.2, unlink.2, unlinkat.2, uselib.2, ustat.2, utime.2, utimensat.2, vfork.2, vhangup.2, vm86.2, vmsplice.2, wait.2, wait4.2, write.2, CPU_SET.3, INFINITY.3, abort.3, abs.3, acos.3, acosh.3, adjtime.3, aio_init.3, asin.3, asinh.3, asprintf.3, assert.3, assert_perror.3, atan.3, atan2.3, atanh.3, atexit.3, atof.3, atoi.3, basename.3, bcmp.3, bcopy.3, bindresvport.3, bsd_signal.3, bsearch.3, bstring.3, byteorder.3, bzero.3, catgets.3, catopen.3, cbrt.3, ceil.3, clearenv.3, clock.3, clock_getcpuclockid.3, closedir.3, confstr.3, copysign.3, cos.3, cosh.3, ctermid.3, ctime.3, difftime.3, dirfd.3, div.3, dl_iterate_phdr.3, dprintf.3, drand48.3, drand48_r.3, dysize.3, ecvt.3, ecvt_r.3, end.3, endian.3, erf.3, erfc.3, ether_aton.3, euidaccess.3, exit.3, exp.3, exp10.3, exp2.3, expm1.3, fabs.3, fcloseall.3, fexecve.3, ffs.3, fgetgrent.3, fgetpwent.3, finite.3, flockfile.3, floor.3, fmod.3, fnmatch.3, fopencookie.3, fpathconf.3, fpurge.3, frexp.3, fseeko.3, ftok.3, futimes.3, gcvt.3, get_nprocs_conf.3, getaddrinfo.3, getaddrinfo_a.3, getauxval.3, getcontext.3, getcwd.3, getdate.3, getdirentries.3, getdtablesize.3, getenv.3, getfsent.3, getgrent.3, getgrnam.3, getgrouplist.3, gethostbyname.3, gethostid.3, getifaddrs.3, getipnodebyname.3, getline.3, getlogin.3, getmntent.3, getnetent.3, getnetent_r.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwnam.3, getrpcent_r.3, gets.3, getservent.3, getservent_r.3, getumask.3, getusershell.3, getutmp.3, getw.3, glob.3, gnu_get_libc_version.3, gsignal.3, hypot.3, if_nameindex.3, if_nametoindex.3, ilogb.3, index.3, inet.3, inet_ntop.3, inet_pton.3, infnan.3, initgroups.3, insque.3, intro.3, isalpha.3, isatty.3, j0.3, ldexp.3, localeconv.3, log.3, log10.3, log1p.3, log2.3, logb.3, lrint.3, lround.3, lsearch.3, lseek64.3, makecontext.3, makedev.3, mallinfo.3, malloc.3, malloc_get_state.3, malloc_info.3, malloc_stats.3, malloc_trim.3, malloc_usable_size.3, mallopt.3, matherr.3, mcheck.3, memccpy.3, memchr.3, memcmp.3, memcpy.3, memfrob.3, memmem.3, memmove.3, memset.3, mkdtemp.3, mkfifo.3, mkfifoat.3, mkstemp.3, mktemp.3, modf.3, mq_close.3, mq_getattr.3, mq_notify.3, mq_open.3, mq_receive.3, mq_send.3, mq_unlink.3, mtrace.3, on_exit.3, opendir.3, posix_fallocate.3, posix_memalign.3, posix_openpt.3, pow.3, pow10.3, profil.3, psignal.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_detach.3, pthread_equal.3, pthread_exit.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_join.3, pthread_kill.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_setschedprio.3, pthread_sigmask.3, pthread_sigqueue.3, pthread_testcancel.3, pthread_tryjoin_np.3, pthread_yield.3, putenv.3, putpwent.3, puts.3, qecvt.3, qsort.3, raise.3, rand.3, random.3, random_r.3, re_comp.3, readdir.3, realpath.3, regex.3, remainder.3, remove.3, resolver.3, rewinddir.3, rint.3, round.3, scalb.3, scalbln.3, scandir.3, sched_getcpu.3, seekdir.3, sem_close.3, sem_destroy.3, sem_getvalue.3, sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sem_wait.3, setenv.3, setlocale.3, setlogmask.3, shm_open.3, siginterrupt.3, sigpause.3, sigqueue.3, sigset.3, sigsetops.3, sigvec.3, sigwait.3, sin.3, sinh.3, sleep.3, sockatmark.3, sqrt.3, statvfs.3, stdio_ext.3, stpcpy.3, strcasecmp.3, strcat.3, strchr.3, strcmp.3, strcoll.3, strcpy.3, strdup.3, strerror.3, strfry.3, strftime.3, string.3, strlen.3, strpbrk.3, strptime.3, strsep.3, strsignal.3, strspn.3, strstr.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, strxfrm.3, swab.3, sysconf.3, syslog.3, system.3, sysv_signal.3, tan.3, tanh.3, tcgetpgrp.3, tcgetsid.3, telldir.3, tempnam.3, timegm.3, timeradd.3, tmpfile.3, tmpnam.3, toascii.3, toupper.3, trunc.3, tsearch.3, ttyslot.3, tzset.3, ulimit.3, undocumented.3, unlocked_stdio.3, usleep.3, y0.3, cpuid.4, full.4, initrd.4, mouse.4, msr.4, sd.4, st.4, acct.5, core.5, services.5, slabinfo.5, aio.7, capabilities.7, credentials.7, feature_test_macros.7, hier.7, inotify.7, libc.7, locale.7, man-pages.7, man.7, math_error.7, mq_overview.7, numa.7, path_resolution.7, pipe.7, pthreads.7, pty.7, rtld-audit.7, sem_overview.7, shm_overview.7, sigevent.7, signal.7, suffixes.7, svipc.7, termio.7, time.7, udplite.7, units.7, uri.7, sln.8: Global fix: Add LICENSE_START(verbatim)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-10 09:28:40 +00:00
|
|
|
.\" %%%LICENSE_END
|
2006-04-21 06:47:08 +00:00
|
|
|
.\"
|
2014-03-20 07:32:26 +00:00
|
|
|
.TH FEATURE_TEST_MACROS 7 2014-03-20 "Linux" "Linux Programmer's Manual"
|
2006-04-21 06:47:08 +00:00
|
|
|
.SH NAME
|
2006-05-15 09:13:10 +00:00
|
|
|
feature_test_macros \- feature test macros
|
2006-04-21 06:47:08 +00:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <features.h>
|
2007-12-23 21:05:57 +00:00
|
|
|
.fi
|
2006-04-21 06:47:08 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
Feature test macros allow the programmer to control the definitions that
|
|
|
|
are exposed by system header files when a program is compiled.
|
2010-09-10 05:14:41 +00:00
|
|
|
|
2010-09-10 05:15:16 +00:00
|
|
|
.B NOTE:
|
|
|
|
In order to be effective, a feature test macro
|
|
|
|
.IR "must be defined before including any header files" .
|
2010-09-10 05:19:12 +00:00
|
|
|
This can be done either in the compilation command
|
2010-09-10 05:15:16 +00:00
|
|
|
.RI ( "cc \-DMACRO=value" )
|
|
|
|
or by defining the macro within the source code before
|
|
|
|
including any headers.
|
|
|
|
|
2010-09-10 05:14:41 +00:00
|
|
|
Some feature test macros are useful for creating portable applications,
|
accept.2, execve.2, futimesat.2, getresuid.2, getrlimit.2, madvise.2, mq_getsetattr.2, msgctl.2, nice.2, open.2, poll.2, setresuid.2, shmctl.2, sigaction.2, times.2, utimensat.2, __setfpucw.3, atoi.3, endian.3, err.3, euidaccess.3, fenv.3, fopencookie.3, fpurge.3, getgrouplist.3, getutmp.3, j0.3, lgamma.3, netlink.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_cleanup_push_defer_np.3, pthread_getattr_np.3, pthread_kill_other_threads_np.3, pthread_setaffinity_np.3, pthread_tryjoin_np.3, pthread_yield.3, random_r.3, readdir.3, rtnetlink.3, scanf.3, setenv.3, significand.3, sigsetops.3, strerror.3, strstr.3, sysv_signal.3, termios.3, timegm.3, unlocked_stdio.3, y0.3, locale.5, bootparam.7, feature_test_macros.7, ip.7, locale.7, pthreads.7, rtld-audit.7, nscd.8: Global fix: s/non-standard/nonstandard/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:37:52 +00:00
|
|
|
by preventing nonstandard definitions from being exposed.
|
|
|
|
Other macros can be used to expose nonstandard definitions that
|
2006-04-21 06:47:08 +00:00
|
|
|
are not exposed by default.
|
2007-04-12 22:42:49 +00:00
|
|
|
The precise effects of each of the feature test macros described below
|
2006-04-21 06:47:08 +00:00
|
|
|
can be ascertained by inspecting the
|
|
|
|
.I <features.h>
|
|
|
|
header file.
|
2007-07-03 18:01:51 +00:00
|
|
|
.SS Specification of feature test macro requirements in manual pages
|
|
|
|
When a function requires that a feature test macro is defined,
|
2007-07-08 10:26:24 +00:00
|
|
|
the manual page SYNOPSIS typically includes a note of the following form
|
2007-07-03 18:01:51 +00:00
|
|
|
(this example from the
|
2010-11-01 14:44:32 +00:00
|
|
|
.BR acct (2)
|
2007-07-03 19:28:01 +00:00
|
|
|
manual page):
|
2010-11-01 14:44:32 +00:00
|
|
|
.RS 8
|
2007-07-03 18:01:51 +00:00
|
|
|
.sp
|
2010-11-01 14:44:32 +00:00
|
|
|
.B #include <unistd.h>
|
2007-07-03 18:01:51 +00:00
|
|
|
.sp
|
2010-11-01 14:44:32 +00:00
|
|
|
.BI "int acct(const char *" filename );
|
2007-07-03 18:01:51 +00:00
|
|
|
.sp
|
2010-09-10 05:13:11 +00:00
|
|
|
.nf
|
2007-07-03 18:01:51 +00:00
|
|
|
.in -4n
|
|
|
|
Feature Test Macro Requirements for glibc (see
|
|
|
|
.BR feature_test_macros (7)):
|
2010-09-10 05:13:11 +00:00
|
|
|
.fi
|
2007-07-03 18:01:51 +00:00
|
|
|
.in
|
|
|
|
.sp
|
2010-11-01 14:44:32 +00:00
|
|
|
.BR acct ():
|
|
|
|
_BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
|
2007-07-03 18:01:51 +00:00
|
|
|
.RE
|
|
|
|
.PP
|
2013-06-08 04:48:01 +00:00
|
|
|
The
|
|
|
|
.B ||
|
|
|
|
means that in order to obtain the declaration of
|
2010-11-01 14:44:32 +00:00
|
|
|
.BR acct (2)
|
2007-07-03 18:01:51 +00:00
|
|
|
from
|
2010-11-01 14:44:32 +00:00
|
|
|
.IR <unistd.h> ,
|
2013-06-08 04:48:01 +00:00
|
|
|
.I either
|
|
|
|
of the following macro
|
2007-07-03 18:01:51 +00:00
|
|
|
definitions must be made before including any header files:
|
|
|
|
.RS
|
2007-12-23 17:46:23 +00:00
|
|
|
.nf
|
2007-07-03 18:01:51 +00:00
|
|
|
|
2007-07-08 10:26:24 +00:00
|
|
|
#define _BSD_SOURCE
|
2010-11-01 14:44:32 +00:00
|
|
|
#define _XOPEN_SOURCE /* or any value < 500 */
|
2007-07-03 18:01:51 +00:00
|
|
|
.fi
|
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
Alternatively, equivalent definitions can be included in the
|
|
|
|
compilation command:
|
|
|
|
.RS
|
2007-12-23 17:46:23 +00:00
|
|
|
.nf
|
2006-04-21 06:47:08 +00:00
|
|
|
|
2008-06-26 13:23:48 +00:00
|
|
|
cc \-D_BSD_SOURCE
|
2010-11-01 14:44:32 +00:00
|
|
|
cc \-D_XOPEN_SOURCE # Or any value < 500
|
2007-07-03 18:01:51 +00:00
|
|
|
.fi
|
|
|
|
.RE
|
|
|
|
.PP
|
2007-07-08 10:26:24 +00:00
|
|
|
Note that, as described below,
|
2007-11-17 04:31:05 +00:00
|
|
|
.BR "some feature test macros are defined by default" ,
|
2007-07-08 10:26:24 +00:00
|
|
|
so that it may not always be necessary to
|
2007-07-03 19:28:01 +00:00
|
|
|
explicitly specify the feature test macro(s) shown in the
|
|
|
|
SYNOPSIS.
|
|
|
|
|
|
|
|
In a few cases, manual pages use a shorthand for expressing the
|
|
|
|
feature test macro requirements (this example from
|
|
|
|
.BR readahead (2)):
|
|
|
|
.RS
|
|
|
|
.nf
|
|
|
|
|
|
|
|
.B #define _GNU_SOURCE
|
|
|
|
.B #include <fcntl.h>
|
|
|
|
.sp
|
|
|
|
.BI "ssize_t readahead(int " fd ", off64_t *" offset ", size_t " count );
|
|
|
|
.fi
|
|
|
|
.RE
|
|
|
|
.PP
|
2007-07-08 12:39:24 +00:00
|
|
|
This format is employed in cases where only a single
|
2007-07-03 19:28:01 +00:00
|
|
|
feature test macro can be used to expose the function
|
|
|
|
declaration, and that macro is not defined by default.
|
2007-07-03 18:01:51 +00:00
|
|
|
.SS Feature test macros understood by glibc
|
2007-07-04 18:30:05 +00:00
|
|
|
The following paragraphs explain how feature test macros are handled
|
2013-06-08 04:48:01 +00:00
|
|
|
in Linux glibc 2.\fIx\fP,
|
|
|
|
.I x
|
|
|
|
> 0.
|
2007-07-04 18:30:48 +00:00
|
|
|
.\" The details in glibc 2.0 are simpler, but combining a
|
2007-07-04 18:30:05 +00:00
|
|
|
.\" a description of them with the details in later glibc versions
|
|
|
|
.\" would make for a complicated description.
|
2007-07-08 10:26:24 +00:00
|
|
|
|
2007-07-04 18:30:05 +00:00
|
|
|
Linux glibc understands the following feature test macros:
|
2007-07-03 21:49:06 +00:00
|
|
|
.TP
|
|
|
|
.B __STRICT_ANSI__
|
|
|
|
ISO Standard C.
|
|
|
|
This macro is implicitly defined by
|
|
|
|
.BR gcc (1)
|
|
|
|
when invoked with, for example, the
|
|
|
|
.I -std=c99
|
|
|
|
or
|
|
|
|
.I -ansi
|
|
|
|
flag.
|
2006-04-21 06:47:08 +00:00
|
|
|
.TP
|
|
|
|
.B _POSIX_C_SOURCE
|
2007-07-08 10:26:24 +00:00
|
|
|
Defining this macro causes header files to expose definitions as follows:
|
|
|
|
.RS
|
|
|
|
.IP \(bu 3
|
|
|
|
The value 1 exposes definitions conforming to POSIX.1-1990 and
|
|
|
|
ISO C (1990).
|
|
|
|
.IP \(bu
|
|
|
|
The value 2 or greater additionally exposes
|
2007-07-03 18:01:51 +00:00
|
|
|
definitions for POSIX.2-1992.
|
2007-07-08 10:26:24 +00:00
|
|
|
.IP \(bu
|
|
|
|
The value 199309L or greater additionally exposes
|
2006-04-21 06:47:08 +00:00
|
|
|
definitions for POSIX.1b (real-time extensions).
|
intro.1, _syscall.2, access.2, arch_prctl.2, cacheflush.2, chown.2, clock_getres.2, clone.2, create_module.2, fcntl.2, flock.2, get_kernel_syms.2, get_robust_list.2, get_thread_area.2, getcpu.2, getpriority.2, getrlimit.2, getrusage.2, ioprio_set.2, kexec_load.2, madvise.2, mbind.2, migrate_pages.2, mknod.2, mmap.2, mount.2, move_pages.2, mprotect.2, open.2, pause.2, pciconfig_read.2, perf_event_open.2, prctl.2, ptrace.2, query_module.2, read.2, reboot.2, recv.2, s390_runtime_instr.2, sched_setscheduler.2, select_tut.2, send.2, set_mempolicy.2, setfsgid.2, setfsuid.2, sigaction.2, spu_create.2, spu_run.2, stime.2, swapon.2, syslog.2, timer_create.2, timer_getoverrun.2, times.2, tkill.2, umount.2, unimplemented.2, ustat.2, vm86.2, wait.2, abs.3, aio_read.3, aio_write.3, bsd_signal.3, catgets.3, clearenv.3, cmsg.3, dbopen.3, dirfd.3, dlopen.3, exec.3, fenv.3, ferror.3, fmemopen.3, fnmatch.3, fopen.3, futimes.3, getaddrinfo.3, getifaddrs.3, getipnodebyname.3, hsearch.3, if_nameindex.3, inet_pton.3, mblen.3, mbrlen.3, mbsrtowcs.3, mbtowc.3, mcheck.3, memfrob.3, mq_notify.3, netlink.3, posix_memalign.3, printf.3, pthread_attr_setscope.3, pthread_cleanup_push.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, raise.3, resolver.3, rpc.3, rtime.3, rtnetlink.3, scanf.3, setbuf.3, setnetgrent.3, shm_open.3, sigpause.3, sigset.3, sigwait.3, sockatmark.3, strcasecmp.3, strcmp.3, strdup.3, strftime.3, strptime.3, strsignal.3, strverscmp.3, sysv_signal.3, termios.3, wcrtomb.3, wcsnlen.3, wcsnrtombs.3, wcsrtombs.3, wctomb.3, wprintf.3, console_codes.4, cpuid.4, msr.4, rtc.4, sk98lin.4, st.4, tty.4, charmap.5, core.5, elf.5, hosts.equiv.5, proc.5, resolv.conf.5, services.5, slabinfo.5, arp.7, bootparam.7, capabilities.7, charsets.7, cpuset.7, ddp.7, epoll.7, feature_test_macros.7, futex.7, hier.7, icmp.7, inotify.7, ip.7, ipv6.7, man-pages.7, mdoc.7, mdoc.samples.7, netdevice.7, netlink.7, numa.7, packet.7, path_resolution.7, posixoptions.7, pthreads.7, raw.7, rtld-audit.7, rtnetlink.7, sem_overview.7, sigevent.7, socket.7, spufs.7, tcp.7, udp.7, unicode.7, uri.7, utf-8.7, intro.8, ldconfig.8, sync.8: Global fix: fix placement of word "only"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-31 08:53:00 +00:00
|
|
|
.\" 199506L functionality is available only since glibc 2.1
|
2007-07-08 10:26:24 +00:00
|
|
|
.IP \(bu
|
|
|
|
The value 199506L or greater additionally exposes
|
2006-04-21 06:47:08 +00:00
|
|
|
definitions for POSIX.1c (threads).
|
2007-07-08 10:26:24 +00:00
|
|
|
.IP \(bu
|
|
|
|
(Since glibc 2.3.3)
|
2014-03-11 07:51:34 +00:00
|
|
|
The value 200112L or greater additionally exposes definitions corresponding
|
2014-03-11 06:56:06 +00:00
|
|
|
to the POSIX.1-2001 base specification (excluding the XSI extension)
|
2014-03-11 13:26:56 +00:00
|
|
|
and also causes C95 (since glibc 2.12) and
|
|
|
|
C99 (since glibc 2.10) features to be exposed.
|
2009-04-02 21:12:56 +00:00
|
|
|
.IP \(bu
|
|
|
|
(Since glibc 2.10)
|
2014-03-11 07:51:34 +00:00
|
|
|
The value 200809L or greater additionally exposes definitions corresponding
|
2009-04-02 21:12:56 +00:00
|
|
|
to the POSIX.1-2008 base specification (excluding the XSI extension).
|
2007-07-08 10:26:24 +00:00
|
|
|
.RE
|
2007-04-12 22:42:49 +00:00
|
|
|
.TP
|
2006-05-15 09:05:26 +00:00
|
|
|
.B _POSIX_SOURCE
|
2006-04-21 06:47:08 +00:00
|
|
|
Defining this obsolete macro with any value is equivalent to defining
|
|
|
|
.B _POSIX_C_SOURCE
|
|
|
|
with the value 1.
|
|
|
|
.TP
|
|
|
|
.B _XOPEN_SOURCE
|
2007-07-08 10:26:24 +00:00
|
|
|
Defining this macro causes header files to expose definitions as follows:
|
|
|
|
.RS
|
|
|
|
.IP \(bu 3
|
|
|
|
Defining with any value exposes
|
2006-04-21 06:47:08 +00:00
|
|
|
definitions conforming to POSIX.1, POSIX.2, and XPG4.
|
2007-07-08 10:26:24 +00:00
|
|
|
.IP \(bu
|
|
|
|
The value 500 or greater additionally exposes
|
2006-04-21 06:47:08 +00:00
|
|
|
definitions for SUSv2 (UNIX 98).
|
2007-07-08 10:26:24 +00:00
|
|
|
.IP \(bu
|
|
|
|
(Since glibc 2.2) The value 600 or greater additionally exposes
|
2007-04-12 22:42:49 +00:00
|
|
|
definitions for SUSv3 (UNIX 03; i.e., the POSIX.1-2001 base specification
|
2007-07-09 21:39:53 +00:00
|
|
|
plus the XSI extension) and C99 definitions.
|
2009-04-02 21:12:56 +00:00
|
|
|
.IP \(bu
|
|
|
|
(Since glibc 2.10) The value 700 or greater additionally exposes
|
|
|
|
definitions for SUSv4 (i.e., the POSIX.1-2008 base specification
|
|
|
|
plus the XSI extension).
|
2007-07-08 10:26:24 +00:00
|
|
|
.RE
|
2014-03-11 07:32:17 +00:00
|
|
|
.IP
|
|
|
|
If
|
|
|
|
.B __STRICT_ANSI__
|
|
|
|
is not defined, or
|
|
|
|
.BR _XOPEN_SOURCE
|
|
|
|
is defined with a value greater than or equal to 500
|
|
|
|
.I and
|
|
|
|
neither
|
|
|
|
.B _POSIX_SOURCE
|
|
|
|
not
|
|
|
|
.B _POSIX_C_SOURCE
|
|
|
|
is explicitly defined, then
|
|
|
|
the following macros are implicitly defined:
|
|
|
|
.RS
|
|
|
|
.IP \(bu 3
|
|
|
|
.B _POSIX_SOURCE
|
|
|
|
is defined with the value 1.
|
|
|
|
.IP \(bu
|
|
|
|
.B _POSIX_C_SOURCE
|
|
|
|
is defined, according to the value of
|
|
|
|
.BR _XOPEN_SOURCE :
|
|
|
|
.RS 7
|
|
|
|
.TP
|
|
|
|
.BR _XOPEN_SOURCE " < 500"
|
|
|
|
.B _POSIX_C_SOURCE
|
|
|
|
is defined with the value 2.
|
|
|
|
.TP
|
|
|
|
.RB "500 <= " _XOPEN_SOURCE " < 600"
|
|
|
|
.B _POSIX_C_SOURCE
|
|
|
|
is defined with the value 199506L.
|
|
|
|
.TP
|
|
|
|
.RB "600 <= " _XOPEN_SOURCE " < 700"
|
|
|
|
.B _POSIX_C_SOURCE
|
|
|
|
is defined with the value 200112L.
|
|
|
|
.TP
|
|
|
|
.RB "700 <= " _XOPEN_SOURCE " (since glibc 2.10)"
|
|
|
|
.B _POSIX_C_SOURCE
|
|
|
|
is defined with the value 200809L.
|
|
|
|
.RE
|
|
|
|
.RE
|
2006-04-21 06:47:08 +00:00
|
|
|
.TP
|
|
|
|
.B _XOPEN_SOURCE_EXTENDED
|
2007-07-08 10:26:24 +00:00
|
|
|
If this macro is defined, and
|
2007-09-20 16:26:31 +00:00
|
|
|
.B _XOPEN_SOURCE
|
2006-04-21 06:47:08 +00:00
|
|
|
is defined, then expose definitions corresponding to the XPG4v2
|
2007-07-03 18:01:51 +00:00
|
|
|
(SUSv1) UNIX extensions (UNIX 95).
|
|
|
|
This macro is also implicitly defined if
|
|
|
|
.B _XOPEN_SOURCE
|
|
|
|
is defined with a value of 500 or more.
|
2006-04-21 06:47:08 +00:00
|
|
|
.TP
|
2014-03-11 07:44:26 +00:00
|
|
|
.BR _ISOC99_SOURCE " (since glibc 2.1.3)"
|
2014-03-13 08:21:32 +00:00
|
|
|
Exposes declarations consistent with the ISO C99 standard.
|
2014-03-11 07:44:26 +00:00
|
|
|
|
|
|
|
Earlier glibc 2.1.x versions recognized an equivalent macro named
|
2007-07-04 19:03:01 +00:00
|
|
|
.B _ISOC9X_SOURCE
|
|
|
|
(because the C99 standard had not then been finalized).
|
2014-03-11 07:44:26 +00:00
|
|
|
Although the use of this macro is obsolete, glibc continues
|
Changes.old, clone.2, execve.2, fcntl.2, futex.2, getitimer.2, getpriority.2, mmap.2, mount.2, mprotect.2, sched_setscheduler.2, select_tut.2, setuid.2, sigaltstack.2, vfork.2, div.3, fenv.3, fmod.3, memchr.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_getattr_np.3, queue.3, scanf.3, trunc.3, st.4, proc.5, services.5, utmp.5, bootparam.7, capabilities.7, feature_test_macros.7, futex.7, glob.7, man.7, netlink.7, unicode.7: Switch to American usage: "-wards" ==> "-ward"
American English uses "afterward" in preference to "afterwards",
and so on
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-09-26 05:34:47 +00:00
|
|
|
to recognize it for backward compatibility.
|
2014-03-13 08:15:34 +00:00
|
|
|
|
|
|
|
Defining
|
|
|
|
.B _ISOC99_SOURCE
|
|
|
|
also exposes ISO C (1990) Amendment 1 ("C95") definitions.
|
|
|
|
(The primary change in C95 was support for international character sets.)
|
2006-04-21 06:47:08 +00:00
|
|
|
.TP
|
2014-03-11 06:41:45 +00:00
|
|
|
.BR _ISOC11_SOURCE " (since glibc 2.16)"
|
2012-01-18 01:21:03 +00:00
|
|
|
Exposes declarations consistent with the ISO C11 standard.
|
2014-03-11 06:44:00 +00:00
|
|
|
Defining this macro also enables C99 and C95 features (like
|
|
|
|
.BR _ISOC99_SOURCE ).
|
2012-01-18 01:21:03 +00:00
|
|
|
.TP
|
2006-04-21 06:47:08 +00:00
|
|
|
.B _LARGEFILE64_SOURCE
|
2007-04-12 22:42:49 +00:00
|
|
|
Expose definitions for the alternative API specified by the
|
|
|
|
LFS (Large File Summit) as a "transitional extension" to the
|
|
|
|
Single UNIX Specification.
|
capget.2, futex.2, sched_setscheduler.2, spu_create.2, spu_run.2, vfork.2, getnameinfo.3, netlink.3, cciss.4, console_codes.4, dsp56k.4, hpsa.4, sk98lin.4, filesystems.5, protocols.5, aio.7, capabilities.7, charsets.7, feature_test_macros.7, futex.7, hier.7, iso_8859-16.7, iso_8859-2.7, koi8-r.7, libc.7, man.7, netlink.7, numa.7, standards.7, unicode.7, units.7, uri.7, x25.7: Global fix: use UR macro where applicable
The syntax .UR http://example.com paired with .UE will create
links which one can interact, if the pager allows that. One
way to see the effect is ask the man(1) command to use browser
display, e.g.:
man -H man7/uri.7
("\:" is optional groff syntax to permit hyphenless line breaks.)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-08-13 08:02:36 +00:00
|
|
|
(See
|
|
|
|
.UR http:\:/\:/opengroup.org\:/platform\:/lfs.html
|
2014-03-20 05:49:33 +00:00
|
|
|
.UE .)
|
2007-07-03 18:01:51 +00:00
|
|
|
The alternative API consists of a set of new objects
|
|
|
|
(i.e., functions and types) whose names are suffixed with "64"
|
|
|
|
(e.g.,
|
|
|
|
.I off64_t
|
|
|
|
versus
|
|
|
|
.IR off_t ,
|
|
|
|
.BR lseek64 ()
|
|
|
|
versus
|
|
|
|
.BR lseek (),
|
|
|
|
etc.).
|
2014-03-20 07:14:10 +00:00
|
|
|
New programs should not employ this macro; instead
|
2007-09-20 16:26:31 +00:00
|
|
|
.I _FILE_OFFSET_BITS=64
|
2007-07-03 18:01:51 +00:00
|
|
|
should be employed.
|
2006-04-21 06:47:08 +00:00
|
|
|
.TP
|
2014-03-20 07:32:26 +00:00
|
|
|
.BR _LARGEFILE_SOURCE
|
|
|
|
This macro was historically used to expose certain functions (specifically
|
|
|
|
.BR fseeko (3)
|
|
|
|
and
|
|
|
|
.BR ftello (3))
|
|
|
|
that address limitations of earlier APIs
|
|
|
|
.RB ( feek (3)
|
|
|
|
and
|
|
|
|
.BR ftell (3))
|
|
|
|
that use
|
|
|
|
.IR "long int"
|
|
|
|
for file offsets.
|
|
|
|
This macro is implicitly defined if
|
|
|
|
.BR _XOPEN_SOURCE
|
|
|
|
is defined with a value greater than or equal to 500.
|
|
|
|
New programs should not employ this macro;
|
|
|
|
defining
|
|
|
|
.BR _XOPEN_SOURCE
|
|
|
|
as just described or defining
|
|
|
|
.B _FILE_OFFSET_BITS
|
|
|
|
with the value 64 is the preferred mechanism to achieve the same result.
|
|
|
|
.TP
|
2006-04-21 06:47:08 +00:00
|
|
|
.B _FILE_OFFSET_BITS
|
2007-04-12 22:42:49 +00:00
|
|
|
Defining this macro with the value 64
|
|
|
|
automatically converts references to 32-bit functions and data types
|
intro.1, time.1, access.2, acct.2, alloc_hugepages.2, bind.2, chdir.2, chmod.2, chown.2, chroot.2, clone.2, close.2, execve.2, fallocate.2, fcntl.2, getdents.2, getrusage.2, getxattr.2, init_module.2, inotify_add_watch.2, ioprio_set.2, kcmp.2, link.2, listxattr.2, lseek.2, madvise.2, mkdir.2, mknod.2, mmap.2, mount.2, move_pages.2, msgctl.2, nfsservctl.2, open.2, pivot_root.2, quotactl.2, read.2, readlink.2, removexattr.2, rename.2, rmdir.2, semctl.2, setfsgid.2, setfsuid.2, setresuid.2, setuid.2, setup.2, setxattr.2, shmctl.2, splice.2, spu_create.2, stat.2, statfs.2, swapon.2, symlink.2, sync.2, sync_file_range.2, sysfs.2, truncate.2, umount.2, unlink.2, unshare.2, ustat.2, utime.2, utimensat.2, write.2, btree.3, errno.3, fexecve.3, ftw.3, futimes.3, get_nprocs_conf.3, getcwd.3, getdirentries.3, getmntent.3, glob.3, mkfifo.3, mq_open.3, readdir.3, realpath.3, recno.3, remove.3, sem_open.3, shm_open.3, statvfs.3, sysconf.3, telldir.3, tmpfile.3, cciss.4, initrd.4, pts.4, sk98lin.4, vcs.4, core.5, filesystems.5, proc.5, boot.7, bootparam.7, capabilities.7, cpuset.7, credentials.7, feature_test_macros.7, fifo.7, hier.7, inotify.7, intro.7, mq_overview.7, path_resolution.7, pipe.7, sem_overview.7, shm_overview.7, spufs.7, symlink.7, unix.7, uri.7, sync.8: Global fix: s/file system/filesystem/
Notwithstanding 24d01c530c5a3f75217543d02bf6712395e5f90c,
"filesystem" is the form used by the great majority of man pages
outside the man-pages project and in a number of other sources,
so let's go with that.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-08-08 08:07:57 +00:00
|
|
|
related to file I/O and filesystem operations into references to
|
2006-04-21 06:47:08 +00:00
|
|
|
their 64-bit counterparts.
|
|
|
|
This is useful for performing I/O on large files (> 2 Gigabytes)
|
|
|
|
on 32-bit systems.
|
2007-07-03 18:01:51 +00:00
|
|
|
(Defining this macro permits correctly written programs to use
|
|
|
|
large files with only a recompilation being required.)
|
2014-03-10 09:12:37 +00:00
|
|
|
|
2007-07-03 18:01:51 +00:00
|
|
|
64-bit systems naturally permit file sizes greater than 2 Gigabytes,
|
|
|
|
and on those systems this macro has no effect.
|
2006-04-21 06:47:08 +00:00
|
|
|
.TP
|
2014-03-10 16:20:06 +00:00
|
|
|
.BR _BSD_SOURCE " (deprecated since glibc 2.20)"
|
2007-07-04 18:30:05 +00:00
|
|
|
Defining this macro with any value causes header files to expose
|
2006-04-21 06:47:08 +00:00
|
|
|
BSD-derived definitions.
|
2014-03-10 09:12:37 +00:00
|
|
|
|
2014-01-05 21:22:52 +00:00
|
|
|
In glibc versions up to and including 2.18,
|
|
|
|
defining this macro also causes BSD definitions to be preferred in
|
2007-07-03 18:01:51 +00:00
|
|
|
some situations where standards conflict, unless one or more of
|
|
|
|
.BR _SVID_SOURCE ,
|
|
|
|
.BR _POSIX_SOURCE ,
|
|
|
|
.BR _POSIX_C_SOURCE ,
|
|
|
|
.BR _XOPEN_SOURCE ,
|
|
|
|
.BR _XOPEN_SOURCE_EXTENDED ,
|
|
|
|
or
|
2007-09-20 16:26:31 +00:00
|
|
|
.B _GNU_SOURCE
|
2007-07-03 18:01:51 +00:00
|
|
|
is defined, in which case BSD definitions are disfavored.
|
2014-01-05 21:22:52 +00:00
|
|
|
Since glibc 2.19,
|
|
|
|
.B _BSD_SOURCE
|
|
|
|
no longer causes BSD definitions to be preferred in case of conflicts.
|
2014-03-10 16:20:06 +00:00
|
|
|
|
|
|
|
Since glibc 2.20, this macro is deprecated.
|
|
|
|
.\" commit c941736c92fa3a319221f65f6755659b2a5e0a20
|
|
|
|
.\" commit 498afc54dfee41d33ba519f496e96480badace8e
|
|
|
|
.\" commit acd7f096d79c181866d56d4aaf3b043e741f1e2c
|
|
|
|
It now has the same effect as defining
|
|
|
|
.BR _DEFAULT_SOURCE ,
|
|
|
|
but generates a compile-time warning (unless
|
|
|
|
.BR _DEFAULT_SOURCE
|
|
|
|
.\" commit ade40b10ff5fa59a318cf55b9d8414b758e8df78
|
|
|
|
is also defined).
|
|
|
|
Use
|
|
|
|
.B _DEFAULT_SOURCE
|
|
|
|
instead.
|
2014-03-14 09:37:45 +00:00
|
|
|
To allow code that requires
|
|
|
|
.BR _BSD_SOURCE
|
|
|
|
in glibc 2.19 and earlier and
|
|
|
|
.BR _DEFAULT_SOURCE
|
|
|
|
in glibc 2.20 and later to compile without warnings, define
|
|
|
|
.I both
|
|
|
|
.B _BSD_SOURCE
|
|
|
|
and
|
|
|
|
.BR _DEFAULT_SOURCE .
|
2006-04-21 06:47:08 +00:00
|
|
|
.TP
|
2014-03-10 16:20:06 +00:00
|
|
|
.BR _SVID_SOURCE " (deprecated since glibc 2.20)"
|
2007-07-04 18:30:05 +00:00
|
|
|
Defining this macro with any value causes header files to expose
|
2007-04-12 22:42:49 +00:00
|
|
|
System V-derived definitions.
|
2006-08-03 13:58:08 +00:00
|
|
|
(SVID == System V Interface Definition; see
|
|
|
|
.BR standards (7).)
|
2014-03-10 16:20:06 +00:00
|
|
|
|
|
|
|
Since glibc 2.20, this macro is deprecated in the same fashion as
|
|
|
|
.BR _BSD_SOURCE .
|
2006-04-21 06:47:08 +00:00
|
|
|
.TP
|
2014-01-06 02:17:54 +00:00
|
|
|
.BR _DEFAULT_SOURCE " (since glibc 2.19)"
|
|
|
|
This macro can be defined to ensure that the "default"
|
|
|
|
definitions are provided even when the defaults would otherwise
|
|
|
|
be disabled,
|
|
|
|
as happens when individual macros are explicitly defined,
|
|
|
|
or the compiler is invoked in one of its "standard" modes (e.g.,
|
|
|
|
.IR "cc\ \-std=c99" ).
|
2014-03-10 09:05:24 +00:00
|
|
|
Defining
|
|
|
|
.B _DEFAULT_SOURCE
|
|
|
|
without defining other individual macros
|
|
|
|
or invoking the compiler in one of its "standard" modes has no effect.
|
|
|
|
|
|
|
|
The "default" definitions comprise those required by POSIX.1-2008
|
|
|
|
as well as various definitions derived from BSD and System V.
|
|
|
|
On glibc 2.19 and earlier, these defaults were approximately equivalent
|
|
|
|
to explicitly defining the following:
|
|
|
|
|
|
|
|
cc \-D_BSD_SOURCE \-D_SVID_SOURCE \-D_POSIX_C_SOURCE=200809
|
|
|
|
|
2014-01-06 02:17:54 +00:00
|
|
|
.TP
|
2007-07-04 19:03:01 +00:00
|
|
|
.BR _ATFILE_SOURCE " (since glibc 2.4)"
|
2007-07-04 18:30:05 +00:00
|
|
|
Defining this macro with any value causes header files to expose
|
2007-07-03 21:49:06 +00:00
|
|
|
declarations of a range of functions with the suffix "at";
|
|
|
|
see
|
|
|
|
.BR openat (2).
|
2009-12-13 16:29:25 +00:00
|
|
|
Since glibc 2.10, this macro is also implicitly defined if
|
|
|
|
.BR _POSIX_C_SOURCE
|
|
|
|
is defined with a value greater than or equal to 200809L.
|
2007-07-03 21:49:06 +00:00
|
|
|
.TP
|
2006-04-21 06:47:08 +00:00
|
|
|
.B _GNU_SOURCE
|
2014-03-11 07:56:11 +00:00
|
|
|
Defining this macro (with any value) implicitly defines
|
2007-07-03 21:49:06 +00:00
|
|
|
.BR _ATFILE_SOURCE ,
|
2006-04-21 06:47:08 +00:00
|
|
|
.BR _LARGEFILE64_SOURCE ,
|
2007-07-03 21:49:06 +00:00
|
|
|
.BR _ISOC99_SOURCE ,
|
|
|
|
.BR _XOPEN_SOURCE_EXTENDED ,
|
|
|
|
.BR _POSIX_SOURCE ,
|
2007-09-20 16:26:31 +00:00
|
|
|
.B _POSIX_C_SOURCE
|
2009-04-02 21:12:56 +00:00
|
|
|
with the value 200809L
|
|
|
|
(200112L in glibc versions before 2.10;
|
|
|
|
199506L in glibc versions before 2.5;
|
|
|
|
199309L in glibc versions before 2.1)
|
2007-07-08 10:26:24 +00:00
|
|
|
and
|
2007-09-20 16:26:31 +00:00
|
|
|
.B _XOPEN_SOURCE
|
2009-04-02 21:12:56 +00:00
|
|
|
with the value 700
|
|
|
|
(600 in glibc versions before 2.10;
|
|
|
|
500 in glibc versions before 2.2).
|
2006-04-21 06:47:08 +00:00
|
|
|
In addition, various GNU-specific extensions are also exposed.
|
2014-03-10 09:05:24 +00:00
|
|
|
|
|
|
|
Since glibc 2.19, defining
|
|
|
|
.BR _GNU_SOURCE
|
2014-03-11 07:56:11 +00:00
|
|
|
also has the effect of implicitly defining
|
2014-03-10 09:05:24 +00:00
|
|
|
.BR _DEFAULT_SOURCE .
|
|
|
|
In glibc versions before 2.20, defining
|
|
|
|
.BR _GNU_SOURCE
|
2014-03-11 07:56:11 +00:00
|
|
|
also had the effect of implicitly defining
|
2014-03-10 09:05:24 +00:00
|
|
|
.BR _BSD_SOURCE
|
|
|
|
and
|
|
|
|
.BR _SVID_SOURCE .
|
2007-01-28 19:30:54 +00:00
|
|
|
.TP
|
|
|
|
.B _REENTRANT
|
|
|
|
Defining this macro exposes definitions of certain reentrant functions.
|
2007-02-01 06:11:02 +00:00
|
|
|
For multithreaded programs, use
|
2008-06-26 13:23:48 +00:00
|
|
|
.I "cc\ \-pthread"
|
2007-01-28 19:30:54 +00:00
|
|
|
instead.
|
|
|
|
.TP
|
|
|
|
.B _THREAD_SAFE
|
2007-04-12 22:42:49 +00:00
|
|
|
Synonym for
|
2007-01-28 19:30:54 +00:00
|
|
|
.BR _REENTRANT ,
|
|
|
|
provided for compatibility with some other implementations.
|
|
|
|
.TP
|
2007-07-04 19:03:01 +00:00
|
|
|
.BR _FORTIFY_SOURCE " (since glibc 2.3.4)"
|
2007-01-28 19:30:54 +00:00
|
|
|
.\" For more detail, see:
|
|
|
|
.\" http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
|
|
|
|
.\" [PATCH] Object size checking to prevent (some) buffer overflows
|
|
|
|
.\" * From: Jakub Jelinek <jakub at redhat dot com>
|
|
|
|
.\" * To: gcc-patches at gcc dot gnu dot org
|
|
|
|
.\" * Date: Tue, 21 Sep 2004 04:16:40 -0400
|
|
|
|
Defining this macro causes some lightweight checks to be performed
|
|
|
|
to detect some buffer overflow errors when employing
|
|
|
|
various string and memory manipulation functions.
|
|
|
|
Not all buffer overflows are detected, just some common cases.
|
2014-03-10 09:12:37 +00:00
|
|
|
|
2013-08-24 20:12:21 +00:00
|
|
|
In the current implementation, checks are added for
|
2007-04-12 22:42:49 +00:00
|
|
|
calls to
|
2007-01-28 19:30:54 +00:00
|
|
|
.BR memcpy (3),
|
|
|
|
.BR mempcpy (3),
|
|
|
|
.BR memmove (3),
|
|
|
|
.BR memset (3),
|
|
|
|
.BR stpcpy (3),
|
|
|
|
.BR strcpy (3),
|
|
|
|
.BR strncpy (3),
|
|
|
|
.BR strcat (3),
|
|
|
|
.BR strncat (3),
|
|
|
|
.BR sprintf (3),
|
|
|
|
.BR snprintf (3),
|
|
|
|
.BR vsprintf (3),
|
|
|
|
.BR vsnprintf (3),
|
2007-04-12 22:42:49 +00:00
|
|
|
and
|
2007-01-28 19:30:54 +00:00
|
|
|
.BR gets (3).
|
2014-03-10 09:12:37 +00:00
|
|
|
|
2007-04-12 22:42:49 +00:00
|
|
|
If
|
|
|
|
.B _FORTIFY_SOURCE
|
|
|
|
is set to 1, with compiler optimization level 1
|
2008-06-26 13:23:48 +00:00
|
|
|
.RI ( "gcc\ \-O1" )
|
2007-06-08 09:56:56 +00:00
|
|
|
and above, checks that shouldn't change the behavior of
|
2007-01-28 19:30:54 +00:00
|
|
|
conforming programs are performed.
|
2007-04-12 22:42:49 +00:00
|
|
|
With
|
|
|
|
.B _FORTIFY_SOURCE
|
2007-01-28 19:30:54 +00:00
|
|
|
set to 2 some more checking is added, but
|
|
|
|
some conforming programs might fail.
|
2007-04-12 22:42:49 +00:00
|
|
|
Some of the checks can be performed at compile time,
|
|
|
|
and result in compiler warnings;
|
|
|
|
other checks take place at run time,
|
2007-01-28 19:30:54 +00:00
|
|
|
and result in a run-time error if the check fails.
|
2014-03-10 09:12:37 +00:00
|
|
|
|
2007-01-28 19:30:54 +00:00
|
|
|
Use of this macro requires compiler support, available with
|
|
|
|
.BR gcc (1)
|
|
|
|
since version 4.0.
|
2007-07-03 21:49:06 +00:00
|
|
|
.SS Default definitions, implicit definitions, and combining definitions
|
2006-04-21 07:01:40 +00:00
|
|
|
.PP
|
2007-07-04 18:30:05 +00:00
|
|
|
If no feature test macros are explicitly defined,
|
|
|
|
then the following feature test macros are defined by default:
|
2014-03-11 21:33:19 +00:00
|
|
|
.BR _BSD_SOURCE
|
2014-03-10 16:20:06 +00:00
|
|
|
(in glibc 2.19 and earlier),
|
2014-03-11 21:33:19 +00:00
|
|
|
.BR _SVID_SOURCE
|
2014-03-10 16:20:06 +00:00
|
|
|
(in glibc 2.19 and earlier),
|
2014-03-10 09:05:24 +00:00
|
|
|
.BR _DEFAULT_SOURCE
|
|
|
|
(since glibc 2.19),
|
2006-04-21 07:01:40 +00:00
|
|
|
.BR _POSIX_SOURCE ,
|
|
|
|
and
|
2009-09-27 07:26:41 +00:00
|
|
|
.BR _POSIX_C_SOURCE =200809L
|
2009-04-02 21:12:56 +00:00
|
|
|
(200112L in glibc versions before 2.10;
|
|
|
|
199506L in glibc versions before 2.4;
|
|
|
|
199309L in glibc versions before 2.1).
|
2007-07-03 21:49:06 +00:00
|
|
|
.PP
|
|
|
|
If any of
|
|
|
|
.BR __STRICT_ANSI__ ,
|
|
|
|
.BR _ISOC99_SOURCE ,
|
|
|
|
.BR _POSIX_SOURCE ,
|
|
|
|
.BR _POSIX_C_SOURCE ,
|
|
|
|
.BR _XOPEN_SOURCE ,
|
|
|
|
.BR _XOPEN_SOURCE_EXTENDED ,
|
2014-03-11 21:33:19 +00:00
|
|
|
.BR _BSD_SOURCE
|
2014-03-10 16:20:06 +00:00
|
|
|
(in glibc 2.19 and earlier),
|
2007-07-03 21:49:06 +00:00
|
|
|
or
|
2007-09-20 16:26:31 +00:00
|
|
|
.B _SVID_SOURCE
|
2014-03-10 16:20:06 +00:00
|
|
|
(in glibc 2.19 and earlier)
|
2007-07-03 21:49:06 +00:00
|
|
|
is explicitly defined, then
|
2014-03-10 09:05:24 +00:00
|
|
|
.BR _BSD_SOURCE ,
|
|
|
|
.BR _SVID_SOURCE ,
|
2007-07-03 21:49:06 +00:00
|
|
|
and
|
2014-03-10 09:05:24 +00:00
|
|
|
.BR _DEFAULT_SOURCE
|
2007-07-03 21:49:06 +00:00
|
|
|
are not defined by default.
|
|
|
|
|
|
|
|
If
|
2007-09-20 16:26:31 +00:00
|
|
|
.B _POSIX_SOURCE
|
2007-07-03 21:49:06 +00:00
|
|
|
and
|
2007-09-20 16:26:31 +00:00
|
|
|
.B _POSIX_C_SOURCE
|
2007-07-03 21:49:06 +00:00
|
|
|
are not explicitly defined,
|
|
|
|
and either
|
2007-09-20 16:26:31 +00:00
|
|
|
.B __STRICT_ANSI__
|
2007-07-03 21:49:06 +00:00
|
|
|
is not defined or
|
2007-09-20 16:26:31 +00:00
|
|
|
.B _XOPEN_SOURCE
|
2007-07-03 21:49:06 +00:00
|
|
|
is defined with a value of 500 or more, then
|
|
|
|
.IP * 3
|
|
|
|
.B _POSIX_SOURCE
|
|
|
|
is defined with the value 1; and
|
|
|
|
.IP *
|
|
|
|
.B _POSIX_C_SOURCE
|
|
|
|
is defined with one of the following values:
|
2014-03-10 09:06:47 +00:00
|
|
|
.RS 3
|
2007-07-03 21:49:06 +00:00
|
|
|
.IP \(bu 3
|
|
|
|
2,
|
2007-07-08 12:39:24 +00:00
|
|
|
if
|
2014-03-16 15:18:45 +00:00
|
|
|
.B _XOPEN_SOURCE
|
2007-07-03 21:49:06 +00:00
|
|
|
is defined with a value less than 500;
|
|
|
|
.IP \(bu
|
|
|
|
199506L,
|
2007-07-08 12:39:24 +00:00
|
|
|
if
|
2014-03-16 15:18:45 +00:00
|
|
|
.B _XOPEN_SOURCE
|
2007-07-03 21:49:06 +00:00
|
|
|
is defined with a value greater than or equal to 500 and less than 600;
|
|
|
|
or
|
|
|
|
.IP \(bu
|
2009-04-02 21:12:56 +00:00
|
|
|
(since glibc 2.4) 200112L,
|
|
|
|
if
|
2014-03-16 15:18:45 +00:00
|
|
|
.B _XOPEN_SOURCE
|
2009-04-02 21:12:56 +00:00
|
|
|
is defined with a value greater than or equal to 600 and less than 700.
|
|
|
|
.IP \(bu
|
|
|
|
(Since glibc 2.10)
|
|
|
|
200809L,
|
2007-07-08 12:39:24 +00:00
|
|
|
if
|
2014-03-16 15:18:45 +00:00
|
|
|
.B _XOPEN_SOURCE
|
2009-04-02 21:12:56 +00:00
|
|
|
is defined with a value greater than or equal to 700.
|
|
|
|
.IP \(bu
|
|
|
|
Older versions of glibc do not know about the values
|
2009-09-27 07:26:41 +00:00
|
|
|
200112L and 200809L for
|
2009-04-02 21:12:56 +00:00
|
|
|
.BR _POSIX_C_SOURCE ,
|
|
|
|
and the setting of this macro will depend on the glibc version.
|
|
|
|
.IP \(bu
|
|
|
|
If
|
|
|
|
.B _XOPEN_SOURCE
|
2009-04-15 16:03:12 +00:00
|
|
|
is undefined, then the setting of
|
2009-04-02 21:12:56 +00:00
|
|
|
.B _POSIX_C_SOURCE
|
|
|
|
depends on the glibc version:
|
|
|
|
199506L, in glibc versions before 2.4;
|
|
|
|
200112L, in glibc 2.4 to 2.9; and
|
|
|
|
200809L, since glibc 2.10.
|
2007-07-03 21:49:06 +00:00
|
|
|
.RE
|
|
|
|
.PP
|
2006-04-21 07:01:40 +00:00
|
|
|
Multiple macros can be defined; the results are additive.
|
2006-04-21 06:47:08 +00:00
|
|
|
.SH CONFORMING TO
|
|
|
|
POSIX.1 specifies
|
|
|
|
.BR _POSIX_C_SOURCE ,
|
|
|
|
.BR _POSIX_SOURCE ,
|
|
|
|
and
|
|
|
|
.BR _XOPEN_SOURCE .
|
2007-09-20 16:26:31 +00:00
|
|
|
.B _XOPEN_SOURCE_EXTENDED
|
2006-04-21 06:47:08 +00:00
|
|
|
was specified by XPG4v2 (aka SUSv1).
|
2007-07-03 21:49:06 +00:00
|
|
|
|
2007-09-20 16:26:31 +00:00
|
|
|
.B _FILE_OFFSET_BITS
|
2007-04-12 22:42:49 +00:00
|
|
|
is not specified by any standard,
|
2006-04-21 06:47:08 +00:00
|
|
|
but is employed on some other implementations.
|
2007-07-03 21:49:06 +00:00
|
|
|
|
2006-04-21 06:47:08 +00:00
|
|
|
.BR _BSD_SOURCE ,
|
|
|
|
.BR _SVID_SOURCE ,
|
2014-03-10 09:05:24 +00:00
|
|
|
.BR _DEFAULT_SOURCE ,
|
2007-07-04 18:30:05 +00:00
|
|
|
.BR _ATFILE_SOURCE ,
|
2007-01-28 19:30:54 +00:00
|
|
|
.BR _GNU_SOURCE ,
|
|
|
|
.BR _FORTIFY_SOURCE ,
|
|
|
|
.BR _REENTRANT ,
|
2006-04-21 06:47:08 +00:00
|
|
|
and
|
2007-09-20 16:26:31 +00:00
|
|
|
.B _THREAD_SAFE
|
2007-12-25 21:30:22 +00:00
|
|
|
are specific to Linux (glibc).
|
2006-04-21 06:47:08 +00:00
|
|
|
.SH NOTES
|
|
|
|
.I <features.h>
|
2007-12-25 20:50:22 +00:00
|
|
|
is a Linux/glibc-specific header file.
|
2006-04-21 06:47:08 +00:00
|
|
|
Other systems have an analogous file, but typically with a different name.
|
2007-04-12 22:42:49 +00:00
|
|
|
This header file is automatically included by other header files as
|
|
|
|
required: it is not necessary to explicitly include it in order to
|
2006-04-21 06:47:08 +00:00
|
|
|
employ feature test macros.
|
2007-01-28 17:44:00 +00:00
|
|
|
|
|
|
|
According to which of the above feature test macros are defined,
|
|
|
|
.I <features.h>
|
2007-04-12 22:42:49 +00:00
|
|
|
internally defines various other macros that are checked by
|
|
|
|
other glibc header files.
|
2007-12-16 13:49:59 +00:00
|
|
|
These macros have names prefixed by two underscores (e.g.,
|
|
|
|
.BR __USE_MISC ).
|
2013-06-08 04:48:01 +00:00
|
|
|
Programs should
|
|
|
|
.I never
|
|
|
|
define these macros directly:
|
2007-04-12 22:42:49 +00:00
|
|
|
instead, the appropriate feature test macro(s) from the
|
2007-01-28 17:44:00 +00:00
|
|
|
list above should be employed.
|
2009-04-02 21:48:24 +00:00
|
|
|
.SH EXAMPLE
|
|
|
|
The program below can be used to explore how the various
|
|
|
|
feature test macros are set depending on the glibc version
|
|
|
|
and what feature test macros are explicitly set.
|
|
|
|
The following shell session, on a system with glibc 2.10,
|
|
|
|
shows some examples of what we would see:
|
|
|
|
.in +4n
|
|
|
|
.nf
|
|
|
|
|
|
|
|
$ \fBcc ftm.c\fP
|
|
|
|
$ \fB./a.out\fP
|
|
|
|
_POSIX_SOURCE defined
|
|
|
|
_POSIX_C_SOURCE defined: 200809L
|
|
|
|
_BSD_SOURCE defined
|
|
|
|
_SVID_SOURCE defined
|
|
|
|
_ATFILE_SOURCE defined
|
fallocate.2, kexec_load.2, poll.2, spu_run.2, atan2.3, cbrt.3, clock_getcpuclockid.3, end.3, frexp.3, getgrouplist.3, getifaddrs.3, matherr.3, modf.3, pow.3, pthread_getattr_np.3, pthread_getcpuclockid.3, sched_getcpu.3, tgamma.3, mouse.4, proc.5, feature_test_macros.7, spufs.7: Global fix: properly escape minus sign
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2011-09-10 01:57:53 +00:00
|
|
|
$ \fBcc \-D_XOPEN_SOURCE=500 ftm.c\fP
|
2009-04-02 21:48:24 +00:00
|
|
|
$ \fB./a.out\fP
|
|
|
|
_POSIX_SOURCE defined
|
|
|
|
_POSIX_C_SOURCE defined: 199506L
|
|
|
|
_XOPEN_SOURCE defined: 500
|
fallocate.2, kexec_load.2, poll.2, spu_run.2, atan2.3, cbrt.3, clock_getcpuclockid.3, end.3, frexp.3, getgrouplist.3, getifaddrs.3, matherr.3, modf.3, pow.3, pthread_getattr_np.3, pthread_getcpuclockid.3, sched_getcpu.3, tgamma.3, mouse.4, proc.5, feature_test_macros.7, spufs.7: Global fix: properly escape minus sign
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2011-09-10 01:57:53 +00:00
|
|
|
$ \fBcc \-D_GNU_SOURCE ftm.c\fP
|
2009-04-02 21:48:24 +00:00
|
|
|
$ \fB./a.out\fP
|
|
|
|
_POSIX_SOURCE defined
|
|
|
|
_POSIX_C_SOURCE defined: 200809L
|
|
|
|
_ISOC99_SOURCE defined
|
|
|
|
_XOPEN_SOURCE defined: 700
|
|
|
|
_XOPEN_SOURCE_EXTENDED defined
|
|
|
|
_LARGEFILE64_SOURCE defined
|
|
|
|
_BSD_SOURCE defined
|
|
|
|
_SVID_SOURCE defined
|
|
|
|
_ATFILE_SOURCE defined
|
|
|
|
_GNU_SOURCE defined
|
|
|
|
.fi
|
|
|
|
.in
|
|
|
|
.SS Program source
|
|
|
|
\&
|
|
|
|
.nf
|
|
|
|
/* ftm.c */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
#ifdef _POSIX_SOURCE
|
|
|
|
printf("_POSIX_SOURCE defined\\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _POSIX_C_SOURCE
|
|
|
|
printf("_POSIX_C_SOURCE defined: %ldL\\n", (long) _POSIX_C_SOURCE);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _ISOC99_SOURCE
|
|
|
|
printf("_ISOC99_SOURCE defined\\n");
|
|
|
|
#endif
|
|
|
|
|
2013-09-20 14:33:02 +00:00
|
|
|
#ifdef _ISOC11_SOURCE
|
|
|
|
printf("_ISOC11_SOURCE defined\\n");
|
|
|
|
#endif
|
|
|
|
|
2009-04-02 21:48:24 +00:00
|
|
|
#ifdef _XOPEN_SOURCE
|
|
|
|
printf("_XOPEN_SOURCE defined: %d\\n", _XOPEN_SOURCE);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _XOPEN_SOURCE_EXTENDED
|
|
|
|
printf("_XOPEN_SOURCE_EXTENDED defined\\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _LARGEFILE64_SOURCE
|
|
|
|
printf("_LARGEFILE64_SOURCE defined\\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _FILE_OFFSET_BITS
|
|
|
|
printf("_FILE_OFFSET_BITS defined: %d\\n", _FILE_OFFSET_BITS);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _BSD_SOURCE
|
|
|
|
printf("_BSD_SOURCE defined\\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _SVID_SOURCE
|
|
|
|
printf("_SVID_SOURCE defined\\n");
|
|
|
|
#endif
|
|
|
|
|
2014-03-10 09:05:24 +00:00
|
|
|
#ifdef _DEFAULT_SOURCE
|
|
|
|
printf("_DEFAULT_SOURCE defined\\n");
|
|
|
|
#endif
|
|
|
|
|
2009-04-02 21:48:24 +00:00
|
|
|
#ifdef _ATFILE_SOURCE
|
|
|
|
printf("_ATFILE_SOURCE defined\\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _GNU_SOURCE
|
|
|
|
printf("_GNU_SOURCE defined\\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _REENTRANT
|
|
|
|
printf("_REENTRANT defined\\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _THREAD_SAFE
|
|
|
|
printf("_THREAD_SAFE defined\\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _FORTIFY_SOURCE
|
|
|
|
printf("_FORTIFY_SOURCE defined\\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
exit(EXIT_SUCCESS);
|
|
|
|
}
|
|
|
|
.fi
|
2007-06-16 07:25:46 +00:00
|
|
|
.SH SEE ALSO
|
2009-01-12 19:01:29 +00:00
|
|
|
.BR libc (7),
|
2007-06-15 20:22:43 +00:00
|
|
|
.BR standards (7)
|
arch_prctl.2, fcntl.2, flock.2, get_robust_list.2, getpriority.2, ioprio_set.2, migrate_pages.2, mmap.2, mremap.2, msync.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, select.2, socket.2, subpage_prot.2, unshare.2, btree.3, dbopen.3, dl_iterate_phdr.3, dlopen.3, getnameinfo.3, hash.3, lockf.3, netlink.3, recno.3, rpc.3, xdr.3, cciss.4, console_ioctl.4, hpsa.4, initrd.4, msr.4, rtc.4, st.4, hosts.5, services.5, tzfile.5, aio.7, arp.7, capabilities.7, cpuset.7, feature_test_macros.7, futex.7, inotify.7, ip.7, ipv6.7, iso_8859-16.7, iso_8859-2.7, koi8-r.7, math_error.7, netlink.7, packet.7, pthreads.7, raw.7, spufs.7, udplite.7, uri.7, x25.7: Global fix: Various consistency fixes for SEE ALSO
Coauthored-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-09-24 07:53:22 +00:00
|
|
|
|
2007-07-03 18:01:51 +00:00
|
|
|
The section "Feature Test Macros" under
|
|
|
|
.IR "info libc" .
|
|
|
|
.\" But beware: the info libc document is out of date (Jul 07, mtk)
|
arch_prctl.2, fcntl.2, flock.2, get_robust_list.2, getpriority.2, ioprio_set.2, migrate_pages.2, mmap.2, mremap.2, msync.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, select.2, socket.2, subpage_prot.2, unshare.2, btree.3, dbopen.3, dl_iterate_phdr.3, dlopen.3, getnameinfo.3, hash.3, lockf.3, netlink.3, recno.3, rpc.3, xdr.3, cciss.4, console_ioctl.4, hpsa.4, initrd.4, msr.4, rtc.4, st.4, hosts.5, services.5, tzfile.5, aio.7, arp.7, capabilities.7, cpuset.7, feature_test_macros.7, futex.7, inotify.7, ip.7, ipv6.7, iso_8859-16.7, iso_8859-2.7, koi8-r.7, math_error.7, netlink.7, packet.7, pthreads.7, raw.7, spufs.7, udplite.7, uri.7, x25.7: Global fix: Various consistency fixes for SEE ALSO
Coauthored-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-09-24 07:53:22 +00:00
|
|
|
|
2007-07-03 18:01:51 +00:00
|
|
|
.I /usr/include/features.h
|