api/main.OBJS:=$(api.OBJS)
$(api.OBJS):$(B)/common/options.h
$(api.OBJS):CFLAGS+=-pedantic-errors -Werror -Wno-unused -D_XOPEN_SOURCE=700
-$(api.OBJS):CFLAGS+=-DX_PS -DX_TPS -DX_SS
all:$(B)/REPORT
run:$(B)/REPORT
clean:
- rm -f $(OBJS) $(BINS) $(LIBS) $(B)/common/libtest.a $(B)/common/runtest $(B)/*/*.err
+ rm -f $(OBJS) $(BINS) $(LIBS) $(B)/common/libtest.a $(B)/common/runtest $(B)/common/options.h $(B)/*/*.err
cleanall: clean
rm -f $(B)/REPORT $(B)/*/REPORT
$(B)/REPORT:
#include <fcntl.h>
+#include "options.h"
#define T(t) (t*)0;
#define F(t,n) {t *y = &x.n;}
#define C(n) switch(n){case n:;}
C(O_TRUNC)
C(O_TTY_INIT)
C(O_APPEND)
-C(O_DSYNC)
C(O_NONBLOCK)
+#ifdef POSIX_SYNCHRONIZED_IO
+C(O_DSYNC)
C(O_RSYNC)
+#endif
C(O_SYNC)
C(O_ACCMODE)
C(O_EXEC)
#include <limits.h>
+#include "options.h"
#define C(n) switch(n){case n:;}
static void f()
{
C(_POSIX_LOGIN_NAME_MAX)
C(_POSIX_MAX_CANON)
C(_POSIX_MAX_INPUT)
+#ifdef POSIX_MESSAGE_PASSING
C(_POSIX_MQ_OPEN_MAX)
C(_POSIX_MQ_PRIO_MAX)
+#endif
C(_POSIX_NAME_MAX)
C(_POSIX_NGROUPS_MAX)
C(_POSIX_OPEN_MAX)
C(_POSIX_SEM_VALUE_MAX)
C(_POSIX_SIGQUEUE_MAX)
C(_POSIX_SSIZE_MAX)
+#if defined(POSIX_SPORADIC_SERVER) || defined(POSIX_THREAD_SPORADIC_SERVER)
C(_POSIX_SS_REPL_MAX)
+#endif
C(_POSIX_STREAM_MAX)
C(_POSIX_SYMLINK_MAX)
C(_POSIX_SYMLOOP_MAX)
+#include "options.h"
+#ifdef POSIX_MESSAGE_PASSING
#include <mqueue.h>
#define T(t) (t*)0;
#define F(t,n) {t *y = &x.n;}
{ssize_t(*p)(mqd_t,char*restrict,size_t,unsigned*restrict,const struct timespec*restrict) = mq_timedreceive;}
{int(*p)(mqd_t,const char*,size_t,unsigned,const struct timespec*) = mq_timedsend;}
}
+#endif
+
C(PTHREAD_MUTEX_ROBUST)
C(PTHREAD_MUTEX_STALLED)
C(PTHREAD_ONCE_INIT)
+#if defined(POSIX_THREAD_ROBUST_PRIO_INHERIT) || defined(POSIX_THREAD_PRIO_INHERIT)
C(PTHREAD_PRIO_INHERIT)
+#endif
+#if defined(POSIX_THREAD_ROBUST_PRIO_INHERIT) || defined(POSIX_THREAD_PRIO_INHERIT) \
+ || defined(POSIX_THREAD_ROBUST_PRIO_PROTECT) || defined(POSIX_THREAD_PRIO_PROTECT)
C(PTHREAD_PRIO_NONE)
-#ifdef X_RPP_TPP
+#endif
+#if defined(POSIX_THREAD_ROBUST_PRIO_PROTECT) || defined(POSIX_THREAD_PRIO_PROTECT)
C(PTHREAD_PRIO_PROTECT)
#endif
C(PTHREAD_PROCESS_SHARED)
C(PTHREAD_PROCESS_PRIVATE)
-#ifdef X_TPS
+#ifdef POSIX_THREAD_PRIORITY_SCHEDULING
C(PTHREAD_EXPLICIT_SCHED)
C(PTHREAD_INHERIT_SCHED)
C(PTHREAD_SCOPE_PROCESS)
{int(*p)(pthread_mutex_t*) = pthread_mutex_trylock;}
{int(*p)(pthread_mutex_t*) = pthread_mutex_unlock;}
{int(*p)(pthread_mutexattr_t*) = pthread_mutexattr_destroy;}
+#if defined(POSIX_THREAD_ROBUST_PRIO_INHERIT) || defined(POSIX_THREAD_PRIO_INHERIT) \
+ || defined(POSIX_THREAD_ROBUST_PRIO_PROTECT) || defined(POSIX_THREAD_PRIO_PROTECT)
{int(*p)(const pthread_mutexattr_t*restrict,int*restrict) = pthread_mutexattr_getprotocol;}
+{int(*p)(pthread_mutexattr_t*,int) = pthread_mutexattr_setprotocol;}
+#endif
{int(*p)(const pthread_mutexattr_t*restrict,int*restrict) = pthread_mutexattr_getpshared;}
{int(*p)(const pthread_mutexattr_t*restrict,int*restrict) = pthread_mutexattr_getrobust;}
{int(*p)(const pthread_mutexattr_t*restrict,int*restrict) = pthread_mutexattr_gettype;}
{int(*p)(pthread_mutexattr_t*) = pthread_mutexattr_init;}
-{int(*p)(pthread_mutexattr_t*,int) = pthread_mutexattr_setprotocol;}
{int(*p)(pthread_mutexattr_t*,int) = pthread_mutexattr_setpshared;}
{int(*p)(pthread_mutexattr_t*,int) = pthread_mutexattr_setrobust;}
{int(*p)(pthread_mutexattr_t*,int) = pthread_mutexattr_settype;}
{int(*p)(pthread_spinlock_t*) = pthread_spin_trylock;}
{int(*p)(pthread_spinlock_t*) = pthread_spin_unlock;}
{void(*p)(void) = pthread_testcancel;}
-
-#ifdef X_RPP_TPP
+#if defined(POSIX_THREAD_ROBUST_PRIO_PROTECT) || defined(POSIX_THREAD_PRIO_PROTECT)
{int(*p)(const pthread_mutex_t*restrict,int*restrict) = pthread_mutex_getprioceiling;}
{int(*p)(pthread_mutex_t*restrict,int,int*restrict) = pthread_mutex_setprioceiling;}
{int(*p)(const pthread_mutexattr_t*restrict,int*restrict) = pthread_mutexattr_getprioceiling;}
{int(*p)(pthread_mutexattr_t*,int) = pthread_mutexattr_setprioceiling;}
#endif
-
-#ifdef X_TPS
+#ifdef POSIX_THREAD_PRIORITY_SCHEDULING
{int(*p)(const pthread_attr_t*restrict,int*restrict) = pthread_attr_getinheritsched;}
{int(*p)(const pthread_attr_t*restrict,int*restrict) = pthread_attr_getschedpolicy;}
{int(*p)(const pthread_attr_t*restrict,int*restrict) = pthread_attr_getscope;}
#include <sched.h>
+#include "options.h"
#define T(t) (t*)0;
#define F(t,n) {t *y = &x.n;}
#define C(n) switch(n){case n:;}
{
struct sched_param x;
F(int,sched_priority)
-#ifdef X_SS
+#if defined(POSIX_SPORADIC_SERVER) || defined(POSIX_THREAD_SPORADIC_SERVER)
F(int,sched_ss_low_priority)
F(struct timespec,sched_ss_repl_period)
F(struct timespec,sched_ss_init_budget)
C(SCHED_SPORADIC)
#endif
}
-#ifdef X_PS
+#ifdef POSIX_PRIORITY_SCHEDULING
T(pid_t)
+{int(*p)(pid_t,struct sched_param*) = sched_getparam;}
+{int(*p)(pid_t) = sched_getscheduler;}
+{int(*p)(pid_t,const struct sched_param*) = sched_setparam;}
+{int(*p)(pid_t,int,const struct sched_param*) = sched_setscheduler;}
+#endif
C(SCHED_FIFO)
C(SCHED_RR)
C(SCHED_OTHER)
-{int(*p)(pid_t,struct sched_param*) = sched_getparam;}
-{int(*p)(pid_t) = sched_getscheduler;}
{int(*p)(int) = sched_get_priority_max;}
{int(*p)(int) = sched_get_priority_min;}
{int(*p)(pid_t,struct timespec*) = sched_rr_get_interval;}
-{int(*p)(pid_t,const struct sched_param*) = sched_setparam;}
-{int(*p)(pid_t,int,const struct sched_param*) = sched_setscheduler;}
-#endif
{int(*p)(void) = sched_yield;}
}
#include <spawn.h>
+#include "options.h"
#define T(t) (t*)0;
#define C(n) switch(n){case n:;}
static void f()
T(struct sched_param)
C(POSIX_SPAWN_RESETIDS)
C(POSIX_SPAWN_SETPGROUP)
-#ifdef X_PS
+#ifdef POSIX_PRIORITY_SCHEDULING
C(POSIX_SPAWN_SETSCHEDPARAM)
C(POSIX_SPAWN_SETSCHEDULER)
#endif
{int(*p)(posix_spawnattr_t*restrict,const sigset_t*restrict) = posix_spawnattr_setsigdefault;}
{int(*p)(posix_spawnattr_t*restrict,const sigset_t*restrict) = posix_spawnattr_setsigmask;}
}
-#ifdef X_PS
+#ifdef POSIX_PRIORITY_SCHEDULING
#include <sched.h>
static void h()
{
#include <sys/mman.h>
+#include "options.h"
#define T(t) (t*)0;
#define F(t,n) {t *y = &x.n;}
#define C(n) switch(n){case n:;}
C(POSIX_MADV_SEQUENTIAL)
C(POSIX_MADV_WILLNEED)
-#ifdef X_TYM
+#ifdef POSIX_TYPED_MEMORY_OBJECTS
C(POSIX_TYPED_MEM_ALLOCATE)
C(POSIX_TYPED_MEM_ALLOCATE_CONTIG)
C(POSIX_TYPED_MEM_MAP_ALLOCATABLE)
{int(*p)(void) = munlockall;}
{int(*p)(void*,size_t) = munmap;}
{int(*p)(void*,size_t,int) = posix_madvise;}
+#ifdef POSIX_SHARED_MEMORY_OBJECTS
{int(*p)(const char*,int,mode_t) = shm_open;}
{int(*p)(const char*) = shm_unlink;}
+#endif
}
#include <sys/stat.h>
+#include "options.h"
#define T(t) (t*)0;
#define F(t,n) {t *y = &x.n;}
#define C(n) switch(n){case n:;}
{int i = S_TYPEISMQ(&x);}
{int i = S_TYPEISSEM(&x);}
{int i = S_TYPEISSHM(&x);}
+#ifdef POSIX_TYPED_MEMORY_OBJECTS
{int i = S_TYPEISTMO(&x);}
+#endif
}
C(UTIME_NOW)
C(UTIME_OMIT)
#include <unistd.h>
+#include "options.h"
#define T(t) (t*)0;
#define F(t,n) {t *y = &x.n;}
#define C(n) switch(n){case n:;}
+#define A(n) {char p[n];}
static void f()
{
-C(_POSIX_VERSION)
-C(_POSIX2_VERSION)
+A(_POSIX_VERSION >= 200809L)
+A(_POSIX2_VERSION >= 200809L)
#ifdef _XOPEN_SOURCE
-C(_XOPEN_VERSION)
+A(_XOPEN_VERSION >= 700)
+// A(_XOPEN_CRYPT >= 0)
+ A(_XOPEN_ENH_I18N > 0)
+// A(_XOPEN_REALTIME >= 0)
+// A(_XOPEN_REALTIME_THREADS >= 0)
+// A(_XOPEN_SHM >= 0)
+ A(_XOPEN_UNIX >= 0)
#endif
+A(_POSIX_ASYNCHRONOUS_IO >= 200809L)
+A(_POSIX_BARRIERS >= 200809L)
+A(_POSIX_CHOWN_RESTRICTED >= 0)
+A(_POSIX_CLOCK_SELECTION >= 200809L)
+A(_POSIX_JOB_CONTROL > 0)
+A(_POSIX_MAPPED_FILES >= 200809L)
+A(_POSIX_MEMORY_PROTECTION >= 200809L)
+A(_POSIX_NO_TRUNC >= 0)
+A(_POSIX_READER_WRITER_LOCKS >= 200809L)
+A(_POSIX_REALTIME_SIGNALS >= 200809L)
+A(_POSIX_REGEXP > 0)
+A(_POSIX_SAVED_IDS > 0)
+A(_POSIX_SEMAPHORES >= 200809L)
+A(_POSIX_SHELL > 0)
+A(_POSIX_SPIN_LOCKS >= 200809L)
+A(_POSIX_THREAD_SAFE_FUNCTIONS >= 200809L)
+A(_POSIX_THREADS >= 200809L)
+A(_POSIX_TIMEOUTS >= 200809L)
+A(_POSIX_TIMERS >= 200809L)
+#if _POSIX_V7_ILP32_OFFBIG<=0 && _POSIX_V7_LP64_OFF64<=0 && _POSIX_V7_LPBIG_OFFBIG<=0
+#error _POSIX_V7_ILP32_OFFBIG<=0 && _POSIX_V7_LP64_OFF64<=0 && _POSIX_V7_LPBIG_OFFBIG<=0
+#endif
+A(_POSIX2_C_BIND >= 200809L)
+// not required by the standard
+ A(_POSIX_ADVISORY_INFO >= 0)
+ A(_POSIX_CPUTIME >= 0)
+ A(_POSIX_FSYNC >= 0)
+ A(_POSIX_IPV6 >= 0)
+ A(_POSIX_MEMLOCK >= 0)
+ A(_POSIX_MEMLOCK_RANGE >= 0)
+ A(_POSIX_MESSAGE_PASSING >= 0)
+ A(_POSIX_MONOTONIC_CLOCK >= 0)
+// A(_POSIX_PRIORITIZED_IO >= 0)
+// A(_POSIX_PRIORITY_SCHEDULING >= 0)
+ A(_POSIX_RAW_SOCKETS >= 0)
+// A(_POSIX_SHARED_MEMORY_OBJECTS >= 0)
+ A(_POSIX_SPAWN >= 0)
+// A(_POSIX_SPORADIC_SERVER >= 0)
+// A(_POSIX_SYNCHRONIZED_IO >= 0)
+ A(_POSIX_THREAD_ATTR_STACKADDR >= 0)
+ A(_POSIX_THREAD_ATTR_STACKSIZE >= 0)
+ A(_POSIX_THREAD_CPUTIME >= 0)
+// A(_POSIX_THREAD_PRIO_INHERIT >= 0)
+// A(_POSIX_THREAD_PRIO_PROTECT >= 0)
+ A(_POSIX_THREAD_PRIORITY_SCHEDULING >= 0)
+ A(_POSIX_THREAD_PROCESS_SHARED >= 0)
+// A(_POSIX_THREAD_ROBUST_PRIO_INHERIT >= 0)
+// A(_POSIX_THREAD_ROBUST_PRIO_PROTECT >= 0)
+// A(_POSIX_THREAD_SPORADIC_SERVER >= 0)
+// A(_POSIX_TYPED_MEMORY_OBJECTS >= 0)
C(F_OK)
C(R_OK)
C(W_OK)
{int(*p)(int) = fchdir;}
{int(*p)(int,uid_t,gid_t) = fchown;}
{int(*p)(int,const char*,uid_t,gid_t,int) = fchownat;}
+#ifdef POSIX_SYNCHRONIZED_IO
{int(*p)(int) = fdatasync;}
+#endif
{int(*p)(int,char*const[],char*const[]) = fexecve;}
{pid_t(*p)(void) = fork;}
{long(*p)(int,int) = fpathconf;}