shim_unistd.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _SHIM_UNISTD_H_
  2. #define _SHIM_UNISTD_H_
  3. #ifdef IN_SHIM
  4. #include "shim_types.h"
  5. #else
  6. /* XXX(borysp): This is hacky. Normally we would want to just include <sys/types.h> but it would
  7. * break some tests in "inline" directory. The main reason is that other header files are not
  8. * prepared for being included both in LibOS and in standalone binaries. Fortunately this header
  9. * only missed one type definition, hence this typedef suffices. */
  10. typedef int pid_t;
  11. #include <unistd.h>
  12. #endif
  13. #define __NR_msgpersist (LIBOS_SYSCALL_BASE + 1)
  14. #define MSGPERSIST_STORE 0
  15. #define MSGPERSIST_LOAD 1
  16. int msgpersist(int msqid, int cmd);
  17. #define __NR_benchmark_rpc (LIBOS_SYSCALL_BASE + 2)
  18. #define __NR_send_rpc (LIBOS_SYSCALL_BASE + 3)
  19. #define __NR_recv_rpc (LIBOS_SYSCALL_BASE + 4)
  20. int benchmark_rpc(pid_t pid, int times, const void* buf, size_t size);
  21. size_t send_rpc(pid_t pid, const void* buf, size_t size);
  22. size_t recv_rpc(pid_t* pid, void* buf, size_t size);
  23. struct nameinfo {
  24. char* host;
  25. size_t hostlen;
  26. char* serv;
  27. size_t servlen;
  28. };
  29. #define __NR_checkpoint (LIBOS_SYSCALL_BASE + 5)
  30. int checkpoint(const char* filename);
  31. struct sigcp {
  32. int si_session;
  33. };
  34. #define SI_CP_SESSION(info) (((struct sigcp*)&(info)->_sifields)->si_session)
  35. #define SIGCP 33
  36. #include "shim_unistd_defs.h"
  37. #endif /* _SHIM_UNISTD_H_ */