《操作系统》的实验代码。

31 rader
843 B

12 år sedan
  1. #ifndef __LIBS_UNISTD_H__
  2. #define __LIBS_UNISTD_H__
  3. #define T_SYSCALL 0x80
  4. /* syscall number */
  5. #define SYS_exit 1
  6. #define SYS_fork 2
  7. #define SYS_wait 3
  8. #define SYS_exec 4
  9. #define SYS_clone 5
  10. #define SYS_yield 10
  11. #define SYS_sleep 11
  12. #define SYS_kill 12
  13. #define SYS_gettime 17
  14. #define SYS_getpid 18
  15. #define SYS_brk 19
  16. #define SYS_mmap 20
  17. #define SYS_munmap 21
  18. #define SYS_shmem 22
  19. #define SYS_putc 30
  20. #define SYS_pgdir 31
  21. /* OLNY FOR LAB6 */
  22. #define SYS_lab6_set_priority 255
  23. /* SYS_fork flags */
  24. #define CLONE_VM 0x00000100 // set if VM shared between processes
  25. #define CLONE_THREAD 0x00000200 // thread group
  26. #endif /* !__LIBS_UNISTD_H__ */