shim_table.h 42 KB

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