shim_table.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  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_setpriority(int which, int who, int niceval);
  431. int shim_do_getpriority(int which, int who);
  432. int shim_do_sched_setparam(pid_t pid, struct __kernel_sched_param* param);
  433. int shim_do_sched_getparam(pid_t pid, struct __kernel_sched_param* param);
  434. int shim_do_sched_setscheduler(pid_t pid, int policy, struct __kernel_sched_param* param);
  435. int shim_do_sched_getscheduler(pid_t pid);
  436. int shim_do_sched_get_priority_max(int policy);
  437. int shim_do_sched_get_priority_min(int policy);
  438. int shim_do_sched_rr_get_interval(pid_t pid, struct timespec* interval);
  439. int shim_do_sigsuspend(const __sigset_t* mask);
  440. void* shim_do_arch_prctl(int code, void* addr);
  441. int shim_do_setrlimit(int resource, struct __kernel_rlimit* rlim);
  442. int shim_do_chroot(const char* filename);
  443. pid_t shim_do_gettid(void);
  444. int shim_do_tkill(int pid, int sig);
  445. time_t shim_do_time(time_t* tloc);
  446. int shim_do_futex(int* uaddr, int op, int val, void* utime, int* uaddr2, int val3);
  447. int shim_do_sched_setaffinity(pid_t pid, size_t len, __kernel_cpu_set_t* user_mask_ptr);
  448. int shim_do_sched_getaffinity(pid_t pid, size_t len, __kernel_cpu_set_t* user_mask_ptr);
  449. int shim_do_set_tid_address(int* tidptr);
  450. int shim_do_semtimedop(int semid, struct sembuf* sops, unsigned int nsops,
  451. const struct timespec* timeout);
  452. int shim_do_epoll_create(int size);
  453. size_t shim_do_getdents64(int fd, struct linux_dirent64* buf, size_t count);
  454. int shim_do_epoll_wait(int epfd, struct __kernel_epoll_event* events, int maxevents,
  455. int timeout_ms);
  456. int shim_do_epoll_ctl(int epfd, int op, int fd, struct __kernel_epoll_event* event);
  457. int shim_do_clock_gettime(clockid_t which_clock, struct timespec* tp);
  458. int shim_do_clock_getres(clockid_t which_clock, struct timespec* tp);
  459. noreturn int shim_do_exit_group(int error_code);
  460. int shim_do_tgkill(int tgid, int pid, int sig);
  461. int shim_do_mbind(void* start, unsigned long len, int mode, unsigned long* nmask,
  462. unsigned long maxnode, int flags);
  463. int shim_do_openat(int dfd, const char* filename, int flags, int mode);
  464. int shim_do_mkdirat(int dfd, const char* pathname, int mode);
  465. int shim_do_newfstatat(int dirfd, const char* pathname, struct stat* statbuf, int flags);
  466. int shim_do_unlinkat(int dfd, const char* pathname, int flag);
  467. int shim_do_renameat(int olddfd, const char* pathname, int newdfd, const char* newname);
  468. int shim_do_fchmodat(int dfd, const char* filename, mode_t mode);
  469. int shim_do_fchownat(int dfd, const char* filename, uid_t user, gid_t group, int flags);
  470. int shim_do_faccessat(int dfd, const char* filename, mode_t mode);
  471. int shim_do_pselect6(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds,
  472. const struct __kernel_timespec* tsp, const __sigset_t* sigmask);
  473. int shim_do_ppoll(struct pollfd* fds, int nfds, struct timespec* tsp, const __sigset_t* sigmask,
  474. size_t sigsetsize);
  475. int shim_do_set_robust_list(struct robust_list_head* head, size_t len);
  476. int shim_do_get_robust_list(pid_t pid, struct robust_list_head** head, size_t* len);
  477. int shim_do_epoll_pwait(int epfd, struct __kernel_epoll_event* events, int maxevents,
  478. int timeout_ms, const __sigset_t* sigmask, size_t sigsetsize);
  479. int shim_do_accept4(int sockfd, struct sockaddr* addr, socklen_t* addrlen, int flags);
  480. int shim_do_dup3(int oldfd, int newfd, int flags);
  481. int shim_do_epoll_create1(int flags);
  482. int shim_do_pipe2(int* fildes, int flags);
  483. ssize_t shim_do_recvmmsg(int sockfd, struct mmsghdr* msg, size_t vlen, int flags,
  484. struct __kernel_timespec* timeout);
  485. int shim_do_prlimit64(pid_t pid, int resource, const struct __kernel_rlimit64* new_rlim,
  486. struct __kernel_rlimit64* old_rlim);
  487. ssize_t shim_do_sendmmsg(int sockfd, struct mmsghdr* msg, size_t vlen, int flags);
  488. int shim_do_eventfd2(unsigned int count, int flags);
  489. int shim_do_eventfd(unsigned int count);
  490. /* libos call implementation */
  491. int shim_do_msgpersist(int msqid, int cmd);
  492. int shim_do_benchmark_rpc(pid_t pid, int times, const void* buf, size_t size);
  493. size_t shim_do_send_rpc(pid_t pid, const void* buf, size_t size);
  494. size_t shim_do_recv_rpc(pid_t* pid, void* buf, size_t size);
  495. int shim_do_checkpoint(const char* filename);
  496. #endif /* ! IN_SHIM */
  497. /* syscall wrappers */
  498. size_t shim_read(int fd, void* buf, size_t count);
  499. size_t shim_write(int fd, const void* buf, size_t count);
  500. int shim_open(const char* file, int flags, mode_t mode);
  501. int shim_close(int fd);
  502. int shim_stat(const char* file, struct stat* statbuf);
  503. int shim_fstat(int fd, struct stat* statbuf);
  504. int shim_lstat(const char* file, struct stat* statbuf);
  505. int shim_poll(struct pollfd* fds, nfds_t nfds, int timeout);
  506. off_t shim_lseek(int fd, off_t offset, int origin);
  507. void* shim_mmap(void* addr, size_t length, int prot, int flags, int fd, off_t offset);
  508. int shim_mprotect(void* addr, size_t len, int prot);
  509. int shim_munmap(void* addr, size_t len);
  510. void* shim_brk(void* brk);
  511. int shim_rt_sigaction(int signum, const struct __kernel_sigaction* act,
  512. struct __kernel_sigaction* oldact, size_t sigsetsize);
  513. int shim_rt_sigprocmask(int how, const __sigset_t* set, __sigset_t* oldset);
  514. int shim_rt_sigreturn(int __unused);
  515. int shim_ioctl(int fd, int cmd, unsigned long arg);
  516. size_t shim_pread64(int fd, char* buf, size_t count, loff_t pos);
  517. size_t shim_pwrite64(int fd, char* buf, size_t count, loff_t pos);
  518. ssize_t shim_readv(int fd, const struct iovec* vec, int vlen);
  519. ssize_t shim_writev(int fd, const struct iovec* vec, int vlen);
  520. int shim_access(const char* file, mode_t mode);
  521. int shim_pipe(int* fildes);
  522. int shim_select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* errorfds,
  523. struct __kernel_timeval* timeout);
  524. int shim_sched_yield(void);
  525. void* shim_mremap(void* addr, size_t old_len, size_t new_len, int flags, void* new_addr);
  526. int shim_msync(void* start, size_t len, int flags);
  527. int shim_mincore(void* start, size_t len, unsigned char* vec);
  528. int shim_madvise(void* start, size_t len, int behavior);
  529. int shim_shmget(key_t key, size_t size, int shmflg);
  530. void* shim_shmat(int shmid, const void* shmaddr, int shmflg);
  531. int shim_shmctl(int shmid, int cmd, struct shmid_ds* buf);
  532. int shim_dup(int fd);
  533. int shim_dup2(int oldfd, int newfd);
  534. int shim_pause(void);
  535. int shim_nanosleep(const struct __kernel_timespec* rqtp, struct __kernel_timespec* rmtp);
  536. int shim_getitimer(int which, struct __kernel_itimerval* value);
  537. int shim_alarm(unsigned int seconds);
  538. int shim_setitimer(int which, struct __kernel_itimerval* value, struct __kernel_itimerval* ovalue);
  539. pid_t shim_getpid(void);
  540. ssize_t shim_sendfile(int out_fd, int in_fd, off_t* offset, size_t count);
  541. int shim_socket(int family, int type, int protocol);
  542. int shim_connect(int sockfd, struct sockaddr* addr, int addrlen);
  543. int shim_accept(int fd, struct sockaddr* addr, socklen_t* addrlen);
  544. ssize_t shim_sendto(int fd, const void* buf, size_t len, int flags,
  545. const struct sockaddr* dest_addr, socklen_t addrlen);
  546. ssize_t shim_recvfrom(int fd, void* buf, size_t len, int flags, struct sockaddr* addr,
  547. socklen_t* addrlen);
  548. int shim_bind(int sockfd, struct sockaddr* addr, socklen_t addrlen);
  549. int shim_listen(int sockfd, int backlog);
  550. ssize_t shim_sendmsg(int fd, struct msghdr* msg, int flags);
  551. ssize_t shim_recvmsg(int fd, struct msghdr* msg, int flags);
  552. int shim_shutdown(int sockfd, int how);
  553. int shim_getsockname(int sockfd, struct sockaddr* addr, int* addrlen);
  554. int shim_getpeername(int sockfd, struct sockaddr* addr, int* addrlen);
  555. int shim_socketpair(int domain, int type, int protocol, int* sv);
  556. int shim_setsockopt(int fd, int level, int optname, char* optval, int optlen);
  557. int shim_getsockopt(int fd, int level, int optname, char* optval, int* optlen);
  558. int shim_clone(int flags, void* user_stack_addr, int* parent_tidptr, int* child_tidptr, void* tls);
  559. int shim_fork(void);
  560. int shim_vfork(void);
  561. int shim_execve(const char* file, const char** argv, const char** envp);
  562. int shim_exit(int error_code);
  563. pid_t shim_wait4(pid_t pid, int* stat_addr, int option, struct __kernel_rusage* ru);
  564. int shim_kill(pid_t pid, int sig);
  565. int shim_uname(struct old_utsname* buf);
  566. int shim_semget(key_t key, int nsems, int semflg);
  567. int shim_semop(int semid, struct sembuf* sops, unsigned int nsops);
  568. int shim_semctl(int semid, int semnum, int cmd, unsigned long arg);
  569. int shim_shmdt(const void* shmaddr);
  570. int shim_msgget(key_t key, int msgflg);
  571. int shim_msgsnd(int msqid, const void* msgp, size_t msgsz, int msgflg);
  572. int shim_msgrcv(int msqid, void* msgp, size_t msgsz, long msgtyp, int msgflg);
  573. int shim_msgctl(int msqid, int cmd, struct msqid_ds* buf);
  574. int shim_fcntl(int fd, int cmd, unsigned long arg);
  575. int shim_flock(int fd, int cmd);
  576. int shim_fsync(int fd);
  577. int shim_fdatasync(int fd);
  578. int shim_truncate(const char* path, loff_t length);
  579. int shim_ftruncate(int fd, loff_t length);
  580. size_t shim_getdents(int fd, struct linux_dirent* buf, size_t count);
  581. int shim_getcwd(char* buf, size_t size);
  582. int shim_chdir(const char* filename);
  583. int shim_fchdir(int fd);
  584. int shim_rename(const char* oldname, const char* newname);
  585. int shim_mkdir(const char* pathname, int mode);
  586. int shim_rmdir(const char* pathname);
  587. int shim_creat(const char* path, mode_t mode);
  588. int shim_link(const char* oldname, const char* newname);
  589. int shim_unlink(const char* file);
  590. int shim_symlink(const char* old, const char* new);
  591. int shim_readlink(const char* file, char* buf, size_t bufsize);
  592. int shim_chmod(const char* filename, mode_t mode);
  593. int shim_fchmod(int fd, mode_t mode);
  594. int shim_chown(const char* filename, uid_t user, gid_t group);
  595. int shim_fchown(int fd, uid_t user, gid_t group);
  596. int shim_lchown(const char* filename, uid_t user, gid_t group);
  597. mode_t shim_umask(mode_t mask);
  598. int shim_gettimeofday(struct __kernel_timeval* tv, struct __kernel_timezone* tz);
  599. int shim_getrlimit(int resource, struct __kernel_rlimit* rlim);
  600. int shim_getrusage(int who, struct __kernel_rusage* ru);
  601. int shim_sysinfo(struct sysinfo* info);
  602. int shim_times(struct tms* tbuf);
  603. int shim_ptrace(long request, pid_t pid, void* addr, void* data);
  604. uid_t shim_getuid(void);
  605. int shim_syslog(int type, char* buf, int len);
  606. gid_t shim_getgid(void);
  607. int shim_setuid(uid_t uid);
  608. int shim_setgid(gid_t gid);
  609. uid_t shim_geteuid(void);
  610. gid_t shim_getegid(void);
  611. int shim_setpgid(pid_t pid, pid_t pgid);
  612. pid_t shim_getppid(void);
  613. pid_t shim_getpgrp(void);
  614. int shim_setsid(void);
  615. int shim_setreuid(uid_t ruid, uid_t euid);
  616. int shim_setregid(gid_t rgid, gid_t egid);
  617. int shim_getgroups(int gidsetsize, gid_t* grouplist);
  618. int shim_setgroups(int gidsetsize, gid_t* grouplist);
  619. int shim_setresuid(uid_t ruid, uid_t euid, uid_t suid);
  620. int shim_getresuid(uid_t* ruid, uid_t* euid, uid_t* suid);
  621. int shim_setresgid(gid_t rgid, gid_t egid, gid_t sgid);
  622. int shim_getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid);
  623. int shim_getpgid(pid_t pid);
  624. int shim_setfsuid(uid_t uid);
  625. int shim_setfsgid(gid_t gid);
  626. int shim_getsid(pid_t pid);
  627. int shim_capget(cap_user_header_t header, cap_user_data_t dataptr);
  628. int shim_capset(cap_user_header_t header, const cap_user_data_t data);
  629. int shim_rt_sigpending(__sigset_t* set, size_t sigsetsize);
  630. int shim_rt_sigtimedwait(const __sigset_t* uthese, siginfo_t* uinfo, const struct timespec* uts,
  631. size_t sigsetsize);
  632. int shim_rt_sigqueueinfo(int pid, int sig, siginfo_t* uinfo);
  633. int shim_rt_sigsuspend(const __sigset_t* mask);
  634. int shim_sigaltstack(const stack_t* ss, stack_t* oss);
  635. int shim_utime(char* filename, struct utimbuf* times);
  636. int shim_mknod(const char* filename, int mode, unsigned dev);
  637. int shim_uselib(const char* library);
  638. int shim_personality(unsigned int personality);
  639. int shim_ustat(unsigned dev, struct __kernel_ustat* ubuf);
  640. int shim_statfs(const char* path, struct statfs* buf);
  641. int shim_fstatfs(int fd, struct statfs* buf);
  642. int shim_sysfs(int option, unsigned long arg1, unsigned long arg2);
  643. int shim_getpriority(int which, int who);
  644. int shim_setpriority(int which, int who, int niceval);
  645. int shim_sched_setparam(pid_t pid, struct __kernel_sched_param* param);
  646. int shim_sched_getparam(pid_t pid, struct __kernel_sched_param* param);
  647. int shim_sched_setscheduler(pid_t pid, int policy, struct __kernel_sched_param* param);
  648. int shim_sched_getscheduler(pid_t pid);
  649. int shim_sched_get_priority_max(int policy);
  650. int shim_sched_get_priority_min(int policy);
  651. int shim_sched_rr_get_interval(pid_t pid, struct timespec* interval);
  652. int shim_mlock(void* start, size_t len);
  653. int shim_munlock(void* start, size_t len);
  654. int shim_mlockall(int flags);
  655. int shim_munlockall(void);
  656. int shim_vhangup(void);
  657. int shim_modify_ldt(int func, void* ptr, unsigned long bytecount);
  658. int shim_pivot_root(const char* new_root, const char* put_old);
  659. int shim__sysctl(struct __kernel_sysctl_args* args);
  660. int shim_prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4,
  661. unsigned long arg5);
  662. void* shim_arch_prctl(int code, void* addr);
  663. int shim_adjtimex(struct ____kernel_timex* txc_p);
  664. int shim_setrlimit(int resource, struct __kernel_rlimit* rlim);
  665. int shim_chroot(const char* filename);
  666. int shim_sync(void);
  667. int shim_acct(const char* name);
  668. int shim_settimeofday(struct timeval* tv, struct __kernel_timezone* tz);
  669. int shim_mount(char* dev_name, char* dir_name, char* type, unsigned long flags, void* data);
  670. int shim_umount2(const char* target, int flags);
  671. int shim_swapon(const char* specialfile, int swap_flags);
  672. int shim_swapoff(const char* specialfile);
  673. int shim_reboot(int magic1, int magic2, int cmd, void* arg);
  674. int shim_sethostname(char* name, int len);
  675. int shim_setdomainname(char* name, int len);
  676. int shim_iopl(int level);
  677. int shim_ioperm(unsigned long from, unsigned long num, int on);
  678. int shim_create_module(const char* name, size_t size);
  679. int shim_init_module(void* umod, unsigned long len, const char* uargs);
  680. int shim_delete_module(const char* name_user, unsigned int flags);
  681. int shim_query_module(const char* name, int which, void* buf, size_t bufsize, size_t* retsize);
  682. int shim_quotactl(int cmd, const char* special, qid_t id, void* addr);
  683. pid_t shim_gettid(void);
  684. int shim_readahead(int fd, loff_t offset, size_t count);
  685. int shim_setxattr(const char* path, const char* name, const void* value, size_t size, int flags);
  686. int shim_lsetxattr(const char* path, const char* name, const void* value, size_t size, int flags);
  687. int shim_fsetxattr(int fd, const char* name, const void* value, size_t size, int flags);
  688. int shim_getxattr(const char* path, const char* name, void* value, size_t size);
  689. int shim_lgetxattr(const char* path, const char* name, void* value, size_t size);
  690. int shim_fgetxattr(int fd, const char* name, void* value, size_t size);
  691. int shim_listxattr(const char* path, char* list, size_t size);
  692. int shim_llistxattr(const char* path, char* list, size_t size);
  693. int shim_flistxattr(int fd, char* list, size_t size);
  694. int shim_removexattr(const char* path, const char* name);
  695. int shim_lremovexattr(const char* path, const char* name);
  696. int shim_fremovexattr(int fd, const char* name);
  697. int shim_tkill(int pid, int sig);
  698. time_t shim_time(time_t* tloc);
  699. int shim_futex(int* uaddr, int op, int val, void* utime, int* uaddr2, int val3);
  700. int shim_sched_setaffinity(pid_t pid, size_t len, __kernel_cpu_set_t* user_mask_ptr);
  701. int shim_sched_getaffinity(pid_t pid, size_t len, __kernel_cpu_set_t* user_mask_ptr);
  702. int shim_set_thread_area(struct user_desc* u_info);
  703. int shim_io_setup(unsigned nr_reqs, aio_context_t* ctx);
  704. int shim_io_destroy(aio_context_t ctx);
  705. int shim_io_getevents(aio_context_t ctx_id, long min_nr, long nr, struct io_event* events,
  706. struct timespec* timeout);
  707. int shim_io_submit(aio_context_t ctx_id, long nr, struct iocb** iocbpp);
  708. int shim_io_cancel(aio_context_t ctx_id, struct iocb* iocb, struct io_event* result);
  709. int shim_get_thread_area(struct user_desc* u_info);
  710. int shim_lookup_dcookie(unsigned long cookie64, char* buf, size_t len);
  711. int shim_epoll_create(int size);
  712. int shim_remap_file_pages(void* start, size_t size, int prot, ssize_t pgoff, int flags);
  713. size_t shim_getdents64(int fd, struct linux_dirent64* buf, size_t count);
  714. int shim_set_tid_address(int* tidptr);
  715. int shim_restart_syscall(void);
  716. int shim_semtimedop(int semid, struct sembuf* sops, unsigned nsops, const struct timespec* timeout);
  717. int shim_fadvise64(int fd, loff_t offset, size_t len, int advice);
  718. int shim_timer_create(clockid_t which_clock, struct sigevent* timer_event_spec,
  719. timer_t* created_timer_id);
  720. int shim_timer_settime(timer_t timer_id, int flags, const struct __kernel_itimerspec* new_setting,
  721. struct __kernel_itimerspec* old_setting);
  722. int shim_timer_gettime(timer_t timer_id, struct __kernel_itimerspec* setting);
  723. int shim_timer_getoverrun(timer_t timer_id);
  724. int shim_timer_delete(timer_t timer_id);
  725. int shim_clock_settime(clockid_t which_clock, const struct timespec* tp);
  726. int shim_clock_gettime(clockid_t which_clock, struct timespec* tp);
  727. int shim_clock_getres(clockid_t which_clock, struct timespec* tp);
  728. int shim_clock_nanosleep(clockid_t which_clock, int flags, const struct timespec* rqtp,
  729. struct timespec* rmtp);
  730. int shim_exit_group(int error_code);
  731. int shim_epoll_wait(int epfd, struct __kernel_epoll_event* events, int maxevents, int timeout_ms);
  732. int shim_epoll_ctl(int epfd, int op, int fd, struct __kernel_epoll_event* event);
  733. int shim_tgkill(int tgid, int pid, int sig);
  734. int shim_utimes(char* filename, struct timeval* utimes);
  735. int shim_mbind(void* start, unsigned long len, int mode, unsigned long* nmask,
  736. unsigned long maxnode, int flags);
  737. int shim_set_mempolicy(int mode, unsigned long* nmask, unsigned long maxnode);
  738. int shim_get_mempolicy(int* policy, unsigned long* nmask, unsigned long maxnode, unsigned long addr,
  739. unsigned long flags);
  740. int shim_mq_open(const char* name, int oflag, mode_t mode, struct __kernel_mq_attr* attr);
  741. int shim_mq_unlink(const char* name);
  742. int shim_mq_timedsend(__kernel_mqd_t mqdes, const char* msg_ptr, size_t msg_len,
  743. unsigned int msg_prio, const struct timespec* abs_timeout);
  744. int shim_mq_timedreceive(__kernel_mqd_t mqdes, char* msg_ptr, size_t msg_len,
  745. unsigned int* msg_prio, const struct timespec* abs_timeout);
  746. int shim_mq_notify(__kernel_mqd_t mqdes, const struct sigevent* notification);
  747. int shim_mq_getsetattr(__kernel_mqd_t mqdes, const struct __kernel_mq_attr* mqstat,
  748. struct __kernel_mq_attr* omqstat);
  749. int shim_waitid(int which, pid_t pid, siginfo_t* infop, int options, struct __kernel_rusage* ru);
  750. int shim_ioprio_set(int which, int who, int ioprio);
  751. int shim_ioprio_get(int which, int who);
  752. int shim_inotify_init(void);
  753. int shim_inotify_add_watch(int fd, const char* path, unsigned int mask);
  754. int shim_inotify_rm_watch(int fd, unsigned int wd);
  755. int shim_migrate_pages(pid_t pid, unsigned long maxnode, const unsigned long* from,
  756. const unsigned long* to);
  757. int shim_openat(int dfd, const char* filename, int flags, int mode);
  758. int shim_mkdirat(int dfd, const char* pathname, int mode);
  759. int shim_mknodat(int dfd, const char* filename, int mode, unsigned dev);
  760. int shim_fchownat(int dfd, const char* filename, uid_t user, gid_t group, int flag);
  761. int shim_futimesat(int dfd, const char* filename, struct timeval* utimes);
  762. int shim_newfstatat(int dfd, const char* filename, struct stat* statbuf, int flag);
  763. int shim_unlinkat(int dfd, const char* pathname, int flag);
  764. int shim_renameat(int olddfd, const char* oldname, int newdfd, const char* newname);
  765. int shim_linkat(int olddfd, const char* oldname, int newdfd, const char* newname, int flags);
  766. int shim_symlinkat(const char* oldname, int newdfd, const char* newname);
  767. int shim_readlinkat(int dfd, const char* path, char* buf, int bufsiz);
  768. int shim_fchmodat(int dfd, const char* filename, mode_t mode);
  769. int shim_faccessat(int dfd, const char* filename, int mode);
  770. int shim_pselect6(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds,
  771. const struct __kernel_timespec* tsp, const __sigset_t* sigmask);
  772. int shim_ppoll(struct pollfd* fds, int nfds, struct timespec* tsp, const __sigset_t* sigmask,
  773. size_t sigsetsize);
  774. int shim_unshare(int unshare_flags);
  775. int shim_set_robust_list(struct robust_list_head* head, size_t len);
  776. int shim_get_robust_list(pid_t pid, struct robust_list_head** head, size_t* len);
  777. int shim_splice(int fd_in, loff_t* off_in, int fd_out, loff_t* off_out, size_t len, int flags);
  778. int shim_tee(int fdin, int fdout, size_t len, unsigned int flags);
  779. int shim_sync_file_range(int fd, loff_t offset, loff_t nbytes, int flags);
  780. int shim_vmsplice(int fd, const struct iovec* iov, unsigned long nr_segs, int flags);
  781. int shim_move_pages(pid_t pid, unsigned long nr_pages, void** pages, const int* nodes, int* status,
  782. int flags);
  783. int shim_utimensat(int dfd, const char* filename, struct timespec* utimes, int flags);
  784. int shim_epoll_pwait(int epfd, struct __kernel_epoll_event* events, int maxevents, int timeout_ms,
  785. const __sigset_t* sigmask, size_t sigsetsize);
  786. int shim_signalfd(int ufd, __sigset_t* user_mask, size_t sizemask);
  787. int shim_timerfd_create(int clockid, int flags);
  788. int shim_eventfd(unsigned int count);
  789. int shim_fallocate(int fd, int mode, loff_t offset, loff_t len);
  790. int shim_timerfd_settime(int ufd, int flags, const struct __kernel_itimerspec* utmr,
  791. struct __kernel_itimerspec* otmr);
  792. int shim_timerfd_gettime(int ufd, struct __kernel_itimerspec* otmr);
  793. int shim_accept4(int sockfd, struct sockaddr* addr, socklen_t* addrlen, int flags);
  794. int shim_signalfd4(int ufd, __sigset_t* user_mask, size_t sizemask, int flags);
  795. int shim_eventfd2(unsigned int count, int flags);
  796. int shim_epoll_create1(int flags);
  797. int shim_dup3(int oldfd, int newfd, int flags);
  798. int shim_pipe2(int* fildes, int flags);
  799. int shim_inotify_init1(int flags);
  800. int shim_preadv(unsigned long fd, const struct iovec* vec, unsigned long vlen, unsigned long pos_l,
  801. unsigned long pos_h);
  802. int shim_pwritev(unsigned long fd, const struct iovec* vec, unsigned long vlen, unsigned long pos_l,
  803. unsigned long pos_h);
  804. int shim_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, siginfo_t* uinfo);
  805. int shim_perf_event_open(struct perf_event_attr* attr_uptr, pid_t pid, int cpu, int group_fd,
  806. int flags);
  807. ssize_t shim_recvmmsg(int sockfd, struct mmsghdr* msg, size_t vlen, int flags,
  808. struct __kernel_timespec* timeout);
  809. int shim_prlimit64(pid_t pid, int resource, const struct __kernel_rlimit64* new_rlim,
  810. struct __kernel_rlimit64* old_rlim);
  811. ssize_t shim_sendmmsg(int sockfd, struct mmsghdr* msg, size_t vlen, int flags);
  812. /* libos call wrappers */
  813. int shim_msgpersist(int msqid, int cmd);
  814. int shim_benchmark_rpc(pid_t pid, int times, const void* buf, size_t size);
  815. size_t shim_send_rpc(pid_t pid, const void* buf, size_t size);
  816. size_t shim_recv_rpc(pid_t* pid, void* buf, size_t size);
  817. int shim_checkpoint(const char* filename);
  818. #endif /* _SHIM_TABLE_H_ */