2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
8 * NaCl kernel / service run-time system call numbers
11 #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_BITS_NACL_SYSCALLS_H_
12 #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_BITS_NACL_SYSCALLS_H_
14 /* intentionally not using zero */
17 * TODO(bsy,sehr): these identifiers should be NACL_ABI_SYS_<name>.
20 #define NACL_sys_null 1
21 #define NACL_sys_nameservice 2
23 #define NACL_sys_dup 8
24 #define NACL_sys_dup2 9
25 #define NACL_sys_open 10
26 #define NACL_sys_close 11
27 #define NACL_sys_read 12
28 #define NACL_sys_write 13
29 #define NACL_sys_lseek 14
30 /* 15 used to be ioctl */
31 #define NACL_sys_stat 16
32 #define NACL_sys_fstat 17
33 #define NACL_sys_chmod 18
34 #define NACL_sys_isatty 19
35 /* no fchmod emulation on windows */
37 #define NACL_sys_brk 20
38 #define NACL_sys_mmap 21
39 #define NACL_sys_munmap 22
41 #define NACL_sys_getdents 23
43 #define NACL_sys_mprotect 24
45 #define NACL_sys_list_mappings 25
47 #define NACL_sys_exit 30
48 #define NACL_sys_getpid 31
49 #define NACL_sys_sched_yield 32
50 #define NACL_sys_sysconf 33
52 #define NACL_sys_gettimeofday 40
53 #define NACL_sys_clock 41
54 #define NACL_sys_nanosleep 42
55 #define NACL_sys_clock_getres 43
56 #define NACL_sys_clock_gettime 44
58 #define NACL_sys_mkdir 45
59 #define NACL_sys_rmdir 46
60 #define NACL_sys_chdir 47
61 #define NACL_sys_getcwd 48
62 #define NACL_sys_unlink 49
64 /* 50-58 previously used for multimedia syscalls */
66 #define NACL_sys_imc_makeboundsock 60
67 #define NACL_sys_imc_accept 61
68 #define NACL_sys_imc_connect 62
69 #define NACL_sys_imc_sendmsg 63
70 #define NACL_sys_imc_recvmsg 64
71 #define NACL_sys_imc_mem_obj_create 65
72 #define NACL_sys_imc_socketpair 66
74 #define NACL_sys_mutex_create 70
75 #define NACL_sys_mutex_lock 71
76 #define NACL_sys_mutex_trylock 72
77 #define NACL_sys_mutex_unlock 73
78 #define NACL_sys_cond_create 74
79 #define NACL_sys_cond_wait 75
80 #define NACL_sys_cond_signal 76
81 #define NACL_sys_cond_broadcast 77
82 #define NACL_sys_cond_timed_wait_abs 79
84 #define NACL_sys_thread_create 80
85 #define NACL_sys_thread_exit 81
86 #define NACL_sys_tls_init 82
87 #define NACL_sys_thread_nice 83
88 #define NACL_sys_tls_get 84
89 #define NACL_sys_second_tls_set 85
90 #define NACL_sys_second_tls_get 86
91 #define NACL_sys_exception_handler 87
92 #define NACL_sys_exception_stack 88
93 #define NACL_sys_exception_clear_flag 89
95 #define NACL_sys_sem_create 100
96 #define NACL_sys_sem_wait 101
97 #define NACL_sys_sem_post 102
98 #define NACL_sys_sem_get_value 103
100 #define NACL_sys_dyncode_create 104
101 #define NACL_sys_dyncode_modify 105
102 #define NACL_sys_dyncode_delete 106
104 #define NACL_sys_test_infoleak 109
105 #define NACL_sys_test_crash 110
108 * These syscall numbers are set aside for use in tests that add
109 * syscalls that must coexist with the normal syscalls.
111 #define NACL_sys_test_syscall_1 111
112 #define NACL_sys_test_syscall_2 112
114 #define NACL_sys_futex_wait_abs 120
115 #define NACL_sys_futex_wake 121
117 #define NACL_sys_pread 130
118 #define NACL_sys_pwrite 131
120 #define NACL_sys_truncate 140
121 #define NACL_sys_lstat 141
122 #define NACL_sys_link 142
123 #define NACL_sys_rename 143
124 #define NACL_sys_symlink 144
125 #define NACL_sys_access 145
126 #define NACL_sys_readlink 146
127 #define NACL_sys_utimes 147
129 #define NACL_MAX_SYSCALLS 148