shim_unistd.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef _SHIM_UNISTD_H_
  2. #define _SHIM_UNISTD_H_
  3. #ifdef IN_SHIM
  4. #include "shim_types.h"
  5. #else
  6. #include <unistd.h>
  7. #endif
  8. #define __NR_sandbox_create (LIBOS_SYSCALL_BASE + 1)
  9. #define __NR_sandbox_attach (LIBOS_SYSCALL_BASE + 2)
  10. #define __NR_sandbox_current (LIBOS_SYSCALL_BASE + 3)
  11. #define SANDBOX_RPC 0x001
  12. #define SANDBOX_FS 0x002
  13. #define SANDBOX_NET 0x004
  14. struct sockaddr;
  15. struct net_sb_rule {
  16. int l_addrlen;
  17. struct sockaddr * l_addr;
  18. int r_addrlen;
  19. struct sockaddr * r_addr;
  20. };
  21. struct net_sb {
  22. int nrules;
  23. struct net_sb_rule * rules;
  24. };
  25. long sandbox_create (int flags, const char * fs_sb, struct net_sb * net_sb);
  26. int sandbox_attach (unsigned int sbid);
  27. long sandbox_current (void);
  28. #define __NR_msgpersist (LIBOS_SYSCALL_BASE + 4)
  29. #define MSGPERSIST_STORE 0
  30. #define MSGPERSIST_LOAD 1
  31. int msgpersist (int msqid, int cmd);
  32. #define __NR_benchmark_rpc (LIBOS_SYSCALL_BASE + 5)
  33. #define __NR_send_rpc (LIBOS_SYSCALL_BASE + 6)
  34. #define __NR_recv_rpc (LIBOS_SYSCALL_BASE + 7)
  35. int benchmark_rpc (pid_t pid, int times, const void * buf, size_t size);
  36. size_t send_rpc (pid_t pid, const void * buf, size_t size);
  37. size_t recv_rpc (pid_t * pid, void * buf, size_t size);
  38. struct nameinfo {
  39. char * host;
  40. size_t hostlen;
  41. char * serv;
  42. size_t servlen;
  43. };
  44. #define __NR_checkpoint (LIBOS_SYSCALL_BASE + 8)
  45. int checkpoint (const char * filename);
  46. struct sigcp {
  47. int si_session;
  48. };
  49. #define SI_CP_SESSION(info) \
  50. (((struct sigcp *) (info)->_sifields._pad)->si_session)
  51. #define SIGCP 33
  52. #include "shim_unistd_defs.h"
  53. #endif /* _SHIM_UNISTD_H_ */