shim_table.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. #ifndef _SHIM_TABLE_H_
  2. #define _SHIM_TABLE_H_
  3. #include <shim_types.h>
  4. #include <shim_unistd.h>
  5. #include <stdnoreturn.h>
  6. #ifdef IN_SHIM
  7. typedef void (*shim_fp)(void);
  8. extern shim_fp shim_table[];
  9. /* syscall entries */
  10. long __shim_read(long, long, long);
  11. long __shim_write(long, long, long);
  12. long __shim_open(long, long, long);
  13. long __shim_close(long);
  14. long __shim_stat(long, long);
  15. long __shim_fstat(long, long);
  16. long __shim_lstat(long, long);
  17. long __shim_poll(long, long, long);
  18. long __shim_lseek(long, long, long);
  19. long __shim_mmap(long, long, long, long, long, long);
  20. long __shim_mprotect(long, long, long);
  21. long __shim_munmap(long, long);
  22. long __shim_brk(long);
  23. long __shim_rt_sigaction(long, long, long, long);
  24. long __shim_rt_sigprocmask(long, long, long);
  25. long __shim_rt_sigreturn(long);
  26. long __shim_ioctl(long, long, long);
  27. long __shim_pread64(long, long, long, long);
  28. long __shim_pwrite64(long, long, long, long);
  29. long __shim_readv(long, long, long);
  30. long __shim_writev(long, long, long);
  31. long __shim_access(long, long);
  32. long __shim_pipe(long);
  33. long __shim_select(long, long, long, long, long);
  34. long __shim_sched_yield(void);
  35. long __shim_mremap(long, long, long, long, long);
  36. long __shim_msync(long, long, long);
  37. long __shim_mincore(long, long, long);
  38. long __shim_madvise(long, long, long);
  39. long __shim_shmget(long, long, long);
  40. long __shim_shmat(long, long, long);
  41. long __shim_shmctl(long, long, long);
  42. long __shim_dup(long);
  43. long __shim_dup2(long, long);
  44. long __shim_pause(void);
  45. long __shim_nanosleep(long, long);
  46. long __shim_getitimer(long, long);
  47. long __shim_alarm(long);
  48. long __shim_setitimer(long, long, long);
  49. long __shim_getpid(void);
  50. long __shim_sendfile(long, long, long, long);
  51. long __shim_socket(long, long, long);
  52. long __shim_connect(long, long, long);
  53. long __shim_accept(long, long, long);
  54. long __shim_sendto(long, long, long, long, long, long);
  55. long __shim_recvfrom(long, long, long, long, long, long);
  56. long __shim_sendmsg(long, long, long);
  57. long __shim_recvmsg(long, long, long);
  58. long __shim_shutdown(long, long);
  59. long __shim_bind(long, long, long);
  60. long __shim_listen(long, long);
  61. long __shim_getsockname(long, long, long);
  62. long __shim_getpeername(long, long, long);
  63. long __shim_socketpair(long, long, long, long);
  64. long __shim_setsockopt(long, long, long, long, long);
  65. long __shim_getsockopt(long, long, long, long, long);
  66. long __shim_clone(long, long, long, long, long);
  67. long __shim_fork(void);
  68. long __shim_vfork(void);
  69. long __shim_execve(long, long, long);
  70. long __shim_exit(long);
  71. long __shim_wait4(long, long, long, long);
  72. long __shim_kill(long, long);
  73. long __shim_uname(long);
  74. long __shim_semget(long, long, long);
  75. long __shim_semop(long, long, long);
  76. long __shim_semctl(long, long, long, long);
  77. long __shim_shmdt(long);
  78. long __shim_msgget(long, long);
  79. long __shim_msgsnd(long, long, long, long);
  80. long __shim_msgrcv(long, long, long, long, long);
  81. long __shim_msgctl(long, long, long);
  82. long __shim_fcntl(long, long, long);
  83. long __shim_flock(long, long);
  84. long __shim_fsync(long);
  85. long __shim_fdatasync(long);
  86. long __shim_truncate(long, long);
  87. long __shim_ftruncate(long, long);
  88. long __shim_getdents(long, long, long);
  89. long __shim_getcwd(long, long);
  90. long __shim_chdir(long);
  91. long __shim_fchdir(long);
  92. long __shim_rename(long, long);
  93. long __shim_mkdir(long, long);
  94. long __shim_rmdir(long);
  95. long __shim_creat(long, long);
  96. long __shim_link(long, long);
  97. long __shim_unlink(long);
  98. long __shim_symlink(long, long);
  99. long __shim_readlink(long, long, long);
  100. long __shim_chmod(long, long);
  101. long __shim_fchmod(long, long);
  102. long __shim_chown(long, long, long);
  103. long __shim_fchown(long, long, long);
  104. long __shim_lchown(long, long, long);
  105. long __shim_umask(long);
  106. long __shim_gettimeofday(long, long);
  107. long __shim_getrlimit(long, long);
  108. long __shim_getrusage(long, long);
  109. long __shim_sysinfo(long);
  110. long __shim_times(long);
  111. long __shim_ptrace(long, long, long, long);
  112. long __shim_getuid(void);
  113. long __shim_syslog(long, long, long);
  114. long __shim_getgid(void);
  115. long __shim_setuid(long);
  116. long __shim_setgid(long);
  117. long __shim_geteuid(void);
  118. long __shim_getegid(void);
  119. long __shim_setpgid(long, long);
  120. long __shim_getppid(void);
  121. long __shim_getpgrp(void);
  122. long __shim_setsid(void);
  123. long __shim_setreuid(long, long);
  124. long __shim_setregid(long, long);
  125. long __shim_getgroups(long, long);
  126. long __shim_setgroups(long, long);
  127. long __shim_setresuid(long, long, long);
  128. long __shim_getresuid(long, long, long);
  129. long __shim_setresgid(long, long, long);
  130. long __shim_getresgid(long, long, long);
  131. long __shim_getpgid(long);
  132. long __shim_setfsuid(long);
  133. long __shim_setfsgid(long);
  134. long __shim_getsid(long);
  135. long __shim_capget(long, long);
  136. long __shim_capset(long, long);
  137. long __shim_rt_sigpending(long, long);
  138. long __shim_rt_sigtimedwait(long, long, long, long);
  139. long __shim_rt_sigqueueinfo(long, long, long);
  140. long __shim_rt_sigsuspend(long);
  141. long __shim_sigaltstack(long, long);
  142. long __shim_utime(long, long);
  143. long __shim_mknod(long, long, long);
  144. long __shim_uselib(long);
  145. long __shim_personality(long);
  146. long __shim_ustat(long, long);
  147. long __shim_statfs(long, long);
  148. long __shim_fstatfs(long, long);
  149. long __shim_sysfs(long, long, long);
  150. long __shim_getpriority(long, long);
  151. long __shim_setpriority(long, long, long);
  152. long __shim_sched_setparam(long, long);
  153. long __shim_sched_getparam(long, long);
  154. long __shim_sched_setscheduler(long, long, long);
  155. long __shim_sched_getscheduler(long);
  156. long __shim_sched_get_priority_max(long);
  157. long __shim_sched_get_priority_min(long);
  158. long __shim_sched_rr_get_interval(long, long);
  159. long __shim_mlock(long, long);
  160. long __shim_munlock(long, long);
  161. long __shim_mlockall(long);
  162. long __shim_munlockall(void);
  163. long __shim_vhangup(void);
  164. long __shim_modify_ldt(long, long, long);
  165. long __shim_pivot_root(long, long);
  166. long __shim__sysctl(long);
  167. long __shim_prctl(long, long, long, long, long);
  168. long __shim_arch_prctl(long, long);
  169. long __shim_adjtimex(long);
  170. long __shim_setrlimit(long, long);
  171. long __shim_chroot(long);
  172. long __shim_sync(void);
  173. long __shim_acct(long);
  174. long __shim_settimeofday(long, long);
  175. long __shim_mount(long, long, long, long, long);
  176. long __shim_umount2(long, long);
  177. long __shim_swapon(long, long);
  178. long __shim_swapoff(long);
  179. long __shim_reboot(long, long, long, long);
  180. long __shim_sethostname(long, long);
  181. long __shim_setdomainname(long, long);
  182. long __shim_iopl(long);
  183. long __shim_ioperm(long, long, long);
  184. long __shim_create_module(long, long);
  185. long __shim_init_module(long, long, long);
  186. long __shim_delete_module(long, long);
  187. long __shim_get_kernel_syms(long);
  188. long __shim_query_module(long, long, long, long, long);
  189. long __shim_quotactl(long, long, long, long);
  190. long __shim_nfsservctl(long, long, long);
  191. long __shim_gettid(void);
  192. long __shim_readahead(long, long, long);
  193. long __shim_setxattr(long, long, long, long, long);
  194. long __shim_lsetxattr(long, long, long, long, long);
  195. long __shim_fsetxattr(long, long, long, long, long);
  196. long __shim_getxattr(long, long, long, long);
  197. long __shim_lgetxattr(long, long, long, long);
  198. long __shim_fgetxattr(long, long, long, long);
  199. long __shim_listxattr(long, long, long);
  200. long __shim_llistxattr(long, long, long);
  201. long __shim_flistxattr(long, long, long);
  202. long __shim_removexattr(long, long);
  203. long __shim_lremovexattr(long, long);
  204. long __shim_fremovexattr(long, long);
  205. long __shim_tkill(long, long);
  206. long __shim_time(long);
  207. long __shim_futex(long, long, long, long, long, long);
  208. long __shim_sched_setaffinity(long, long, long);
  209. long __shim_sched_getaffinity(long, long, long);
  210. long __shim_set_thread_area(long);
  211. long __shim_io_setup(long, long);
  212. long __shim_io_destroy(long);
  213. long __shim_io_getevents(long, long, long, long, long);
  214. long __shim_io_submit(long, long, long);
  215. long __shim_io_cancel(long, long, long);
  216. long __shim_get_thread_area(long);
  217. long __shim_lookup_dcookie(long, long, long);
  218. long __shim_epoll_create(long);
  219. long __shim_remap_file_pages(long, long, long, long, long);
  220. long __shim_getdents64(long, long, long);
  221. long __shim_set_tid_address(long);
  222. long __shim_restart_syscall(void);
  223. long __shim_semtimedop(long, long, long, long);
  224. long __shim_fadvise64(long, long, long, long);
  225. long __shim_timer_create(long, long, long);
  226. long __shim_timer_settime(long, long, long, long);
  227. long __shim_timer_gettime(long, long);
  228. long __shim_timer_getoverrun(long);
  229. long __shim_timer_delete(long);
  230. long __shim_clock_settime(long, long);
  231. long __shim_clock_gettime(long, long);
  232. long __shim_clock_getres(long, long);
  233. long __shim_clock_nanosleep(long, long, long, long);
  234. long __shim_exit_group(long);
  235. long __shim_epoll_wait(long, long, long, long);
  236. long __shim_epoll_ctl(long, long, long, long);
  237. long __shim_tgkill(long, long, long);
  238. long __shim_utimes(long, long);
  239. long __shim_mbind(long, long, long, long, long, long);
  240. long __shim_set_mempolicy(long, long, long);
  241. long __shim_get_mempolicy(long, long, long, long, long);
  242. long __shim_mq_open(long, long, long, long);
  243. long __shim_mq_unlink(long);
  244. long __shim_mq_timedsend(long, long, long, long, long);
  245. long __shim_mq_timedreceive(long, long, long, long, long);
  246. long __shim_mq_notify(long, long);
  247. long __shim_mq_getsetattr(long, long, long);
  248. long __shim_kexec_load(long, long, long, long);
  249. long __shim_waitid(long, long, long, long, long);
  250. long __shim_add_key(long, long, long, long, long);
  251. long __shim_request_key(long, long, long, long);
  252. long __shim_keyctl(long, long, long, long, long);
  253. long __shim_ioprio_set(long, long, long);
  254. long __shim_ioprio_get(long, long);
  255. long __shim_inotify_init(void);
  256. long __shim_inotify_add_watch(long, long, long);
  257. long __shim_inotify_rm_watch(long, long);
  258. long __shim_migrate_pages(long, long, long, long);
  259. long __shim_openat(long, long, long, long);
  260. long __shim_mkdirat(long, long, long);
  261. long __shim_mknodat(long, long, long, long);
  262. long __shim_fchownat(long, long, long, long, long);
  263. long __shim_futimesat(long, long, long);
  264. long __shim_newfstatat(long, long, long, long);
  265. long __shim_unlinkat(long, long, long);
  266. long __shim_renameat(long, long, long, long);
  267. long __shim_linkat(long, long, long, long, long);
  268. long __shim_symlinkat(long, long, long);
  269. long __shim_readlinkat(long, long, long, long);
  270. long __shim_fchmodat(long, long, long);
  271. long __shim_faccessat(long, long, long);
  272. long __shim_pselect6(long, long, long, long, long, long);
  273. long __shim_ppoll(long, long, long, long, long);
  274. long __shim_unshare(long);
  275. long __shim_set_robust_list(long, long);
  276. long __shim_get_robust_list(long, long, long);
  277. long __shim_splice(long, long, long, long, long, long);
  278. long __shim_tee(long, long, long, long);
  279. long __shim_sync_file_range(long, long, long, long);
  280. long __shim_vmsplice(long, long, long, long);
  281. long __shim_move_pages(long, long, long, long, long, long);
  282. long __shim_utimensat(long, long, long, long);
  283. long __shim_epoll_pwait(long, long, long, long, long, long);
  284. long __shim_signalfd(long, long, long);
  285. long __shim_timerfd_create(long, long);
  286. long __shim_eventfd(long);
  287. long __shim_fallocate(long, long, long, long);
  288. long __shim_timerfd_settime(long, long, long, long);
  289. long __shim_timerfd_gettime(long, long);
  290. long __shim_accept4(long, long, long, long);
  291. long __shim_signalfd4(long, long, long, long);
  292. long __shim_eventfd2(long, long);
  293. long __shim_epoll_create1(long);
  294. long __shim_dup3(long, long, long);
  295. long __shim_pipe2(long, long);
  296. long __shim_inotify_init1(long);
  297. long __shim_preadv(long, long, long, long, long);
  298. long __shim_pwritev(long, long, long, long, long);
  299. long __shim_rt_tgsigqueueinfo(long, long, long, long);
  300. long __shim_perf_event_open(long, long, long, long, long);
  301. long __shim_recvmmsg(long, long, long, long, long);
  302. long __shim_fanotify_init(long, long);
  303. long __shim_fanotify_mark(long, long, long, long, long);
  304. long __shim_prlimit64(long, long, long, long);
  305. long __shim_name_to_handle_at(long, long, long, long, long);
  306. long __shim_open_by_handle_at(long, long, long);
  307. long __shim_clock_adjtime(long, long);
  308. long __shim_syncfs(long);
  309. long __shim_sendmmsg(long, long, long, long);
  310. long __shim_setns(long, long);
  311. long __shim_getcpu(long, long, long);
  312. /* libos call entries */
  313. long __shim_msgpersist(long, long);
  314. long __shim_benchmark_rpc(long, long, long, long);
  315. long __shim_send_rpc(long, long, long);
  316. long __shim_recv_rpc(long, long, long);
  317. long __shim_checkpoint(long);
  318. /* syscall implementation */
  319. size_t shim_do_read(int fd, void* buf, size_t count);
  320. size_t shim_do_write(int fd, const void* buf, size_t count);
  321. int shim_do_open(const char* file, int flags, mode_t mode);
  322. int shim_do_close(int fd);
  323. int shim_do_stat(const char* file, struct stat* statbuf);
  324. int shim_do_fstat(int fd, struct stat* statbuf);
  325. int shim_do_lstat(const char* file, struct stat* stat);
  326. int shim_do_poll(struct pollfd* fds, nfds_t nfds, int timeout);
  327. off_t shim_do_lseek(int fd, off_t offset, int origin);
  328. void* shim_do_mmap(void* addr, size_t length, int prot, int flags, int fd, off_t offset);
  329. int shim_do_mprotect(void* addr, size_t len, int prot);
  330. int shim_do_munmap(void* addr, size_t len);
  331. void* shim_do_brk(void* brk);
  332. int shim_do_sigaction(int signum, const struct __kernel_sigaction* act,
  333. struct __kernel_sigaction* oldact, size_t sigsetsize);
  334. int shim_do_sigprocmask(int how, const __sigset_t* set, __sigset_t* oldset);
  335. int shim_do_sigreturn(int __unused);
  336. int shim_do_ioctl(int fd, int cmd, unsigned long arg);
  337. ssize_t shim_do_pread64(int fd, char* buf, size_t count, loff_t pos);
  338. ssize_t shim_do_pwrite64(int fd, char* buf, size_t count, loff_t pos);
  339. ssize_t shim_do_readv(int fd, const struct iovec* vec, int vlen);
  340. ssize_t shim_do_writev(int fd, const struct iovec* vec, int vlen);
  341. int shim_do_access(const char* file, mode_t mode);
  342. int shim_do_pipe(int* fildes);
  343. int shim_do_select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* errorfds,
  344. struct __kernel_timeval* timeout);
  345. int shim_do_sched_yield(void);
  346. void* shim_do_mremap(void* addr, size_t old_len, size_t new_len, int flags, void* new_addr);
  347. int shim_do_msync(void* start, size_t len, int flags);
  348. int shim_do_mincore(void* start, size_t len, unsigned char* vec);
  349. int shim_do_dup(int fd);
  350. int shim_do_dup2(int oldfd, int newfd);
  351. int shim_do_pause(void);
  352. int shim_do_nanosleep(const struct __kernel_timespec* rqtp, struct __kernel_timespec* rmtp);
  353. int shim_do_getitimer(int which, struct __kernel_itimerval* value);
  354. int shim_do_alarm(unsigned int seconds);
  355. int shim_do_setitimer(int which, struct __kernel_itimerval* value,
  356. struct __kernel_itimerval* ovalue);
  357. pid_t shim_do_getpid(void);
  358. ssize_t shim_do_sendfile(int out_fd, int in_fd, off_t* offset, size_t count);
  359. int shim_do_socket(int family, int type, int protocol);
  360. int shim_do_connect(int sockfd, struct sockaddr* addr, int addrlen);
  361. int shim_do_accept(int fd, struct sockaddr* addr, socklen_t* addrlen);
  362. ssize_t shim_do_sendto(int fd, const void* buf, size_t len, int flags,
  363. const struct sockaddr* dest_addr, socklen_t addrlen);
  364. ssize_t shim_do_recvfrom(int fd, void* buf, size_t len, int flags, struct sockaddr* addr,
  365. socklen_t* addrlen);
  366. int shim_do_bind(int sockfd, struct sockaddr* addr, socklen_t addrlen);
  367. int shim_do_listen(int sockfd, int backlog);
  368. ssize_t shim_do_sendmsg(int fd, struct msghdr* msg, int flags);
  369. ssize_t shim_do_recvmsg(int fd, struct msghdr* msg, int flags);
  370. int shim_do_shutdown(int sockfd, int how);
  371. int shim_do_getsockname(int sockfd, struct sockaddr* addr, int* addrlen);
  372. int shim_do_getpeername(int sockfd, struct sockaddr* addr, int* addrlen);
  373. int shim_do_socketpair(int domain, int type, int protocol, int* sv);
  374. int shim_do_setsockopt(int fd, int level, int optname, char* optval, int optlen);
  375. int shim_do_getsockopt(int fd, int level, int optname, char* optval, int* optlen);
  376. int shim_do_clone(int flags, void* user_stack_addr, int* parent_tidptr, int* child_tidptr,
  377. void* tls);
  378. int shim_do_fork(void);
  379. int shim_do_vfork(void);
  380. int shim_do_execve(const char* file, const char** argv, const char** envp);
  381. noreturn int shim_do_exit(int error_code);
  382. pid_t shim_do_wait4(pid_t pid, int* stat_addr, int option, struct __kernel_rusage* ru);
  383. int shim_do_kill(pid_t pid, int sig);
  384. int shim_do_uname(struct old_utsname* buf);
  385. int shim_do_semget(key_t key, int nsems, int semflg);
  386. int shim_do_semop(int semid, struct sembuf* sops, unsigned int nsops);
  387. int shim_do_semctl(int semid, int semnum, int cmd, unsigned long arg);
  388. int shim_do_msgget(key_t key, int msgflg);
  389. int shim_do_msgsnd(int msqid, const void* msgp, size_t msgsz, int msgflg);
  390. int shim_do_msgrcv(int msqid, void* msgp, size_t msgsz, long msgtyp, int msgflg);
  391. int shim_do_msgctl(int msqid, int cmd, struct msqid_ds* buf);
  392. int shim_do_fcntl(int fd, int cmd, unsigned long arg);
  393. int shim_do_fsync(int fd);
  394. int shim_do_fdatasync(int fd);
  395. int shim_do_truncate(const char* path, loff_t length);
  396. int shim_do_ftruncate(int fd, loff_t length);
  397. size_t shim_do_getdents(int fd, struct linux_dirent* buf, size_t count);
  398. int shim_do_getcwd(char* buf, size_t size);
  399. int shim_do_chdir(const char* filename);
  400. int shim_do_fchdir(int fd);
  401. int shim_do_rename(const char* oldname, const char* newname);
  402. int shim_do_mkdir(const char* pathname, int mode);
  403. int shim_do_rmdir(const char* pathname);
  404. int shim_do_creat(const char* path, mode_t mode);
  405. int shim_do_unlink(const char* file);
  406. int shim_do_readlink(const char* file, char* buf, size_t bufsize);
  407. int shim_do_chmod(const char* filename, mode_t mode);
  408. int shim_do_fchmod(int fd, mode_t mode);
  409. int shim_do_chown(const char* filename, uid_t user, gid_t group);
  410. int shim_do_fchown(int fd, uid_t user, gid_t group);
  411. mode_t shim_do_umask(mode_t mask);
  412. int shim_do_gettimeofday(struct __kernel_timeval* tv, struct __kernel_timezone* tz);
  413. int shim_do_getrlimit(int resource, struct __kernel_rlimit* rlim);
  414. uid_t shim_do_getuid(void);
  415. gid_t shim_do_getgid(void);
  416. int shim_do_setuid(uid_t uid);
  417. int shim_do_setgid(gid_t gid);
  418. int shim_do_setgroups(int gidsetsize, gid_t* grouplist);
  419. int shim_do_getgroups(int gidsetsize, gid_t* grouplist);
  420. uid_t shim_do_geteuid(void);
  421. gid_t shim_do_getegid(void);
  422. pid_t shim_do_getppid(void);
  423. int shim_do_setpgid(pid_t pid, pid_t pgid);
  424. pid_t shim_do_getpgrp(void);
  425. int shim_do_setsid(void);
  426. int shim_do_getpgid(pid_t pid);
  427. int shim_do_getsid(pid_t pid);
  428. int shim_do_sigpending(__sigset_t* set, size_t sigsetsize);
  429. int shim_do_sigaltstack(const stack_t* ss, stack_t* oss);
  430. int shim_do_sigsuspend(const __sigset_t* mask);
  431. void* shim_do_arch_prctl(int code, void* addr);
  432. int shim_do_setrlimit(int resource, struct __kernel_rlimit* rlim);
  433. int shim_do_chroot(const char* filename);
  434. pid_t shim_do_gettid(void);
  435. int shim_do_tkill(int pid, int sig);
  436. time_t shim_do_time(time_t* tloc);
  437. int shim_do_futex(int* uaddr, int op, int val, void* utime, int* uaddr2, int val3);
  438. int shim_do_sched_getaffinity(pid_t pid, size_t len, __kernel_cpu_set_t* user_mask_ptr);
  439. int shim_do_set_tid_address(int* tidptr);
  440. int shim_do_semtimedop(int semid, struct sembuf* sops, unsigned int nsops,
  441. const struct timespec* timeout);
  442. int shim_do_epoll_create(int size);
  443. size_t shim_do_getdents64(int fd, struct linux_dirent64* buf, size_t count);
  444. int shim_do_epoll_wait(int epfd, struct __kernel_epoll_event* events, int maxevents,
  445. int timeout_ms);
  446. int shim_do_epoll_ctl(int epfd, int op, int fd, struct __kernel_epoll_event* event);
  447. int shim_do_clock_gettime(clockid_t which_clock, struct timespec* tp);
  448. int shim_do_clock_getres(clockid_t which_clock, struct timespec* tp);
  449. noreturn int shim_do_exit_group(int error_code);
  450. int shim_do_tgkill(int tgid, int pid, int sig);
  451. int shim_do_openat(int dfd, const char* filename, int flags, int mode);
  452. int shim_do_mkdirat(int dfd, const char* pathname, int mode);
  453. int shim_do_newfstatat(int dirfd, const char* pathname, struct stat* statbuf, int flags);
  454. int shim_do_unlinkat(int dfd, const char* pathname, int flag);
  455. int shim_do_renameat(int olddfd, const char* pathname, int newdfd, const char* newname);
  456. int shim_do_fchmodat(int dfd, const char* filename, mode_t mode);
  457. int shim_do_fchownat(int dfd, const char* filename, uid_t user, gid_t group, int flags);
  458. int shim_do_faccessat(int dfd, const char* filename, mode_t mode);
  459. int shim_do_pselect6(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds,
  460. const struct __kernel_timespec* tsp, const __sigset_t* sigmask);
  461. int shim_do_ppoll(struct pollfd* fds, int nfds, struct timespec* tsp, const __sigset_t* sigmask,
  462. size_t sigsetsize);
  463. int shim_do_set_robust_list(struct robust_list_head* head, size_t len);
  464. int shim_do_get_robust_list(pid_t pid, struct robust_list_head** head, size_t* len);
  465. int shim_do_epoll_pwait(int epfd, struct __kernel_epoll_event* events, int maxevents,
  466. int timeout_ms, const __sigset_t* sigmask, size_t sigsetsize);
  467. int shim_do_accept4(int sockfd, struct sockaddr* addr, socklen_t* addrlen, int flags);
  468. int shim_do_dup3(int oldfd, int newfd, int flags);
  469. int shim_do_epoll_create1(int flags);
  470. int shim_do_pipe2(int* fildes, int flags);
  471. ssize_t shim_do_recvmmsg(int sockfd, struct mmsghdr* msg, size_t vlen, int flags,
  472. struct __kernel_timespec* timeout);
  473. int shim_do_prlimit64(pid_t pid, int resource, const struct __kernel_rlimit64* new_rlim,
  474. struct __kernel_rlimit64* old_rlim);
  475. ssize_t shim_do_sendmmsg(int sockfd, struct mmsghdr* msg, size_t vlen, int flags);
  476. /* libos call implementation */
  477. int shim_do_msgpersist(int msqid, int cmd);
  478. int shim_do_benchmark_rpc(pid_t pid, int times, const void* buf, size_t size);
  479. size_t shim_do_send_rpc(pid_t pid, const void* buf, size_t size);
  480. size_t shim_do_recv_rpc(pid_t* pid, void* buf, size_t size);
  481. int shim_do_checkpoint(const char* filename);
  482. #endif /* ! IN_SHIM */
  483. /* syscall wrappers */
  484. size_t shim_read(int fd, void* buf, size_t count);
  485. size_t shim_write(int fd, const void* buf, size_t count);
  486. int shim_open(const char* file, int flags, mode_t mode);
  487. int shim_close(int fd);
  488. int shim_stat(const char* file, struct stat* statbuf);
  489. int shim_fstat(int fd, struct stat* statbuf);
  490. int shim_lstat(const char* file, struct stat* statbuf);
  491. int shim_poll(struct pollfd* fds, nfds_t nfds, int timeout);
  492. off_t shim_lseek(int fd, off_t offset, int origin);
  493. void* shim_mmap(void* addr, size_t length, int prot, int flags, int fd, off_t offset);
  494. int shim_mprotect(void* addr, size_t len, int prot);
  495. int shim_munmap(void* addr, size_t len);
  496. void* shim_brk(void* brk);
  497. int shim_rt_sigaction(int signum, const struct __kernel_sigaction* act,
  498. struct __kernel_sigaction* oldact, size_t sigsetsize);
  499. int shim_rt_sigprocmask(int how, const __sigset_t* set, __sigset_t* oldset);
  500. int shim_rt_sigreturn(int __unused);
  501. int shim_ioctl(int fd, int cmd, unsigned long arg);
  502. size_t shim_pread64(int fd, char* buf, size_t count, loff_t pos);
  503. size_t shim_pwrite64(int fd, char* buf, size_t count, loff_t pos);
  504. ssize_t shim_readv(int fd, const struct iovec* vec, int vlen);
  505. ssize_t shim_writev(int fd, const struct iovec* vec, int vlen);
  506. int shim_access(const char* file, mode_t mode);
  507. int shim_pipe(int* fildes);
  508. int shim_select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* errorfds,
  509. struct __kernel_timeval* timeout);
  510. int shim_sched_yield(void);
  511. void* shim_mremap(void* addr, size_t old_len, size_t new_len, int flags, void* new_addr);
  512. int shim_msync(void* start, size_t len, int flags);
  513. int shim_mincore(void* start, size_t len, unsigned char* vec);
  514. int shim_madvise(void* start, size_t len, int behavior);
  515. int shim_shmget(key_t key, size_t size, int shmflg);
  516. void* shim_shmat(int shmid, const void* shmaddr, int shmflg);
  517. int shim_shmctl(int shmid, int cmd, struct shmid_ds* buf);
  518. int shim_dup(int fd);
  519. int shim_dup2(int oldfd, int newfd);
  520. int shim_pause(void);
  521. int shim_nanosleep(const struct __kernel_timespec* rqtp, struct __kernel_timespec* rmtp);
  522. int shim_getitimer(int which, struct __kernel_itimerval* value);
  523. int shim_alarm(unsigned int seconds);
  524. int shim_setitimer(int which, struct __kernel_itimerval* value, struct __kernel_itimerval* ovalue);
  525. pid_t shim_getpid(void);
  526. ssize_t shim_sendfile(int out_fd, int in_fd, off_t* offset, size_t count);
  527. int shim_socket(int family, int type, int protocol);
  528. int shim_connect(int sockfd, struct sockaddr* addr, int addrlen);
  529. int shim_accept(int fd, struct sockaddr* addr, socklen_t* addrlen);
  530. ssize_t shim_sendto(int fd, const void* buf, size_t len, int flags,
  531. const struct sockaddr* dest_addr, socklen_t addrlen);
  532. ssize_t shim_recvfrom(int fd, void* buf, size_t len, int flags, struct sockaddr* addr,
  533. socklen_t* addrlen);
  534. int shim_bind(int sockfd, struct sockaddr* addr, socklen_t addrlen);
  535. int shim_listen(int sockfd, int backlog);
  536. ssize_t shim_sendmsg(int fd, struct msghdr* msg, int flags);
  537. ssize_t shim_recvmsg(int fd, struct msghdr* msg, int flags);
  538. int shim_shutdown(int sockfd, int how);
  539. int shim_getsockname(int sockfd, struct sockaddr* addr, int* addrlen);
  540. int shim_getpeername(int sockfd, struct sockaddr* addr, int* addrlen);
  541. int shim_socketpair(int domain, int type, int protocol, int* sv);
  542. int shim_setsockopt(int fd, int level, int optname, char* optval, int optlen);
  543. int shim_getsockopt(int fd, int level, int optname, char* optval, int* optlen);
  544. int shim_clone(int flags, void* user_stack_addr, int* parent_tidptr, int* child_tidptr, void* tls);
  545. int shim_fork(void);
  546. int shim_vfork(void);
  547. int shim_execve(const char* file, const char** argv, const char** envp);
  548. int shim_exit(int error_code);
  549. pid_t shim_wait4(pid_t pid, int* stat_addr, int option, struct __kernel_rusage* ru);
  550. int shim_kill(pid_t pid, int sig);
  551. int shim_uname(struct old_utsname* buf);
  552. int shim_semget(key_t key, int nsems, int semflg);
  553. int shim_semop(int semid, struct sembuf* sops, unsigned int nsops);
  554. int shim_semctl(int semid, int semnum, int cmd, unsigned long arg);
  555. int shim_shmdt(const void* shmaddr);
  556. int shim_msgget(key_t key, int msgflg);
  557. int shim_msgsnd(int msqid, const void* msgp, size_t msgsz, int msgflg);
  558. int shim_msgrcv(int msqid, void* msgp, size_t msgsz, long msgtyp, int msgflg);
  559. int shim_msgctl(int msqid, int cmd, struct msqid_ds* buf);
  560. int shim_fcntl(int fd, int cmd, unsigned long arg);
  561. int shim_flock(int fd, int cmd);
  562. int shim_fsync(int fd);
  563. int shim_fdatasync(int fd);
  564. int shim_truncate(const char* path, loff_t length);
  565. int shim_ftruncate(int fd, loff_t length);
  566. size_t shim_getdents(int fd, struct linux_dirent* buf, size_t count);
  567. int shim_getcwd(char* buf, size_t size);
  568. int shim_chdir(const char* filename);
  569. int shim_fchdir(int fd);
  570. int shim_rename(const char* oldname, const char* newname);
  571. int shim_mkdir(const char* pathname, int mode);
  572. int shim_rmdir(const char* pathname);
  573. int shim_creat(const char* path, mode_t mode);
  574. int shim_link(const char* oldname, const char* newname);
  575. int shim_unlink(const char* file);
  576. int shim_symlink(const char* old, const char* new);
  577. int shim_readlink(const char* file, char* buf, size_t bufsize);
  578. int shim_chmod(const char* filename, mode_t mode);
  579. int shim_fchmod(int fd, mode_t mode);
  580. int shim_chown(const char* filename, uid_t user, gid_t group);
  581. int shim_fchown(int fd, uid_t user, gid_t group);
  582. int shim_lchown(const char* filename, uid_t user, gid_t group);
  583. mode_t shim_umask(mode_t mask);
  584. int shim_gettimeofday(struct __kernel_timeval* tv, struct __kernel_timezone* tz);
  585. int shim_getrlimit(int resource, struct __kernel_rlimit* rlim);
  586. int shim_getrusage(int who, struct __kernel_rusage* ru);
  587. int shim_sysinfo(struct sysinfo* info);
  588. int shim_times(struct tms* tbuf);
  589. int shim_ptrace(long request, pid_t pid, void* addr, void* data);
  590. uid_t shim_getuid(void);
  591. int shim_syslog(int type, char* buf, int len);
  592. gid_t shim_getgid(void);
  593. int shim_setuid(uid_t uid);
  594. int shim_setgid(gid_t gid);
  595. uid_t shim_geteuid(void);
  596. gid_t shim_getegid(void);
  597. int shim_setpgid(pid_t pid, pid_t pgid);
  598. pid_t shim_getppid(void);
  599. pid_t shim_getpgrp(void);
  600. int shim_setsid(void);
  601. int shim_setreuid(uid_t ruid, uid_t euid);
  602. int shim_setregid(gid_t rgid, gid_t egid);
  603. int shim_getgroups(int gidsetsize, gid_t* grouplist);
  604. int shim_setgroups(int gidsetsize, gid_t* grouplist);
  605. int shim_setresuid(uid_t ruid, uid_t euid, uid_t suid);
  606. int shim_getresuid(uid_t* ruid, uid_t* euid, uid_t* suid);
  607. int shim_setresgid(gid_t rgid, gid_t egid, gid_t sgid);
  608. int shim_getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid);
  609. int shim_getpgid(pid_t pid);
  610. int shim_setfsuid(uid_t uid);
  611. int shim_setfsgid(gid_t gid);
  612. int shim_getsid(pid_t pid);
  613. int shim_capget(cap_user_header_t header, cap_user_data_t dataptr);
  614. int shim_capset(cap_user_header_t header, const cap_user_data_t data);
  615. int shim_rt_sigpending(__sigset_t* set, size_t sigsetsize);
  616. int shim_rt_sigtimedwait(const __sigset_t* uthese, siginfo_t* uinfo, const struct timespec* uts,
  617. size_t sigsetsize);
  618. int shim_rt_sigqueueinfo(int pid, int sig, siginfo_t* uinfo);
  619. int shim_rt_sigsuspend(const __sigset_t* mask);
  620. int shim_sigaltstack(const stack_t* ss, stack_t* oss);
  621. int shim_utime(char* filename, struct utimbuf* times);
  622. int shim_mknod(const char* filename, int mode, unsigned dev);
  623. int shim_uselib(const char* library);
  624. int shim_personality(unsigned int personality);
  625. int shim_ustat(unsigned dev, struct __kernel_ustat* ubuf);
  626. int shim_statfs(const char* path, struct statfs* buf);
  627. int shim_fstatfs(int fd, struct statfs* buf);
  628. int shim_sysfs(int option, unsigned long arg1, unsigned long arg2);
  629. int shim_getpriority(int which, int who);
  630. int shim_setpriority(int which, int who, int niceval);
  631. int shim_sched_setparam(pid_t pid, struct __kernel_sched_param* param);
  632. int shim_sched_getparam(pid_t pid, struct __kernel_sched_param* param);
  633. int shim_sched_setscheduler(pid_t pid, int policy, struct __kernel_sched_param* param);
  634. int shim_sched_getscheduler(pid_t pid);
  635. int shim_sched_get_priority_max(int policy);
  636. int shim_sched_get_priority_min(int policy);
  637. int shim_sched_rr_get_interval(pid_t pid, struct timespec* interval);
  638. int shim_mlock(void* start, size_t len);
  639. int shim_munlock(void* start, size_t len);
  640. int shim_mlockall(int flags);
  641. int shim_munlockall(void);
  642. int shim_vhangup(void);
  643. int shim_modify_ldt(int func, void* ptr, unsigned long bytecount);
  644. int shim_pivot_root(const char* new_root, const char* put_old);
  645. int shim__sysctl(struct __kernel_sysctl_args* args);
  646. int shim_prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4,
  647. unsigned long arg5);
  648. void* shim_arch_prctl(int code, void* addr);
  649. int shim_adjtimex(struct ____kernel_timex* txc_p);
  650. int shim_setrlimit(int resource, struct __kernel_rlimit* rlim);
  651. int shim_chroot(const char* filename);
  652. int shim_sync(void);
  653. int shim_acct(const char* name);
  654. int shim_settimeofday(struct timeval* tv, struct __kernel_timezone* tz);
  655. int shim_mount(char* dev_name, char* dir_name, char* type, unsigned long flags, void* data);
  656. int shim_umount2(const char* target, int flags);
  657. int shim_swapon(const char* specialfile, int swap_flags);
  658. int shim_swapoff(const char* specialfile);
  659. int shim_reboot(int magic1, int magic2, int cmd, void* arg);
  660. int shim_sethostname(char* name, int len);
  661. int shim_setdomainname(char* name, int len);
  662. int shim_iopl(int level);
  663. int shim_ioperm(unsigned long from, unsigned long num, int on);
  664. int shim_create_module(const char* name, size_t size);
  665. int shim_init_module(void* umod, unsigned long len, const char* uargs);
  666. int shim_delete_module(const char* name_user, unsigned int flags);
  667. int shim_query_module(const char* name, int which, void* buf, size_t bufsize, size_t* retsize);
  668. int shim_quotactl(int cmd, const char* special, qid_t id, void* addr);
  669. pid_t shim_gettid(void);
  670. int shim_readahead(int fd, loff_t offset, size_t count);
  671. int shim_setxattr(const char* path, const char* name, const void* value, size_t size, int flags);
  672. int shim_lsetxattr(const char* path, const char* name, const void* value, size_t size, int flags);
  673. int shim_fsetxattr(int fd, const char* name, const void* value, size_t size, int flags);
  674. int shim_getxattr(const char* path, const char* name, void* value, size_t size);
  675. int shim_lgetxattr(const char* path, const char* name, void* value, size_t size);
  676. int shim_fgetxattr(int fd, const char* name, void* value, size_t size);
  677. int shim_listxattr(const char* path, char* list, size_t size);
  678. int shim_llistxattr(const char* path, char* list, size_t size);
  679. int shim_flistxattr(int fd, char* list, size_t size);
  680. int shim_removexattr(const char* path, const char* name);
  681. int shim_lremovexattr(const char* path, const char* name);
  682. int shim_fremovexattr(int fd, const char* name);
  683. int shim_tkill(int pid, int sig);
  684. time_t shim_time(time_t* tloc);
  685. int shim_futex(int* uaddr, int op, int val, void* utime, int* uaddr2, int val3);
  686. int shim_sched_setaffinity(pid_t pid, size_t len, __kernel_cpu_set_t* user_mask_ptr);
  687. int shim_sched_getaffinity(pid_t pid, size_t len, __kernel_cpu_set_t* user_mask_ptr);
  688. int shim_set_thread_area(struct user_desc* u_info);
  689. int shim_io_setup(unsigned nr_reqs, aio_context_t* ctx);
  690. int shim_io_destroy(aio_context_t ctx);
  691. int shim_io_getevents(aio_context_t ctx_id, long min_nr, long nr, struct io_event* events,
  692. struct timespec* timeout);
  693. int shim_io_submit(aio_context_t ctx_id, long nr, struct iocb** iocbpp);
  694. int shim_io_cancel(aio_context_t ctx_id, struct iocb* iocb, struct io_event* result);
  695. int shim_get_thread_area(struct user_desc* u_info);
  696. int shim_lookup_dcookie(unsigned long cookie64, char* buf, size_t len);
  697. int shim_epoll_create(int size);
  698. int shim_remap_file_pages(void* start, size_t size, int prot, ssize_t pgoff, int flags);
  699. size_t shim_getdents64(int fd, struct linux_dirent64* buf, size_t count);
  700. int shim_set_tid_address(int* tidptr);
  701. int shim_restart_syscall(void);
  702. int shim_semtimedop(int semid, struct sembuf* sops, unsigned nsops, const struct timespec* timeout);
  703. int shim_fadvise64(int fd, loff_t offset, size_t len, int advice);
  704. int shim_timer_create(clockid_t which_clock, struct sigevent* timer_event_spec,
  705. timer_t* created_timer_id);
  706. int shim_timer_settime(timer_t timer_id, int flags, const struct __kernel_itimerspec* new_setting,
  707. struct __kernel_itimerspec* old_setting);
  708. int shim_timer_gettime(timer_t timer_id, struct __kernel_itimerspec* setting);
  709. int shim_timer_getoverrun(timer_t timer_id);
  710. int shim_timer_delete(timer_t timer_id);
  711. int shim_clock_settime(clockid_t which_clock, const struct timespec* tp);
  712. int shim_clock_gettime(clockid_t which_clock, struct timespec* tp);
  713. int shim_clock_getres(clockid_t which_clock, struct timespec* tp);
  714. int shim_clock_nanosleep(clockid_t which_clock, int flags, const struct timespec* rqtp,
  715. struct timespec* rmtp);
  716. int shim_exit_group(int error_code);
  717. int shim_epoll_wait(int epfd, struct __kernel_epoll_event* events, int maxevents, int timeout_ms);
  718. int shim_epoll_ctl(int epfd, int op, int fd, struct __kernel_epoll_event* event);
  719. int shim_tgkill(int tgid, int pid, int sig);
  720. int shim_utimes(char* filename, struct timeval* utimes);
  721. int shim_mbind(void* start, unsigned long len, int mode, unsigned long* nmask,
  722. unsigned long maxnode, int flags);
  723. int shim_set_mempolicy(int mode, unsigned long* nmask, unsigned long maxnode);
  724. int shim_get_mempolicy(int* policy, unsigned long* nmask, unsigned long maxnode, unsigned long addr,
  725. unsigned long flags);
  726. int shim_mq_open(const char* name, int oflag, mode_t mode, struct __kernel_mq_attr* attr);
  727. int shim_mq_unlink(const char* name);
  728. int shim_mq_timedsend(__kernel_mqd_t mqdes, const char* msg_ptr, size_t msg_len,
  729. unsigned int msg_prio, const struct timespec* abs_timeout);
  730. int shim_mq_timedreceive(__kernel_mqd_t mqdes, char* msg_ptr, size_t msg_len,
  731. unsigned int* msg_prio, const struct timespec* abs_timeout);
  732. int shim_mq_notify(__kernel_mqd_t mqdes, const struct sigevent* notification);
  733. int shim_mq_getsetattr(__kernel_mqd_t mqdes, const struct __kernel_mq_attr* mqstat,
  734. struct __kernel_mq_attr* omqstat);
  735. int shim_waitid(int which, pid_t pid, siginfo_t* infop, int options, struct __kernel_rusage* ru);
  736. int shim_ioprio_set(int which, int who, int ioprio);
  737. int shim_ioprio_get(int which, int who);
  738. int shim_inotify_init(void);
  739. int shim_inotify_add_watch(int fd, const char* path, unsigned int mask);
  740. int shim_inotify_rm_watch(int fd, unsigned int wd);
  741. int shim_migrate_pages(pid_t pid, unsigned long maxnode, const unsigned long* from,
  742. const unsigned long* to);
  743. int shim_openat(int dfd, const char* filename, int flags, int mode);
  744. int shim_mkdirat(int dfd, const char* pathname, int mode);
  745. int shim_mknodat(int dfd, const char* filename, int mode, unsigned dev);
  746. int shim_fchownat(int dfd, const char* filename, uid_t user, gid_t group, int flag);
  747. int shim_futimesat(int dfd, const char* filename, struct timeval* utimes);
  748. int shim_newfstatat(int dfd, const char* filename, struct stat* statbuf, int flag);
  749. int shim_unlinkat(int dfd, const char* pathname, int flag);
  750. int shim_renameat(int olddfd, const char* oldname, int newdfd, const char* newname);
  751. int shim_linkat(int olddfd, const char* oldname, int newdfd, const char* newname, int flags);
  752. int shim_symlinkat(const char* oldname, int newdfd, const char* newname);
  753. int shim_readlinkat(int dfd, const char* path, char* buf, int bufsiz);
  754. int shim_fchmodat(int dfd, const char* filename, mode_t mode);
  755. int shim_faccessat(int dfd, const char* filename, int mode);
  756. int shim_pselect6(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds,
  757. const struct __kernel_timespec* tsp, const __sigset_t* sigmask);
  758. int shim_ppoll(struct pollfd* fds, int nfds, struct timespec* tsp, const __sigset_t* sigmask,
  759. size_t sigsetsize);
  760. int shim_unshare(int unshare_flags);
  761. int shim_set_robust_list(struct robust_list_head* head, size_t len);
  762. int shim_get_robust_list(pid_t pid, struct robust_list_head** head, size_t* len);
  763. int shim_splice(int fd_in, loff_t* off_in, int fd_out, loff_t* off_out, size_t len, int flags);
  764. int shim_tee(int fdin, int fdout, size_t len, unsigned int flags);
  765. int shim_sync_file_range(int fd, loff_t offset, loff_t nbytes, int flags);
  766. int shim_vmsplice(int fd, const struct iovec* iov, unsigned long nr_segs, int flags);
  767. int shim_move_pages(pid_t pid, unsigned long nr_pages, void** pages, const int* nodes, int* status,
  768. int flags);
  769. int shim_utimensat(int dfd, const char* filename, struct timespec* utimes, int flags);
  770. int shim_epoll_pwait(int epfd, struct __kernel_epoll_event* events, int maxevents, int timeout_ms,
  771. const __sigset_t* sigmask, size_t sigsetsize);
  772. int shim_signalfd(int ufd, __sigset_t* user_mask, size_t sizemask);
  773. int shim_timerfd_create(int clockid, int flags);
  774. int shim_eventfd(int count);
  775. int shim_fallocate(int fd, int mode, loff_t offset, loff_t len);
  776. int shim_timerfd_settime(int ufd, int flags, const struct __kernel_itimerspec* utmr,
  777. struct __kernel_itimerspec* otmr);
  778. int shim_timerfd_gettime(int ufd, struct __kernel_itimerspec* otmr);
  779. int shim_accept4(int sockfd, struct sockaddr* addr, socklen_t* addrlen, int flags);
  780. int shim_signalfd4(int ufd, __sigset_t* user_mask, size_t sizemask, int flags);
  781. int shim_eventfd2(int count, int flags);
  782. int shim_epoll_create1(int flags);
  783. int shim_dup3(int oldfd, int newfd, int flags);
  784. int shim_pipe2(int* fildes, int flags);
  785. int shim_inotify_init1(int flags);
  786. int shim_preadv(unsigned long fd, const struct iovec* vec, unsigned long vlen, unsigned long pos_l,
  787. unsigned long pos_h);
  788. int shim_pwritev(unsigned long fd, const struct iovec* vec, unsigned long vlen, unsigned long pos_l,
  789. unsigned long pos_h);
  790. int shim_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, siginfo_t* uinfo);
  791. int shim_perf_event_open(struct perf_event_attr* attr_uptr, pid_t pid, int cpu, int group_fd,
  792. int flags);
  793. ssize_t shim_recvmmsg(int sockfd, struct mmsghdr* msg, size_t vlen, int flags,
  794. struct __kernel_timespec* timeout);
  795. int shim_prlimit64(pid_t pid, int resource, const struct __kernel_rlimit64* new_rlim,
  796. struct __kernel_rlimit64* old_rlim);
  797. ssize_t shim_sendmmsg(int sockfd, struct mmsghdr* msg, size_t vlen, int flags);
  798. /* libos call wrappers */
  799. int shim_msgpersist(int msqid, int cmd);
  800. int shim_benchmark_rpc(pid_t pid, int times, const void* buf, size_t size);
  801. size_t shim_send_rpc(pid_t pid, const void* buf, size_t size);
  802. size_t shim_recv_rpc(pid_t* pid, void* buf, size_t size);
  803. int shim_checkpoint(const char* filename);
  804. #endif /* _SHIM_TABLE_H_ */