1#include <spawn.h> 2#include "options.h" 3#define T(t) (t*)0; 4#define C(n) switch(n){case n:;} 5static void f() 6{ 7T(posix_spawnattr_t) 8T(posix_spawn_file_actions_t) 9T(mode_t) 10T(pid_t) 11T(sigset_t) 12T(struct sched_param) 13C(POSIX_SPAWN_RESETIDS) 14C(POSIX_SPAWN_SETPGROUP) 15#ifdef POSIX_PRIORITY_SCHEDULING 16C(POSIX_SPAWN_SETSCHEDPARAM) 17C(POSIX_SPAWN_SETSCHEDULER) 18#endif 19C(POSIX_SPAWN_SETSIGDEF) 20C(POSIX_SPAWN_SETSIGMASK) 21{int(*p)(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;} 22{int(*p)(posix_spawn_file_actions_t*,int) = posix_spawn_file_actions_addclose;} 23{int(*p)(posix_spawn_file_actions_t*,int,int) = posix_spawn_file_actions_adddup2;} 24{int(*p)(posix_spawn_file_actions_t*restrict,int,const char*restrict,int,mode_t) = posix_spawn_file_actions_addopen;} 25{int(*p)(posix_spawn_file_actions_t*) = posix_spawn_file_actions_destroy;} 26{int(*p)(posix_spawn_file_actions_t*) = posix_spawn_file_actions_init;} 27{int(*p)(posix_spawnattr_t*) = posix_spawnattr_destroy;} 28{int(*p)(const posix_spawnattr_t*restrict,short*restrict) = posix_spawnattr_getflags;} 29{int(*p)(const posix_spawnattr_t*restrict,pid_t*restrict) = posix_spawnattr_getpgroup;} 30{int(*p)(posix_spawnattr_t*) = posix_spawnattr_init;} 31{int(*p)(posix_spawnattr_t*,short) = posix_spawnattr_setflags;} 32{int(*p)(posix_spawnattr_t*,pid_t) = posix_spawnattr_setpgroup;} 33{int(*p)(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;} 34} 35#include <signal.h> 36static void g() 37{ 38{int(*p)(const posix_spawnattr_t*restrict,sigset_t*restrict) = posix_spawnattr_getsigdefault;} 39{int(*p)(const posix_spawnattr_t*restrict,sigset_t*restrict) = posix_spawnattr_getsigmask;} 40{int(*p)(posix_spawnattr_t*restrict,const sigset_t*restrict) = posix_spawnattr_setsigdefault;} 41{int(*p)(posix_spawnattr_t*restrict,const sigset_t*restrict) = posix_spawnattr_setsigmask;} 42} 43#ifdef POSIX_PRIORITY_SCHEDULING 44#include <sched.h> 45static void h() 46{ 47{int(*p)(const posix_spawnattr_t*restrict,struct sched_param*restrict) = posix_spawnattr_getschedparam;} 48{int(*p)(const posix_spawnattr_t*restrict,int*restrict) = posix_spawnattr_getschedpolicy;} 49{int(*p)(posix_spawnattr_t*restrict,const struct sched_param*restrict) = posix_spawnattr_setschedparam;} 50{int(*p)(posix_spawnattr_t*,int) = posix_spawnattr_setschedpolicy;} 51} 52#endif 53