X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fapi%2Funistd.c;h=522ccdc737cf6123fd04e870d79eb5f7ef959e23;hb=54c15bc45a8721b8482552586a50b2548271a3b4;hp=cdc656404c652a4e746b59c0fbd12f06657dafc4;hpb=0ef2646848cbc2e6c59f8757165b5790b0132281;p=libc-test diff --git a/src/api/unistd.c b/src/api/unistd.c index cdc6564..522ccdc 100644 --- a/src/api/unistd.c +++ b/src/api/unistd.c @@ -1,14 +1,72 @@ #include +#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) -#ifdef _XOPEN_SOURCE) -C(_XOPEN_VERSION) +A(_POSIX_VERSION >= 200809L) +A(_POSIX2_VERSION >= 200809L) +#ifdef _XOPEN_SOURCE +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) @@ -197,10 +255,9 @@ T(intptr_t) {int(*p)(const char*,uid_t,gid_t) = chown;} {int(*p)(int) = close;} {size_t(*p)(int,char*,size_t) = confstr;} -{char*(*p)(char*) = ctermid;} {int(*p)(int) = dup;} {int(*p)(int,int) = dup2;} -{char **x = environ}; +{extern char **environ; char **x = environ;}; {int(*p)(const char*,const char*,...) = execl;} {int(*p)(const char*,const char*,...) = execle;} {int(*p)(const char*,const char*,...) = execlp;} @@ -211,7 +268,9 @@ T(intptr_t) {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;}