diff --git a/src/api/fcntl.c b/src/api/fcntl.c index ca58523..46b7084 100644 --- a/src/api/fcntl.c +++ b/src/api/fcntl.c @@ -86,9 +86,12 @@ T(pid_t) int(*p_fcntl)(int,int,...) = fcntl; int(*p_posix_fadvise)(int,off_t,off_t,int) = posix_fadvise; int(*p_posix_fallocate)(int,off_t,off_t) = posix_fallocate; +} #ifndef _XOPEN_SOURCE #include #endif +static void g() +{ int(*p_creat)(const char*,mode_t) = creat; int(*p_open)(const char*,int,...) = open; int(*p_openat)(int,const char*,int,...) = openat; diff --git a/src/api/inttypes.c b/src/api/inttypes.c index 0d00167..b61ffaf 100644 --- a/src/api/inttypes.c +++ b/src/api/inttypes.c @@ -254,7 +254,10 @@ intmax_t(*p_imaxabs)(intmax_t) = imaxabs; imaxdiv_t(*p_imaxdiv)(intmax_t,intmax_t) = imaxdiv; intmax_t(*p_strtoimax)(const char*restrict,char**restrict,int) = strtoimax; uintmax_t(*p_strtoumax)(const char*restrict,char**restrict,int) = strtoumax; +} #include +static void g() +{ intmax_t(*p_wcstoimax)(const wchar_t*restrict,wchar_t**restrict,int) = wcstoimax; uintmax_t(*p_wcstoumax)(const wchar_t*restrict,wchar_t**restrict,int) = wcstoumax; } diff --git a/src/api/mqueue.c b/src/api/mqueue.c index cbb0401..4648974 100644 --- a/src/api/mqueue.c +++ b/src/api/mqueue.c @@ -24,7 +24,10 @@ ssize_t(*p_mq_receive)(mqd_t,char*,size_t,unsigned*) = mq_receive; int(*p_mq_send)(mqd_t,const char*,size_t,unsigned) = mq_send; int(*p_mq_setattr)(mqd_t,const struct mq_attr*restrict,struct mq_attr*restrict) = mq_setattr; int(*p_mq_unlink)(const char*) = mq_unlink; +} #include +static void g() +{ ssize_t(*p_mq_timedreceive)(mqd_t,char*restrict,size_t,unsigned*restrict,const struct timespec*restrict) = mq_timedreceive; int(*p_mq_timedsend)(mqd_t,const char*,size_t,unsigned,const struct timespec*) = mq_timedsend; } diff --git a/src/api/pthread.c b/src/api/pthread.c index 66e403e..f28d19c 100644 --- a/src/api/pthread.c +++ b/src/api/pthread.c @@ -137,7 +137,10 @@ int(*p_pthread_spin_lock)(pthread_spinlock_t*) = pthread_spin_lock; int(*p_pthread_spin_trylock)(pthread_spinlock_t*) = pthread_spin_trylock; int(*p_pthread_spin_unlock)(pthread_spinlock_t*) = pthread_spin_unlock; void(*p_pthread_testcancel)(void) = pthread_testcancel; +} #include +static void g() +{ int(*p_pthread_getcpuclockid)(pthread_t,clockid_t*) = pthread_getcpuclockid; int(*p_pthread_mutex_timedlock)(pthread_mutex_t*restrict,const struct timespec*restrict) = pthread_mutex_timedlock; int(*p_pthread_rwlock_timedrdlock)(pthread_rwlock_t*restrict,const struct timespec*restrict) = pthread_rwlock_timedrdlock; diff --git a/src/api/semaphore.c b/src/api/semaphore.c index 700002a..e37235d 100644 --- a/src/api/semaphore.c +++ b/src/api/semaphore.c @@ -11,6 +11,9 @@ int(*p_sem_post)(sem_t*) = sem_post; int(*p_sem_trywait)(sem_t*) = sem_trywait; int(*p_sem_unlink)(const char*) = sem_unlink; int(*p_sem_wait)(sem_t*) = sem_wait; +} #include +static void g() +{ int(*p_sem_timedwait)(sem_t*restrict,const struct timespec*restrict) = sem_timedwait; } diff --git a/src/api/spawn.c b/src/api/spawn.c new file mode 100644 index 0000000..1f90e74 --- /dev/null +++ b/src/api/spawn.c @@ -0,0 +1,47 @@ +#include +#define T(t) (t*)0; +#define C(n) switch(n){case n:;} +static void f() +{ +T(posix_spawnattr_t) +T(posix_spawn_file_actions_t) +T(mode_t) +T(pid_t) +T(sigset_t) +T(struct sched_param) +C(POSIX_SPAWN_RESETIDS) +C(POSIX_SPAWN_SETPGROUP) +C(POSIX_SPAWN_SETSCHEDPARAM) +C(POSIX_SPAWN_SETSCHEDULER) +C(POSIX_SPAWN_SETSIGDEF) +C(POSIX_SPAWN_SETSIGMASK) +int(*p_posix_spawn)(pid_t*restrict,const char*restrict,const posix_spawn_file_actions_t*,const posix_spawnattr_t*restrict,char*const[restrict],char*const[restrict]) = posix_spawn; +int(*p_posix_spawn_file_actions_addclose)(posix_spawn_file_actions_t*,int) = posix_spawn_file_actions_addclose; +int(*p_posix_spawn_file_actions_adddup2)(posix_spawn_file_actions_t*,int,int) = posix_spawn_file_actions_adddup2; +int(*p_posix_spawn_file_actions_addopen)(posix_spawn_file_actions_t*restrict,int,const char*restrict,int,mode_t) = posix_spawn_file_actions_addopen; +int(*p_posix_spawn_file_actions_destroy)(posix_spawn_file_actions_t*) = posix_spawn_file_actions_destroy; +int(*p_posix_spawn_file_actions_init)(posix_spawn_file_actions_t*) = posix_spawn_file_actions_init; +int(*p_posix_spawnattr_destroy)(posix_spawnattr_t*) = posix_spawnattr_destroy; +int(*p_posix_spawnattr_getflags)(const posix_spawnattr_t*restrict,short*restrict) = posix_spawnattr_getflags; +int(*p_posix_spawnattr_getpgroup)(const posix_spawnattr_t*restrict,pid_t*restrict) = posix_spawnattr_getpgroup; +int(*p_posix_spawnattr_init)(posix_spawnattr_t*) = posix_spawnattr_init; +int(*p_posix_spawnattr_setflags)(posix_spawnattr_t*,short) = posix_spawnattr_setflags; +int(*p_posix_spawnattr_setpgroup)(posix_spawnattr_t*,pid_t) = posix_spawnattr_setpgroup; +int(*p_posix_spawnp)(pid_t*restrict,const char*restrict,const posix_spawn_file_actions_t*,const posix_spawnattr_t*restrict,char*const[restrict],char*const[restrict]) = posix_spawnp; +} +#include +static void g() +{ +int(*p_posix_spawnattr_getsigdefault)(const posix_spawnattr_t*restrict,sigset_t*restrict) = posix_spawnattr_getsigdefault; +int(*p_posix_spawnattr_getsigmask)(const posix_spawnattr_t*restrict,sigset_t*restrict) = posix_spawnattr_getsigmask; +int(*p_posix_spawnattr_setsigdefault)(posix_spawnattr_t*restrict,const sigset_t*restrict) = posix_spawnattr_setsigdefault; +int(*p_posix_spawnattr_setsigmask)(posix_spawnattr_t*restrict,const sigset_t*restrict) = posix_spawnattr_setsigmask; +} +#include +static void h() +{ +int(*p_posix_spawnattr_getschedparam)(const posix_spawnattr_t*restrict,struct sched_param*restrict) = posix_spawnattr_getschedparam; +int(*p_posix_spawnattr_getschedpolicy)(const posix_spawnattr_t*restrict,int*restrict) = posix_spawnattr_getschedpolicy; +int(*p_posix_spawnattr_setschedparam)(posix_spawnattr_t*restrict,const struct sched_param*restrict) = posix_spawnattr_setschedparam; +int(*p_posix_spawnattr_setschedpolicy)(posix_spawnattr_t*,int) = posix_spawnattr_setschedpolicy; +}