syscall.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /*
  2. * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008
  3. * The President and Fellows of Harvard College.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the University nor the names of its contributors
  14. * may be used to endorse or promote products derived from this software
  15. * without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
  18. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. * ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
  21. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27. * SUCH DAMAGE.
  28. */
  29. #ifndef _KERN_SYSCALL_H_
  30. #define _KERN_SYSCALL_H_
  31. /*
  32. * System call numbers.
  33. *
  34. * To foster compatibility, this file contains a number for every
  35. * more-or-less standard Unix system call that someone might
  36. * conceivably implement on OS/161. The commented-out ones are ones
  37. * we're pretty sure you won't be implementing. The others, you might
  38. * or might not. Check your own course materials to find out what's
  39. * specifically required of you.
  40. *
  41. * Caution: this file is parsed by a shell script to generate the assembly
  42. * language system call stubs. Don't add weird stuff between the markers.
  43. */
  44. /*CALLBEGIN*/
  45. // -- Process-related --
  46. #define SYS_fork 0
  47. #define SYS_vfork 1
  48. #define SYS_execv 2
  49. #define SYS__exit 3
  50. #define SYS_waitpid 4
  51. #define SYS_getpid 5
  52. #define SYS_getppid 6
  53. // (virtual memory)
  54. #define SYS_sbrk 7
  55. #define SYS_mmap 8
  56. #define SYS_munmap 9
  57. #define SYS_mprotect 10
  58. //#define SYS_madvise 11
  59. //#define SYS_mincore 12
  60. //#define SYS_mlock 13
  61. //#define SYS_munlock 14
  62. //#define SYS_munlockall 15
  63. //#define SYS_minherit 16
  64. // (security/credentials)
  65. #define SYS_umask 17
  66. #define SYS_issetugid 18
  67. #define SYS_getresuid 19
  68. #define SYS_setresuid 20
  69. #define SYS_getresgid 21
  70. #define SYS_setresgid 22
  71. #define SYS_getgroups 23
  72. #define SYS_setgroups 24
  73. #define SYS___getlogin 25
  74. #define SYS___setlogin 26
  75. // (signals)
  76. #define SYS_kill 27
  77. #define SYS_sigaction 28
  78. #define SYS_sigpending 29
  79. #define SYS_sigprocmask 30
  80. #define SYS_sigsuspend 31
  81. #define SYS_sigreturn 32
  82. //#define SYS_sigaltstack 33
  83. // (resource tracking and usage)
  84. //#define SYS_wait4 34
  85. //#define SYS_getrusage 35
  86. // (resource limits)
  87. //#define SYS_getrlimit 36
  88. //#define SYS_setrlimit 37
  89. // (process priority control)
  90. //#define SYS_getpriority 38
  91. //#define SYS_setpriority 39
  92. // (process groups, sessions, and job control)
  93. //#define SYS_getpgid 40
  94. //#define SYS_setpgid 41
  95. //#define SYS_getsid 42
  96. //#define SYS_setsid 43
  97. // (userlevel debugging)
  98. //#define SYS_ptrace 44
  99. // -- File-handle-related --
  100. #define SYS_open 45
  101. #define SYS_pipe 46
  102. #define SYS_dup 47
  103. #define SYS_dup2 48
  104. #define SYS_close 49
  105. #define SYS_read 50
  106. #define SYS_pread 51
  107. //#define SYS_readv 52
  108. //#define SYS_preadv 53
  109. #define SYS_getdirentry 54
  110. #define SYS_write 55
  111. #define SYS_pwrite 56
  112. //#define SYS_writev 57
  113. //#define SYS_pwritev 58
  114. #define SYS_lseek 59
  115. #define SYS_flock 60
  116. #define SYS_ftruncate 61
  117. #define SYS_fsync 62
  118. #define SYS_fcntl 63
  119. #define SYS_ioctl 64
  120. #define SYS_select 65
  121. #define SYS_poll 66
  122. // -- Pathname-related --
  123. #define SYS_link 67
  124. #define SYS_remove 68
  125. #define SYS_mkdir 69
  126. #define SYS_rmdir 70
  127. #define SYS_mkfifo 71
  128. #define SYS_rename 72
  129. #define SYS_access 73
  130. // (current directory)
  131. #define SYS_chdir 74
  132. #define SYS_fchdir 75
  133. #define SYS___getcwd 76
  134. // (symbolic links)
  135. #define SYS_symlink 77
  136. #define SYS_readlink 78
  137. // (mount)
  138. #define SYS_mount 79
  139. #define SYS_unmount 80
  140. // -- Any-file-related --
  141. #define SYS_stat 81
  142. #define SYS_fstat 82
  143. #define SYS_lstat 83
  144. // (timestamps)
  145. #define SYS_utimes 84
  146. #define SYS_futimes 85
  147. #define SYS_lutimes 86
  148. // (security/permissions)
  149. #define SYS_chmod 87
  150. #define SYS_chown 88
  151. #define SYS_fchmod 89
  152. #define SYS_fchown 90
  153. #define SYS_lchmod 91
  154. #define SYS_lchown 92
  155. // (file system info)
  156. //#define SYS_statfs 93
  157. //#define SYS_fstatfs 94
  158. //#define SYS_getfsstat 95
  159. // (POSIX dynamic system limits stuff)
  160. //#define SYS_pathconf 96
  161. //#define SYS_fpathconf 97
  162. // -- Sockets and networking --
  163. #define SYS_socket 98
  164. #define SYS_bind 99
  165. #define SYS_connect 100
  166. #define SYS_listen 101
  167. #define SYS_accept 102
  168. //#define SYS_socketpair 103
  169. #define SYS_shutdown 104
  170. #define SYS_getsockname 105
  171. #define SYS_getpeername 106
  172. #define SYS_getsockopt 107
  173. #define SYS_setsockopt 108
  174. //#define SYS_recvfrom 109
  175. //#define SYS_sendto 110
  176. //#define SYS_recvmsg 111
  177. //#define SYS_sendmsg 112
  178. // -- Time-related --
  179. #define SYS___time 113
  180. #define SYS___settime 114
  181. #define SYS_nanosleep 115
  182. //#define SYS_getitimer 116
  183. //#define SYS_setitimer 117
  184. // -- Other --
  185. #define SYS_sync 118
  186. #define SYS_reboot 119
  187. //#define SYS___sysctl 120
  188. /*CALLEND*/
  189. #endif /* _KERN_SYSCALL_H_ */