20 #ifndef _POSIX_SYSCALLS_TRANSLATE_H 21 #define _POSIX_SYSCALLS_TRANSLATE_H 24 #include <bits/syscall.h> 26 #include <posixSyscallNumbers.h> 28 inline long posix_translate_syscall(
long which)
30 long pedigree_translation = -1;
35 pedigree_translation = POSIX_READ;
38 pedigree_translation = POSIX_WRITE;
41 pedigree_translation = POSIX_OPEN;
44 pedigree_translation = POSIX_CLOSE;
47 pedigree_translation = POSIX_STAT;
50 pedigree_translation = POSIX_FSTAT;
53 pedigree_translation = POSIX_LSTAT;
56 pedigree_translation = POSIX_POLL;
59 pedigree_translation = POSIX_LSEEK;
62 pedigree_translation = POSIX_MMAP;
65 pedigree_translation = POSIX_MPROTECT;
68 pedigree_translation = POSIX_MUNMAP;
71 pedigree_translation = POSIX_BRK;
73 case SYS_rt_sigaction:
74 pedigree_translation = POSIX_SIGACTION;
76 case SYS_rt_sigprocmask:
77 pedigree_translation = POSIX_SIGPROCMASK;
79 case SYS_rt_sigreturn:
80 pedigree_translation = PEDIGREE_SIGRET;
83 pedigree_translation = POSIX_IOCTL;
87 pedigree_translation = POSIX_READV;
90 pedigree_translation = POSIX_WRITEV;
93 pedigree_translation = POSIX_ACCESS;
96 pedigree_translation = POSIX_PIPE;
99 pedigree_translation = POSIX_SELECT;
101 case SYS_sched_yield:
102 pedigree_translation = POSIX_SCHED_YIELD;
106 pedigree_translation = POSIX_MSYNC;
110 pedigree_translation = POSIX_DUP;
113 pedigree_translation = POSIX_DUP2;
116 pedigree_translation = POSIX_PAUSE;
120 pedigree_translation = POSIX_NANOSLEEP;
123 pedigree_translation = POSIX_GETITIMER;
126 pedigree_translation = POSIX_ALARM;
129 pedigree_translation = POSIX_SETITIMER;
132 pedigree_translation = POSIX_GETPID;
136 pedigree_translation = POSIX_SOCKET;
139 pedigree_translation = POSIX_CONNECT;
142 pedigree_translation = POSIX_ACCEPT;
145 pedigree_translation = POSIX_SENDTO;
148 pedigree_translation = POSIX_RECVFROM;
151 pedigree_translation = POSIX_SENDMSG;
154 pedigree_translation = POSIX_RECVMSG;
157 pedigree_translation = POSIX_SHUTDOWN;
160 pedigree_translation = POSIX_BIND;
163 pedigree_translation = POSIX_LISTEN;
165 case SYS_getsockname:
166 pedigree_translation = POSIX_GETSOCKNAME;
168 case SYS_getpeername:
169 pedigree_translation = POSIX_GETPEERNAME;
172 pedigree_translation = POSIX_SOCKETPAIR;
175 pedigree_translation = POSIX_SETSOCKOPT;
178 pedigree_translation = POSIX_GETSOCKOPT;
181 pedigree_translation = POSIX_CLONE;
184 pedigree_translation = POSIX_FORK;
188 pedigree_translation = POSIX_EXECVE;
191 pedigree_translation = POSIX_EXIT;
194 pedigree_translation = POSIX_WAITPID;
197 pedigree_translation = POSIX_KILL;
200 pedigree_translation = POSIX_UNAME;
204 pedigree_translation = POSIX_FCNTL;
207 pedigree_translation = POSIX_FLOCK;
210 pedigree_translation = POSIX_FSYNC;
214 pedigree_translation = POSIX_FTRUNCATE;
217 pedigree_translation = POSIX_GETDENTS;
220 pedigree_translation = POSIX_GETCWD;
223 pedigree_translation = POSIX_CHDIR;
226 pedigree_translation = POSIX_FCHDIR;
229 pedigree_translation = POSIX_RENAME;
232 pedigree_translation = POSIX_MKDIR;
235 pedigree_translation = POSIX_RMDIR;
238 pedigree_translation = POSIX_CREAT;
241 pedigree_translation = POSIX_LINK;
244 pedigree_translation = POSIX_UNLINK;
247 pedigree_translation = POSIX_SYMLINK;
250 pedigree_translation = POSIX_READLINK;
253 pedigree_translation = POSIX_CHMOD;
256 pedigree_translation = POSIX_FCHMOD;
259 pedigree_translation = POSIX_CHOWN;
262 pedigree_translation = POSIX_FCHOWN;
266 pedigree_translation = POSIX_UMASK;
268 case SYS_gettimeofday:
269 pedigree_translation = POSIX_GETTIMEOFDAY;
272 pedigree_translation = POSIX_GETRLIMIT;
276 pedigree_translation = POSIX_TIMES;
280 pedigree_translation = POSIX_GETUID;
283 pedigree_translation = POSIX_L_SYSLOG;
286 pedigree_translation = POSIX_GETGID;
289 pedigree_translation = POSIX_SETUID;
292 pedigree_translation = POSIX_SETGID;
295 pedigree_translation = POSIX_GETEUID;
298 pedigree_translation = POSIX_GETEGID;
301 pedigree_translation = POSIX_SETPGID;
304 pedigree_translation = POSIX_GETPPID;
307 pedigree_translation = POSIX_GETPGRP;
310 pedigree_translation = POSIX_SETSID;
313 pedigree_translation = POSIX_SETREUID;
316 pedigree_translation = POSIX_SETREGID;
319 pedigree_translation = POSIX_GETGROUPS;
322 pedigree_translation = POSIX_SETGROUPS;
325 pedigree_translation = POSIX_SETRESUID;
328 pedigree_translation = POSIX_GETRESUID;
331 pedigree_translation = POSIX_SETRESGID;
334 pedigree_translation = POSIX_GETRESGID;
337 pedigree_translation = POSIX_GETPGID;
341 pedigree_translation = POSIX_CAPGET;
344 pedigree_translation = POSIX_CAPSET;
348 pedigree_translation = POSIX_UTIME;
351 pedigree_translation = POSIX_MKNOD;
355 pedigree_translation = POSIX_STATFS;
358 pedigree_translation = POSIX_FSTATFS;
361 case SYS_getpriority:
362 pedigree_translation = POSIX_GETPRIORITY;
364 case SYS_setpriority:
365 pedigree_translation = POSIX_SETPRIORITY;
369 pedigree_translation = POSIX_PRCTL;
372 pedigree_translation = POSIX_ARCH_PRCTL;
376 pedigree_translation = POSIX_SETRLIMIT;
379 pedigree_translation = POSIX_CHROOT;
382 case SYS_settimeofday:
383 pedigree_translation = POSIX_SETTIMEOFDAY;
386 pedigree_translation = POSIX_MOUNT;
389 case SYS_sethostname:
390 pedigree_translation = POSIX_SETHOSTNAME;
394 pedigree_translation = POSIX_IOPL;
397 pedigree_translation = POSIX_IOPERM;
401 pedigree_translation = POSIX_GETTID;
405 pedigree_translation = POSIX_GETXATTR;
408 pedigree_translation = POSIX_LGETXATTR;
411 pedigree_translation = POSIX_FGETXATTR;
415 pedigree_translation = POSIX_TIME;
418 pedigree_translation = POSIX_FUTEX;
421 case SYS_set_thread_area:
422 pedigree_translation = POSIX_SET_TLS_AREA;
426 pedigree_translation = POSIX_GETDENTS64;
429 case SYS_set_tid_address:
432 case SYS_clock_gettime:
433 pedigree_translation = POSIX_CLOCK_GETTIME;
437 pedigree_translation = POSIX_EXIT_GROUP;
441 pedigree_translation = POSIX_UTIMES;
445 pedigree_translation = POSIX_OPENAT;
448 pedigree_translation = POSIX_MKDIRAT;
452 pedigree_translation = POSIX_FCHOWNAT;
455 pedigree_translation = POSIX_FUTIMESAT;
458 pedigree_translation = POSIX_FSTATAT;
461 pedigree_translation = POSIX_UNLINKAT;
464 pedigree_translation = POSIX_RENAMEAT;
467 pedigree_translation = POSIX_LINKAT;
470 pedigree_translation = POSIX_SYMLINKAT;
473 pedigree_translation = POSIX_READLINKAT;
476 pedigree_translation = POSIX_FCHMODAT;
479 pedigree_translation = POSIX_FACCESSAT;
482 case SYS_set_robust_list:
483 pedigree_translation = POSIX_SET_ROBUST_LIST;
485 case SYS_get_robust_list:
486 pedigree_translation = POSIX_GET_ROBUST_LIST;
491 pedigree_translation = POSIX_TTYNAME;
494 return pedigree_translation;
497 #endif // _POSIX_SYSCALLS_TRANSLATE_H