shim_table.h 42 KB

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