POSIX.1 选项
_POSIX_JOB_CONTROL - setpgid, tcgetgrp, tcsetpgrp
_POSIX_CHOWN_RESTRICTED – 对于执行chown 函数功能具有更多的限制
_POSIX_SAVED_IDS – 在下列函数的处理进程中setgid, kill, fork, 和 setuid , set-user-id 将被保存并且set-group-id 将被保留
_POSIX_NO_TRUNC – 太长的路径名不会被截断但会产生一个错误
_POSIX_VDISABLE – 屏蔽某些特定的终端字符。
NGROUPS_MAX – 为每个可以存在的进程提供组ID ,有利于确定文件的处理权限
POSIX.4 – 第一项是POSIX.4 需要的,其他的可选
实时队列信号. SA_SIGINFO, SIGRTMIN, SIGRTMAX
_POSIX_REALTIME_SIGNALS - sigtimedwait, sigqueus, sigwaitinfo
_POSIX_PRIORITY_SCHEDULING - sched_getparam, sched_setparam, sched_getscheduler, sched_setscheduler, sched_rr_get_interval, sched_get_priority_min, sched_get_priority_max, sched_yield
_POSIX_TIMERS - clock_gettime, clock_settime, timer_gettime, timer_settime,clock_getres, timer_create, timer_delete, timer_getoverrun, nanosleep
_POSIX_ASYNCHRONOUS_IO - air_read, air_write, aio_error, aio_fsync, aio_cancel, aio_return, aio_suspend, lio_listio
_POSIX_PRIORITIZED_IO – 为异步 I/O 设置优先级
_POSIX_SYNCHRONIZED_IO - If _POSIX_MAPPED_FILES (msync, fdatasync).
_POSIX_FSYNC - fsync
_POSIX_MAPPED_FILES - If _POSIX_SYNCHRONIZED_IO (mmap, munmap, msync, ftruncate)
_POSIX_MEMLOCK - mlockall, munlockall
_POSIX_MEMLOCK_RANGE - mlock, munlock
_POSIX_MEMORY_PROTECTION - mprotect
_POSIX_MESSAGE_PASSING - mq_getattr, mqset_attr, mq_open, mq_close, mq_notify, mq_send, mq_receive, mq_unlink
_POSIX_SEMAPHORES - sem_close, sem_destroy, sem_init, sem_open, sem_trywait, sem_unlink, sem_wait, sem_getvalue, sem_post.
_POSIX_SHARED_MEMORY_OBJECTS - mmap, munmap, sbm_close, sbm_open, ftruncate, sbm_unlink.
这行:
#define _POSIX_SOURCE
确定这个程序是POSIX.1 兼容的, 这是 1990 版本.
这行:
#define _POSIX_C_SOURCE 199309
确定这个程序是POSIX.4 兼容的. 这些行意味着仅有 POSIX 函数和符号被使用。