Home | History | Annotate | Download | only in vki
      1 
      2 /*--------------------------------------------------------------------*/
      3 /*--- System call numbers for Darwin.          vki-scnums-darwin.h ---*/
      4 /*--------------------------------------------------------------------*/
      5 
      6 /*
      7    This file is part of Valgrind, a dynamic binary instrumentation
      8    framework.
      9 
     10    Copyright (C) 2007-2013 Apple Inc.
     11       Greg Parker  gparker (at) apple.com
     12 
     13    This program is free software; you can redistribute it and/or
     14    modify it under the terms of the GNU General Public License as
     15    published by the Free Software Foundation; either version 2 of the
     16    License, or (at your option) any later version.
     17 
     18    This program is distributed in the hope that it will be useful, but
     19    WITHOUT ANY WARRANTY; without even the implied warranty of
     20    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     21    General Public License for more details.
     22 
     23    You should have received a copy of the GNU General Public License
     24    along with this program; if not, write to the Free Software
     25    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
     26    02111-1307, USA.
     27 
     28    The GNU General Public License is contained in the file COPYING.
     29 */
     30 
     31 #ifndef __VKI_SCNUMS_DARWIN_H
     32 #define __VKI_SCNUMS_DARWIN_H
     33 
     34 
     35 // need DARWIN_10_x definitions
     36 #include "config.h"
     37 
     38 // osfmk/mach/i386/syscall_sw.h
     39 
     40 // There are two syscall number encodings in Darwin.
     41 //
     42 // The 64-bit encoding is that the top 8-bits are the syscall class.  The low
     43 // 24 are the syscall number (index) within that class.
     44 //
     45 // The 32-bit encoding is that the syscall number (index) is stored as-is and
     46 // the syscall class is encoded as the argument to the 'int' instruction used
     47 // to trigger the syscall:
     48 // - 0x80: Unix
     49 // - 0x81: Mach
     50 // - 0x82: Machine-dependent
     51 // - 0x83: Diagnostic
     52 // Furthermore, just to make life interesting, for Mach traps the number is
     53 // negative.
     54 //
     55 // Within Valgrind we only use the 64-bit encoding -- on 32-bit systems, we
     56 // convert any syscall number to 64-bit encoding when we receive it, and
     57 // convert back with VG_DARWIN_SYSNO_FOR_KERNEL when passing any syscall
     58 // number back to the kernel (__NR_something shouldn't be passed directly to
     59 // the kernel).
     60 //
     61 // Hack: x86 `int $0x80` (unix, 64-bit result) are special.
     62 // [I haven't worked out why... --njn]
     63 
     64 #define VG_DARWIN_SYSCALL_CLASS_SHIFT     24
     65 #define VG_DARWIN_SYSCALL_CLASS_MASK      (0xFF << VG_DARWIN_SYSCALL_CLASS_SHIFT)
     66 #define VG_DARWIN_SYSCALL_NUMBER_MASK     (~VG_DARWIN_SYSCALL_CLASS_MASK)
     67 
     68 #define VG_DARWIN_SYSCALL_CLASS_NONE      0       /* Invalid */
     69 #define VG_DARWIN_SYSCALL_CLASS_MACH      1       /* Mach */
     70 #define VG_DARWIN_SYSCALL_CLASS_UNIX      2       /* Unix/BSD */
     71 #define VG_DARWIN_SYSCALL_CLASS_MDEP      3       /* Machine-dependent */
     72 #define VG_DARWIN_SYSCALL_CLASS_DIAG      4       /* Diagnostics */
     73 
     74 // Macros for encoding syscall numbers in the 64-bit encoding scheme.
     75 #define VG_DARWIN_SYSCALL_CONSTRUCT_MACH(syscall_number) \
     76     ((VG_DARWIN_SYSCALL_CLASS_MACH << VG_DARWIN_SYSCALL_CLASS_SHIFT) | \
     77      (VG_DARWIN_SYSCALL_NUMBER_MASK & (syscall_number)))
     78 
     79 #define VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(syscall_number) \
     80     ((VG_DARWIN_SYSCALL_CLASS_UNIX << VG_DARWIN_SYSCALL_CLASS_SHIFT) | \
     81      (VG_DARWIN_SYSCALL_NUMBER_MASK & (syscall_number)))
     82 
     83 #define VG_DARWIN_SYSCALL_CONSTRUCT_MDEP(syscall_number) \
     84     ((VG_DARWIN_SYSCALL_CLASS_MDEP << VG_DARWIN_SYSCALL_CLASS_SHIFT) | \
     85      (VG_DARWIN_SYSCALL_NUMBER_MASK & (syscall_number)))
     86 
     87 #define VG_DARWIN_SYSCALL_CONSTRUCT_DIAG(syscall_number) \
     88     ((VG_DARWIN_SYSCALL_CLASS_DIAG << VG_DARWIN_SYSCALL_CLASS_SHIFT) | \
     89      (VG_DARWIN_SYSCALL_NUMBER_MASK & (syscall_number)))
     90 
     91 
     92 /* Macros for decoding syscall numbers from the 64-bit encoding scheme. */
     93 #define VG_DARWIN_SYSNO_INDEX(sysno) ((sysno) & VG_DARWIN_SYSCALL_NUMBER_MASK)
     94 #define VG_DARWIN_SYSNO_CLASS(sysno) ((sysno) >> VG_DARWIN_SYSCALL_CLASS_SHIFT)
     95 
     96 
     97 /* Macros for converting syscall numbers to the form expected by the kernel.*/
     98 #if defined(VGA_x86)
     99    // This converts the 64-bit syscall number encoding, which we use
    100    // throughout Valgrind, into the 32-bit syscall number encoding, which is
    101    // suitable for passing to the (32-bit) kernel.
    102 #  define VG_DARWIN_SYSNO_FOR_KERNEL(sysno) \
    103     ((VG_DARWIN_SYSNO_CLASS(sysno) == VG_DARWIN_SYSCALL_CLASS_MACH) \
    104     ? -VG_DARWIN_SYSNO_INDEX(sysno) \
    105     :  VG_DARWIN_SYSNO_INDEX(sysno) \
    106     )
    107 
    108 #elif defined(VGA_amd64)
    109    // For 64-bit systems, we don't need to do anything to the syscall number.
    110 #  define VG_DARWIN_SYSNO_FOR_KERNEL(sysno) (sysno)
    111 
    112 #else
    113 #  error Unknown architecture
    114 #endif
    115 
    116 
    117 // mdep syscalls
    118 
    119 #if defined(VGA_x86)
    120 
    121 // osfmk/i386/machdep_call.c
    122 // DDD: the last two are BSD_CALL instead of CALL...
    123 //#define __NR_thread_get_cthread_self      VG_DARWIN_SYSCALL_CONSTRUCT_MDEP(0)
    124 //#define __NR_thread_set_cthread_self      VG_DARWIN_SYSCALL_CONSTRUCT_MDEP(1)
    125 // 2 is invalid
    126 #define __NR_thread_fast_set_cthread_self VG_DARWIN_SYSCALL_CONSTRUCT_MDEP(3)
    127 //#define __NR_thread_set_user_ldt          VG_DARWIN_SYSCALL_CONSTRUCT_MDEP(4)
    128 //#define __NR_i386_set_ldt                 VG_DARWIN_SYSCALL_CONSTRUCT_MDEP(5)
    129 //#define __NR_i386_get_ldt                 VG_DARWIN_SYSCALL_CONSTRUCT_MDEP(6)
    130 
    131 #elif defined(VGA_amd64)
    132 
    133 // osfmk/i386/machdep_call.c
    134 // 0, 1, 2 are invalid
    135 #define __NR_thread_fast_set_cthread_self VG_DARWIN_SYSCALL_CONSTRUCT_MDEP(3)
    136 // 4, 5, 6 are invalid
    137 
    138 #else
    139 #  error unknown architecture
    140 #endif
    141 
    142 
    143 // osfmk/mach/syscall_sw.h
    144 
    145 #define __NR_mach_reply_port                  VG_DARWIN_SYSCALL_CONSTRUCT_MACH(26)
    146 #define __NR_thread_self_trap                 VG_DARWIN_SYSCALL_CONSTRUCT_MACH(27)
    147 #define __NR_task_self_trap                   VG_DARWIN_SYSCALL_CONSTRUCT_MACH(28)
    148 #define __NR_host_self_trap                   VG_DARWIN_SYSCALL_CONSTRUCT_MACH(29)
    149 
    150 #define __NR_mach_msg_trap                    VG_DARWIN_SYSCALL_CONSTRUCT_MACH(31)
    151 #define __NR_mach_msg_overwrite_trap          VG_DARWIN_SYSCALL_CONSTRUCT_MACH(32)
    152 #define __NR_semaphore_signal_trap            VG_DARWIN_SYSCALL_CONSTRUCT_MACH(33)
    153 #define __NR_semaphore_signal_all_trap        VG_DARWIN_SYSCALL_CONSTRUCT_MACH(34)
    154 #define __NR_semaphore_signal_thread_trap     VG_DARWIN_SYSCALL_CONSTRUCT_MACH(35)
    155 #define __NR_semaphore_wait_trap              VG_DARWIN_SYSCALL_CONSTRUCT_MACH(36)
    156 #define __NR_semaphore_wait_signal_trap       VG_DARWIN_SYSCALL_CONSTRUCT_MACH(37)
    157 #define __NR_semaphore_timedwait_trap         VG_DARWIN_SYSCALL_CONSTRUCT_MACH(38)
    158 #define __NR_semaphore_timedwait_signal_trap  VG_DARWIN_SYSCALL_CONSTRUCT_MACH(39)
    159 
    160 #if defined(VGA_x86)
    161 #define __NR_init_process                     VG_DARWIN_SYSCALL_CONSTRUCT_MACH(41)
    162 #define __NR_map_fd                           VG_DARWIN_SYSCALL_CONSTRUCT_MACH(43)
    163 #endif
    164 
    165 #define __NR_task_name_for_pid                VG_DARWIN_SYSCALL_CONSTRUCT_MACH(44)
    166 #define __NR_task_for_pid                     VG_DARWIN_SYSCALL_CONSTRUCT_MACH(45)
    167 #define __NR_pid_for_task                     VG_DARWIN_SYSCALL_CONSTRUCT_MACH(46)
    168 
    169 #if defined(VGA_x86)
    170 #define __NR_macx_swapon                      VG_DARWIN_SYSCALL_CONSTRUCT_MACH(48)
    171 #define __NR_macx_swapoff                     VG_DARWIN_SYSCALL_CONSTRUCT_MACH(49)
    172 #define __NR_macx_triggers                    VG_DARWIN_SYSCALL_CONSTRUCT_MACH(51)
    173 #define __NR_macx_backing_store_suspend       VG_DARWIN_SYSCALL_CONSTRUCT_MACH(52)
    174 #define __NR_macx_backing_store_recovery      VG_DARWIN_SYSCALL_CONSTRUCT_MACH(53)
    175 #endif
    176 
    177 #define __NR_swtch_pri                        VG_DARWIN_SYSCALL_CONSTRUCT_MACH(59)
    178 #define __NR_swtch                            VG_DARWIN_SYSCALL_CONSTRUCT_MACH(60)
    179 #define __NR_sched_yield  __NR_swtch  /* linux-alike name */
    180 #define __NR_syscall_thread_switch            VG_DARWIN_SYSCALL_CONSTRUCT_MACH(61)
    181 #define __NR_clock_sleep_trap                 VG_DARWIN_SYSCALL_CONSTRUCT_MACH(62)
    182 
    183 #define __NR_mach_timebase_info               VG_DARWIN_SYSCALL_CONSTRUCT_MACH(89)
    184 #define __NR_mach_wait_until                  VG_DARWIN_SYSCALL_CONSTRUCT_MACH(90)
    185 #define __NR_mk_timer_create                  VG_DARWIN_SYSCALL_CONSTRUCT_MACH(91)
    186 #define __NR_mk_timer_destroy                 VG_DARWIN_SYSCALL_CONSTRUCT_MACH(92)
    187 #define __NR_mk_timer_arm                     VG_DARWIN_SYSCALL_CONSTRUCT_MACH(93)
    188 #define __NR_mk_timer_cancel                  VG_DARWIN_SYSCALL_CONSTRUCT_MACH(94)
    189 
    190 #define __NR_iokit_user_client_trap           VG_DARWIN_SYSCALL_CONSTRUCT_MACH(100)
    191 
    192 
    193 // bsd/sys/syscall.h
    194 
    195 #define	__NR_syscall        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(0)
    196 #define	__NR_exit           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(1)
    197 #define	__NR_fork           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(2) // was UX64
    198 #define	__NR_read           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(3)
    199 #define	__NR_write          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(4)
    200 #define	__NR_open           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(5)
    201 #define	__NR_close          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(6)
    202 #define	__NR_wait4          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(7)
    203 			/* 8  old creat */
    204 #define	__NR_link           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(9)
    205 #define	__NR_unlink         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(10)
    206 			/* 11  old execv */
    207 #define	__NR_chdir          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(12)
    208 #define	__NR_fchdir         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(13)
    209 #define	__NR_mknod          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(14)
    210 #define	__NR_chmod          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(15)
    211 #define	__NR_chown          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(16)
    212 			/* 17  old break */
    213 #define	__NR_getfsstat      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(18)
    214 			/* 19  old lseek */
    215 #define	__NR_getpid         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(20)
    216 			/* 21  old mount */
    217 			/* 22  old umount */
    218 #define	__NR_setuid         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(23)
    219 #define	__NR_getuid         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(24)
    220 #define	__NR_geteuid        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(25)
    221 #define	__NR_ptrace         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(26)
    222 #define	__NR_recvmsg        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(27)
    223 #define	__NR_sendmsg        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(28)
    224 #define	__NR_recvfrom       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(29)
    225 #define	__NR_accept         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(30)
    226 #define	__NR_getpeername    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(31)
    227 #define	__NR_getsockname    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(32)
    228 #define	__NR_access         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(33)
    229 #define	__NR_chflags        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(34)
    230 #define	__NR_fchflags       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(35)
    231 #define	__NR_sync           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(36)
    232 #define	__NR_kill           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(37)
    233 			/* 38  old stat */
    234 #define	__NR_getppid        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(39)
    235 			/* 40  old lstat */
    236 #define	__NR_dup            VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(41)
    237 #define	__NR_pipe           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(42) // was UX64
    238 #define	__NR_getegid        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(43)
    239 #define	__NR_profil         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(44)
    240 			/* 45  old ktrace */
    241 #define	__NR_sigaction      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(46)
    242 #define	__NR_getgid         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(47)
    243 #define	__NR_sigprocmask    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(48)
    244 #define	__NR_getlogin       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(49)
    245 #define	__NR_setlogin       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(50)
    246 #define	__NR_acct           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(51)
    247 #define	__NR_sigpending     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(52)
    248 #define	__NR_sigaltstack    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(53)
    249 #define	__NR_ioctl          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(54)
    250 #define	__NR_reboot         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(55)
    251 #define	__NR_revoke         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(56)
    252 #define	__NR_symlink        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(57)
    253 #define	__NR_readlink       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(58)
    254 #define	__NR_execve         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(59)
    255 #define	__NR_umask          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(60)
    256 #define	__NR_chroot         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(61)
    257 			/* 62  old fstat */
    258 			/* 63  used internally , reserved */
    259 			/* 64  old getpagesize */
    260 #define	__NR_msync          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(65)
    261 #define	__NR_vfork          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(66)
    262 			/* 67  old vread */
    263 			/* 68  old vwrite */
    264 			/* 69  old sbrk */
    265 			/* 70  old sstk */
    266 			/* 71  old mmap */
    267 			/* 72  old vadvise */
    268 #define	__NR_munmap         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(73)
    269 #define	__NR_mprotect       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(74)
    270 #define	__NR_madvise        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(75)
    271 			/* 76  old vhangup */
    272 			/* 77  old vlimit */
    273 #define	__NR_mincore        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(78)
    274 #define	__NR_getgroups      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(79)
    275 #define	__NR_setgroups      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(80)
    276 #define	__NR_getpgrp        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(81)
    277 #define	__NR_setpgid        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(82)
    278 #define	__NR_setitimer      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(83)
    279 			/* 84  old wait */
    280 #define	__NR_swapon         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(85)
    281 #define	__NR_getitimer      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(86)
    282 			/* 87  old gethostname */
    283 			/* 88  old sethostname */
    284 #define	__NR_getdtablesize  VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(89)
    285 #define	__NR_dup2           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(90)
    286 			/* 91  old getdopt */
    287 #define	__NR_fcntl          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(92)
    288 #define	__NR_select         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(93)
    289 			/* 94  old setdopt */
    290 #define	__NR_fsync          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(95)
    291 #define	__NR_setpriority    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(96)
    292 #define	__NR_socket         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(97)
    293 #define	__NR_connect        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(98)
    294 			/* 99  old accept */
    295 #define	__NR_getpriority    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(100)
    296 			/* 101  old send */
    297 			/* 102  old recv */
    298 			/* 103  old sigreturn */
    299 #define	__NR_bind           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(104)
    300 #define	__NR_setsockopt     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(105)
    301 #define	__NR_listen         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(106)
    302 			/* 107  old vtimes */
    303 			/* 108  old sigvec */
    304 			/* 109  old sigblock */
    305 			/* 110  old sigsetmask */
    306 #define	__NR_sigsuspend     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(111)
    307 			/* 112  old sigstack */
    308 			/* 113  old recvmsg */
    309 			/* 114  old sendmsg */
    310 			/* 115  old vtrace */
    311 #define	__NR_gettimeofday   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(116)
    312 #define	__NR_getrusage      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(117)
    313 #define	__NR_getsockopt     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(118)
    314 			/* 119  old resuba */
    315 #define	__NR_readv          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(120)
    316 #define	__NR_writev         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(121)
    317 #define	__NR_settimeofday   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(122)
    318 #define	__NR_fchown         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(123)
    319 #define	__NR_fchmod         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(124)
    320 			/* 125  old recvfrom */
    321 #define	__NR_setreuid       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(126)
    322 #define	__NR_setregid       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(127)
    323 #define	__NR_rename         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(128)
    324 			/* 129  old truncate */
    325 			/* 130  old ftruncate */
    326 #define	__NR_flock          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(131)
    327 #define	__NR_mkfifo         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(132)
    328 #define	__NR_sendto         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(133)
    329 #define	__NR_shutdown       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(134)
    330 #define	__NR_socketpair     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(135)
    331 #define	__NR_mkdir          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(136)
    332 #define	__NR_rmdir          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(137)
    333 #define	__NR_utimes         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(138)
    334 #define	__NR_futimes        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(139)
    335 #define	__NR_adjtime        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(140)
    336 			/* 141  old getpeername */
    337 #define __NR_gethostuuid    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(142)
    338 			/* 143  old sethostid */
    339 			/* 144  old getrlimit */
    340 			/* 145  old setrlimit */
    341 			/* 146  old killpg */
    342 #define	__NR_setsid         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(147)
    343 			/* 148  old setquota */
    344 			/* 149  old qquota */
    345 			/* 150  old getsockname */
    346 #define	__NR_getpgid        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(151)
    347 #define	__NR_setprivexec    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(152)
    348 #define	__NR_pread          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(153)
    349 #define	__NR_pwrite         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(154)
    350 #define __NR_nfssvc         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(155)
    351 			/* 156  old getdirentries */
    352 #define	__NR_statfs         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(157)
    353 #define	__NR_fstatfs        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(158)
    354 #define	__NR_unmount        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(159)
    355 			/* 160  old async_daemon */
    356 #define __NR_getfh          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(161)
    357 			/* 162  old getdomainname */
    358 			/* 163  old setdomainname */
    359 			/* 164  */
    360 #define	__NR_quotactl       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(165)
    361 			/* 166  old exportfs */
    362 #define	__NR_mount          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(167)
    363 			/* 168  old ustat */
    364 #define __NR_csops          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(169)
    365 			/* 170  old table */
    366 			/* 171  old wait3 */
    367 			/* 172  old rpause */
    368 #define	__NR_waitid         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(173)
    369 			/* 174  old getdents */
    370 			/* 175  old gc_control */
    371 #define	__NR_add_profil     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(176)
    372 			/* 177  */
    373 			/* 178  */
    374 			/* 179  */
    375 #define	__NR_kdebug_trace   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(180)
    376 #define	__NR_setgid         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(181)
    377 #define	__NR_setegid        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(182)
    378 #define	__NR_seteuid        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(183)
    379 #define __NR_sigreturn      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(184)
    380 #define __NR_chud           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(185)
    381 			/* 186  */
    382 #if DARWIN_VERS >= DARWIN_10_6
    383 #define __NR_fdatasync      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(187)
    384 #else
    385 			/* 187  */
    386 #endif
    387 #define	__NR_stat           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(188)
    388 #define	__NR_fstat          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(189)
    389 #define	__NR_lstat          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(190)
    390 #define	__NR_pathconf       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(191)
    391 #define	__NR_fpathconf      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(192)
    392 			/* 193 */
    393 #define	__NR_getrlimit      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(194)
    394 #define	__NR_setrlimit      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(195)
    395 #define	__NR_getdirentries  VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(196)
    396 #define	__NR_mmap           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(197)
    397 			/* 198  __syscall */
    398 #define	__NR_lseek          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(199) // was UX64
    399 #define	__NR_truncate       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(200)
    400 #define	__NR_ftruncate      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(201)
    401 #define	__NR___sysctl       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(202)
    402 #define	__NR_mlock          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(203)
    403 #define	__NR_munlock        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(204)
    404 #define	__NR_undelete       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(205)
    405 #define	__NR_ATsocket       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(206)
    406 #define	__NR_ATgetmsg       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(207)
    407 #define	__NR_ATputmsg       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(208)
    408 #define	__NR_ATPsndreq      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(209)
    409 #define	__NR_ATPsndrsp      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(210)
    410 #define	__NR_ATPgetreq      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(211)
    411 #define	__NR_ATPgetrsp      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(212)
    412 			/* 213  Reserved for AppleTalk */
    413 #if DARWIN_VERS >= DARWIN_10_6
    414                         /* 214  old kqueue_from_portset_np*/
    415                         /* 215  old kqueue_portset_np*/
    416 #else
    417 #define __NR_kqueue_from_portset_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(214)
    418 #define __NR_kqueue_portset_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(215)
    419 #endif
    420 #define	__NR_mkcomplex      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(216)
    421 #define	__NR_statv          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(217)
    422 #define	__NR_lstatv         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(218)
    423 #define	__NR_fstatv         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(219)
    424 #define	__NR_getattrlist    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(220)
    425 #define	__NR_setattrlist    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(221)
    426 #define	__NR_getdirentriesattr VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(222)
    427 #define	__NR_exchangedata   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(223)
    428 			/* 224  old checkuseraccess */
    429 #define	__NR_searchfs       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(225)
    430 #define	__NR_delete         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(226)
    431 #define	__NR_copyfile       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(227)
    432 #if DARWIN_VERS >= DARWIN_10_6
    433 #define __NR_fgetattrlist   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(228)
    434 #define __NR_fsetattrlist   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(229)
    435 #else
    436 			/* 228  */
    437 			/* 229  */
    438 #endif
    439 #define	__NR_poll           VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(230)
    440 #define	__NR_watchevent     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(231)
    441 #define	__NR_waitevent      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(232)
    442 #define	__NR_modwatch       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(233)
    443 #define	__NR_getxattr       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(234)
    444 #define	__NR_fgetxattr      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(235)
    445 #define	__NR_setxattr       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(236)
    446 #define	__NR_fsetxattr      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(237)
    447 #define	__NR_removexattr    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(238)
    448 #define	__NR_fremovexattr   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(239)
    449 #define	__NR_listxattr      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(240)
    450 #define	__NR_flistxattr     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(241)
    451 #define	__NR_fsctl          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(242)
    452 #define	__NR_initgroups     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(243)
    453 #define __NR_posix_spawn    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(244)
    454 #if DARWIN_VERS >= DARWIN_10_6
    455 #define __NR_ffsctl         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(245)
    456 #else
    457 			/* 245  */
    458 #endif
    459 			/* 246  */
    460 #define __NR_nfsclnt        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(247)
    461 #define __NR_fhopen         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(248)
    462 			/* 249  */
    463 #define	__NR_minherit       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(250)
    464 #define	__NR_semsys         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(251)
    465 #define	__NR_msgsys         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(252)
    466 #define	__NR_shmsys         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(253)
    467 #define	__NR_semctl         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(254)
    468 #define	__NR_semget         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(255)
    469 #define	__NR_semop          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(256)
    470 			/* 257  */
    471 #define	__NR_msgctl         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(258)
    472 #define	__NR_msgget         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(259)
    473 #define	__NR_msgsnd         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(260)
    474 #define	__NR_msgrcv         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(261)
    475 #define	__NR_shmat          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(262)
    476 #define	__NR_shmctl         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(263)
    477 #define	__NR_shmdt          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(264)
    478 #define	__NR_shmget         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(265)
    479 #define	__NR_shm_open       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(266)
    480 #define	__NR_shm_unlink     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(267)
    481 #define	__NR_sem_open       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(268)
    482 #define	__NR_sem_close      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(269)
    483 #define	__NR_sem_unlink     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(270)
    484 #define	__NR_sem_wait       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(271)
    485 #define	__NR_sem_trywait    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(272)
    486 #define	__NR_sem_post       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(273)
    487 #define	__NR_sem_getvalue   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(274)
    488 #define	__NR_sem_init       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(275)
    489 #define	__NR_sem_destroy    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(276)
    490 #define	__NR_open_extended  VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(277)
    491 #define	__NR_umask_extended VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(278)
    492 #define	__NR_stat_extended  VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(279)
    493 #define	__NR_lstat_extended VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(280)
    494 #define	__NR_fstat_extended VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(281)
    495 #define	__NR_chmod_extended VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(282)
    496 #define	__NR_fchmod_extended VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(283)
    497 #define	__NR_access_extended VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(284)
    498 #define	__NR_settid         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(285)
    499 #define	__NR_gettid         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(286)
    500 #define	__NR_setsgroups     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(287)
    501 #define	__NR_getsgroups     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(288)
    502 #define	__NR_setwgroups     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(289)
    503 #define	__NR_getwgroups     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(290)
    504 #define	__NR_mkfifo_extended VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(291)
    505 #define	__NR_mkdir_extended VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(292)
    506 #define	__NR_identitysvc    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(293)
    507 #define	__NR_shared_region_check_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(294)
    508 #define	__NR_shared_region_map_np   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(295)
    509 #if DARWIN_VERS >= DARWIN_10_6
    510 #define __NR_vm_pressure_monitor    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(296)
    511 #else
    512 			/* 296  old load_shared_file */
    513 #endif
    514 			/* 297  old reset_shared_file */
    515 			/* 298  old new_system_shared_regions */
    516 			/* 299  old shared_region_map_file_np */
    517 			/* 300  old shared_region_make_private_np */
    518 #define __NR_psynch_mutexwait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(301)
    519 #define __NR_psynch_mutexdrop VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(302)
    520 #define __NR_psynch_cvbroad   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(303)
    521 #define __NR_psynch_cvsignal  VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(304)
    522 #define __NR_psynch_cvwait    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(305)
    523 #define __NR_psynch_rw_rdlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(306)
    524 #define __NR_psynch_rw_wrlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(307)
    525 #define __NR_psynch_rw_unlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(308)
    526 			/* 309 */
    527 #define	__NR_getsid         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(310)
    528 #define	__NR_settid_with_pid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(311)
    529 #define __NR_psynch_cvclrprepost VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(312)
    530 #define	__NR_aio_fsync      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(313)
    531 #define	__NR_aio_return     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(314)
    532 #define	__NR_aio_suspend    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(315)
    533 #define	__NR_aio_cancel     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(316)
    534 #define	__NR_aio_error      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(317)
    535 #define	__NR_aio_read       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(318)
    536 #define	__NR_aio_write      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(319)
    537 #define	__NR_lio_listio     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(320)
    538 			/* 321 */
    539 #define __NR_iopolicysys    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(322)
    540 			/* 323  */
    541 #define	__NR_mlockall       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(324)
    542 #define	__NR_munlockall     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(325)
    543 			/* 326  */
    544 #define	__NR_issetugid      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(327)
    545 #define	__NR___pthread_kill VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(328)
    546 #define	__NR___pthread_sigmask VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(329)
    547 #define	__NR___sigwait        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(330)
    548 #define	__NR___disable_threadsignal VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(331)
    549 #define	__NR___pthread_markcancel VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(332)
    550 #define	__NR___pthread_canceled VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(333)
    551 #define	__NR___semwait_signal VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(334)
    552 			/* 335  old utrace */
    553 #define __NR_proc_info      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(336)
    554 #define __NR_sendfile       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(337)
    555 #define __NR_stat64         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(338)
    556 #define __NR_fstat64        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(339)
    557 #define __NR_lstat64        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(340)
    558 #define __NR_stat64_extended VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(341)
    559 #define __NR_lstat64_extended VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(342)
    560 #define __NR_fstat64_extended VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(343)
    561 #define __NR_getdirentries64 VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(344)
    562 #define __NR_statfs64       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(345)
    563 #define __NR_fstatfs64      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(346)
    564 #define __NR_getfsstat64    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(347)
    565 #define __NR___pthread_chdir VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(348)
    566 #define __NR___pthread_fchdir VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(349)
    567 
    568 #define	__NR_audit          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(350)
    569 #define	__NR_auditon        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(351)
    570 			/* 352  */
    571 #define	__NR_getauid        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(353)
    572 #define	__NR_setauid        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(354)
    573 #define	__NR_getaudit       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(355)
    574 #define	__NR_setaudit       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(356)
    575 #define	__NR_getaudit_addr  VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(357)
    576 #define	__NR_setaudit_addr  VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(358)
    577 #define	__NR_auditctl       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(359)
    578 #define	__NR_bsdthread_create VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(360)
    579 #define	__NR_bsdthread_terminate VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(361)
    580 #define	__NR_kqueue         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(362)
    581 #define	__NR_kevent         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(363)
    582 #define	__NR_lchown         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(364)
    583 #define __NR_stack_snapshot VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(365)
    584 #define __NR_bsdthread_register VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(366)
    585 #define __NR_workq_open     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(367)
    586 #define __NR_workq_ops      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(368)
    587 #if DARWIN_VERS >= DARWIN_10_6
    588 #define __NR_kevent64       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(369)
    589 #else
    590 			/* 369  */
    591 #endif
    592 			/* 370  */
    593 			/* 371  */
    594 #if DARWIN_VERS >= DARWIN_10_6
    595 #define __NR___thread_selfid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(372)  // was UX64
    596 #else
    597 			/* 372  */
    598 #endif
    599 			/* 373  */
    600 			/* 374  */
    601 			/* 375  */
    602 			/* 376  */
    603 			/* 377  */
    604 			/* 378  */
    605 			/* 379  */
    606 #define __NR___mac_execve   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(380)
    607 #define __NR___mac_syscall  VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(381)
    608 #define __NR___mac_get_file VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(382)
    609 #define __NR___mac_set_file VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(383)
    610 #define __NR___mac_get_link VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(384)
    611 #define __NR___mac_set_link VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(385)
    612 #define __NR___mac_get_proc VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(386)
    613 #define __NR___mac_set_proc VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(387)
    614 #define __NR___mac_get_fd   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(388)
    615 #define __NR___mac_set_fd   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(389)
    616 #define __NR___mac_get_pid  VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(390)
    617 #define __NR___mac_get_lcid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(391)
    618 #define __NR___mac_get_lctx VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(392)
    619 #define __NR___mac_set_lctx VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(393)
    620 #define __NR_setlcid        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(394)
    621 #define __NR_getlcid        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(395)
    622 #define __NR_read_nocancel          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(396)
    623 #define __NR_write_nocancel         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(397)
    624 #define __NR_open_nocancel          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(398)
    625 #define __NR_close_nocancel         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(399)
    626 #define __NR_wait4_nocancel         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(400)
    627 #define __NR_recvmsg_nocancel       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(401)
    628 #define __NR_sendmsg_nocancel       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(402)
    629 #define __NR_recvfrom_nocancel      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(403)
    630 #define __NR_accept_nocancel        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(404)
    631 #define __NR_msync_nocancel         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(405)
    632 #define __NR_fcntl_nocancel         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(406)
    633 #define __NR_select_nocancel        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(407)
    634 #define __NR_fsync_nocancel         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(408)
    635 #define __NR_connect_nocancel       VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(409)
    636 #define __NR_sigsuspend_nocancel    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(410)
    637 #define __NR_readv_nocancel         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(411)
    638 #define __NR_writev_nocancel        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(412)
    639 #define __NR_sendto_nocancel        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(413)
    640 #define __NR_pread_nocancel         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(414)
    641 #define __NR_pwrite_nocancel        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(415)
    642 #define __NR_waitid_nocancel        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(416)
    643 #define __NR_poll_nocancel          VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(417)
    644 #define __NR_msgsnd_nocancel        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(418)
    645 #define __NR_msgrcv_nocancel        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(419)
    646 #define __NR_sem_wait_nocancel      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(420)
    647 #define __NR_aio_suspend_nocancel   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(421)
    648 #define __NR___sigwait_nocancel     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(422)
    649 #define __NR___semwait_signal_nocancel VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(423)
    650 #define __NR___mac_mount            VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(424)
    651 #define __NR___mac_get_mount        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(425)
    652 #define __NR___mac_getfsstat        VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(426)
    653 #if DARWIN_VERS >= DARWIN_10_6
    654 #define __NR_fsgetpath              VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(427)
    655 #define __NR_audit_session_self     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(428)
    656 #define __NR_audit_session_join     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(429)
    657 #endif
    658 
    659 #if DARWIN_VERS < DARWIN_10_6
    660 #define	__NR_MAXSYSCALL             VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(427)
    661 #elif DARWIN_VERSION < DARWIN_10_7
    662 #define	__NR_MAXSYSCALL             VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(430)
    663 #else
    664 #error unknown darwin version
    665 #endif
    666 
    667 #define __NR_DARWIN_FAKE_SIGRETURN (1 + __NR_MAXSYSCALL)
    668 
    669 #endif
    670