shim_unistd.h 1.7 KB

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