syscall_darwin.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. // Copyright 2009,2010 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Darwin system calls.
  5. // This file is compiled as ordinary Go code,
  6. // but it is also input to mksyscall,
  7. // which parses the //sys lines and generates system call stubs.
  8. // Note that sometimes we use a lowercase //sys name and wrap
  9. // it in our own nicer implementation, either here or in
  10. // syscall_bsd.go or syscall_unix.go.
  11. package unix
  12. import (
  13. "errors"
  14. "syscall"
  15. "unsafe"
  16. )
  17. const ImplementsGetwd = true
  18. func Getwd() (string, error) {
  19. buf := make([]byte, 2048)
  20. attrs, err := getAttrList(".", attrList{CommonAttr: attrCmnFullpath}, buf, 0)
  21. if err == nil && len(attrs) == 1 && len(attrs[0]) >= 2 {
  22. wd := string(attrs[0])
  23. // Sanity check that it's an absolute path and ends
  24. // in a null byte, which we then strip.
  25. if wd[0] == '/' && wd[len(wd)-1] == 0 {
  26. return wd[:len(wd)-1], nil
  27. }
  28. }
  29. // If pkg/os/getwd.go gets ENOTSUP, it will fall back to the
  30. // slow algorithm.
  31. return "", ENOTSUP
  32. }
  33. // SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
  34. type SockaddrDatalink struct {
  35. Len uint8
  36. Family uint8
  37. Index uint16
  38. Type uint8
  39. Nlen uint8
  40. Alen uint8
  41. Slen uint8
  42. Data [12]int8
  43. raw RawSockaddrDatalink
  44. }
  45. // Translate "kern.hostname" to []_C_int{0,1,2,3}.
  46. func nametomib(name string) (mib []_C_int, err error) {
  47. const siz = unsafe.Sizeof(mib[0])
  48. // NOTE(rsc): It seems strange to set the buffer to have
  49. // size CTL_MAXNAME+2 but use only CTL_MAXNAME
  50. // as the size. I don't know why the +2 is here, but the
  51. // kernel uses +2 for its own implementation of this function.
  52. // I am scared that if we don't include the +2 here, the kernel
  53. // will silently write 2 words farther than we specify
  54. // and we'll get memory corruption.
  55. var buf [CTL_MAXNAME + 2]_C_int
  56. n := uintptr(CTL_MAXNAME) * siz
  57. p := (*byte)(unsafe.Pointer(&buf[0]))
  58. bytes, err := ByteSliceFromString(name)
  59. if err != nil {
  60. return nil, err
  61. }
  62. // Magic sysctl: "setting" 0.3 to a string name
  63. // lets you read back the array of integers form.
  64. if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {
  65. return nil, err
  66. }
  67. return buf[0 : n/siz], nil
  68. }
  69. //sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
  70. func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) }
  71. func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) }
  72. const (
  73. attrBitMapCount = 5
  74. attrCmnFullpath = 0x08000000
  75. )
  76. type attrList struct {
  77. bitmapCount uint16
  78. _ uint16
  79. CommonAttr uint32
  80. VolAttr uint32
  81. DirAttr uint32
  82. FileAttr uint32
  83. Forkattr uint32
  84. }
  85. func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (attrs [][]byte, err error) {
  86. if len(attrBuf) < 4 {
  87. return nil, errors.New("attrBuf too small")
  88. }
  89. attrList.bitmapCount = attrBitMapCount
  90. var _p0 *byte
  91. _p0, err = BytePtrFromString(path)
  92. if err != nil {
  93. return nil, err
  94. }
  95. if err := getattrlist(_p0, unsafe.Pointer(&attrList), unsafe.Pointer(&attrBuf[0]), uintptr(len(attrBuf)), int(options)); err != nil {
  96. return nil, err
  97. }
  98. size := *(*uint32)(unsafe.Pointer(&attrBuf[0]))
  99. // dat is the section of attrBuf that contains valid data,
  100. // without the 4 byte length header. All attribute offsets
  101. // are relative to dat.
  102. dat := attrBuf
  103. if int(size) < len(attrBuf) {
  104. dat = dat[:size]
  105. }
  106. dat = dat[4:] // remove length prefix
  107. for i := uint32(0); int(i) < len(dat); {
  108. header := dat[i:]
  109. if len(header) < 8 {
  110. return attrs, errors.New("truncated attribute header")
  111. }
  112. datOff := *(*int32)(unsafe.Pointer(&header[0]))
  113. attrLen := *(*uint32)(unsafe.Pointer(&header[4]))
  114. if datOff < 0 || uint32(datOff)+attrLen > uint32(len(dat)) {
  115. return attrs, errors.New("truncated results; attrBuf too small")
  116. }
  117. end := uint32(datOff) + attrLen
  118. attrs = append(attrs, dat[datOff:end])
  119. i = end
  120. if r := i % 4; r != 0 {
  121. i += (4 - r)
  122. }
  123. }
  124. return
  125. }
  126. //sys getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error)
  127. //sysnb pipe() (r int, w int, err error)
  128. func Pipe(p []int) (err error) {
  129. if len(p) != 2 {
  130. return EINVAL
  131. }
  132. p[0], p[1], err = pipe()
  133. return
  134. }
  135. func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
  136. var _p0 unsafe.Pointer
  137. var bufsize uintptr
  138. if len(buf) > 0 {
  139. _p0 = unsafe.Pointer(&buf[0])
  140. bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
  141. }
  142. return getfsstat(_p0, bufsize, flags)
  143. }
  144. func xattrPointer(dest []byte) *byte {
  145. // It's only when dest is set to NULL that the OS X implementations of
  146. // getxattr() and listxattr() return the current sizes of the named attributes.
  147. // An empty byte array is not sufficient. To maintain the same behaviour as the
  148. // linux implementation, we wrap around the system calls and pass in NULL when
  149. // dest is empty.
  150. var destp *byte
  151. if len(dest) > 0 {
  152. destp = &dest[0]
  153. }
  154. return destp
  155. }
  156. //sys getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error)
  157. func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
  158. return getxattr(path, attr, xattrPointer(dest), len(dest), 0, 0)
  159. }
  160. func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) {
  161. return getxattr(link, attr, xattrPointer(dest), len(dest), 0, XATTR_NOFOLLOW)
  162. }
  163. //sys fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error)
  164. func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) {
  165. return fgetxattr(fd, attr, xattrPointer(dest), len(dest), 0, 0)
  166. }
  167. //sys setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error)
  168. func Setxattr(path string, attr string, data []byte, flags int) (err error) {
  169. // The parameters for the OS X implementation vary slightly compared to the
  170. // linux system call, specifically the position parameter:
  171. //
  172. // linux:
  173. // int setxattr(
  174. // const char *path,
  175. // const char *name,
  176. // const void *value,
  177. // size_t size,
  178. // int flags
  179. // );
  180. //
  181. // darwin:
  182. // int setxattr(
  183. // const char *path,
  184. // const char *name,
  185. // void *value,
  186. // size_t size,
  187. // u_int32_t position,
  188. // int options
  189. // );
  190. //
  191. // position specifies the offset within the extended attribute. In the
  192. // current implementation, only the resource fork extended attribute makes
  193. // use of this argument. For all others, position is reserved. We simply
  194. // default to setting it to zero.
  195. return setxattr(path, attr, xattrPointer(data), len(data), 0, flags)
  196. }
  197. func Lsetxattr(link string, attr string, data []byte, flags int) (err error) {
  198. return setxattr(link, attr, xattrPointer(data), len(data), 0, flags|XATTR_NOFOLLOW)
  199. }
  200. //sys fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error)
  201. func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) {
  202. return fsetxattr(fd, attr, xattrPointer(data), len(data), 0, 0)
  203. }
  204. //sys removexattr(path string, attr string, options int) (err error)
  205. func Removexattr(path string, attr string) (err error) {
  206. // We wrap around and explicitly zero out the options provided to the OS X
  207. // implementation of removexattr, we do so for interoperability with the
  208. // linux variant.
  209. return removexattr(path, attr, 0)
  210. }
  211. func Lremovexattr(link string, attr string) (err error) {
  212. return removexattr(link, attr, XATTR_NOFOLLOW)
  213. }
  214. //sys fremovexattr(fd int, attr string, options int) (err error)
  215. func Fremovexattr(fd int, attr string) (err error) {
  216. return fremovexattr(fd, attr, 0)
  217. }
  218. //sys listxattr(path string, dest *byte, size int, options int) (sz int, err error)
  219. func Listxattr(path string, dest []byte) (sz int, err error) {
  220. return listxattr(path, xattrPointer(dest), len(dest), 0)
  221. }
  222. func Llistxattr(link string, dest []byte) (sz int, err error) {
  223. return listxattr(link, xattrPointer(dest), len(dest), XATTR_NOFOLLOW)
  224. }
  225. //sys flistxattr(fd int, dest *byte, size int, options int) (sz int, err error)
  226. func Flistxattr(fd int, dest []byte) (sz int, err error) {
  227. return flistxattr(fd, xattrPointer(dest), len(dest), 0)
  228. }
  229. func setattrlistTimes(path string, times []Timespec, flags int) error {
  230. _p0, err := BytePtrFromString(path)
  231. if err != nil {
  232. return err
  233. }
  234. var attrList attrList
  235. attrList.bitmapCount = ATTR_BIT_MAP_COUNT
  236. attrList.CommonAttr = ATTR_CMN_MODTIME | ATTR_CMN_ACCTIME
  237. // order is mtime, atime: the opposite of Chtimes
  238. attributes := [2]Timespec{times[1], times[0]}
  239. options := 0
  240. if flags&AT_SYMLINK_NOFOLLOW != 0 {
  241. options |= FSOPT_NOFOLLOW
  242. }
  243. return setattrlist(
  244. _p0,
  245. unsafe.Pointer(&attrList),
  246. unsafe.Pointer(&attributes),
  247. unsafe.Sizeof(attributes),
  248. options)
  249. }
  250. //sys setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error)
  251. func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error {
  252. // Darwin doesn't support SYS_UTIMENSAT
  253. return ENOSYS
  254. }
  255. /*
  256. * Wrapped
  257. */
  258. //sys kill(pid int, signum int, posix int) (err error)
  259. func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) }
  260. //sys ioctl(fd int, req uint, arg uintptr) (err error)
  261. // ioctl itself should not be exposed directly, but additional get/set
  262. // functions for specific types are permissible.
  263. // IoctlSetInt performs an ioctl operation which sets an integer value
  264. // on fd, using the specified request number.
  265. func IoctlSetInt(fd int, req uint, value int) error {
  266. return ioctl(fd, req, uintptr(value))
  267. }
  268. func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
  269. return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
  270. }
  271. func ioctlSetTermios(fd int, req uint, value *Termios) error {
  272. return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
  273. }
  274. // IoctlGetInt performs an ioctl operation which gets an integer value
  275. // from fd, using the specified request number.
  276. func IoctlGetInt(fd int, req uint) (int, error) {
  277. var value int
  278. err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
  279. return value, err
  280. }
  281. func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
  282. var value Winsize
  283. err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
  284. return &value, err
  285. }
  286. func IoctlGetTermios(fd int, req uint) (*Termios, error) {
  287. var value Termios
  288. err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
  289. return &value, err
  290. }
  291. func Uname(uname *Utsname) error {
  292. mib := []_C_int{CTL_KERN, KERN_OSTYPE}
  293. n := unsafe.Sizeof(uname.Sysname)
  294. if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
  295. return err
  296. }
  297. mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
  298. n = unsafe.Sizeof(uname.Nodename)
  299. if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
  300. return err
  301. }
  302. mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
  303. n = unsafe.Sizeof(uname.Release)
  304. if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
  305. return err
  306. }
  307. mib = []_C_int{CTL_KERN, KERN_VERSION}
  308. n = unsafe.Sizeof(uname.Version)
  309. if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
  310. return err
  311. }
  312. // The version might have newlines or tabs in it, convert them to
  313. // spaces.
  314. for i, b := range uname.Version {
  315. if b == '\n' || b == '\t' {
  316. if i == len(uname.Version)-1 {
  317. uname.Version[i] = 0
  318. } else {
  319. uname.Version[i] = ' '
  320. }
  321. }
  322. }
  323. mib = []_C_int{CTL_HW, HW_MACHINE}
  324. n = unsafe.Sizeof(uname.Machine)
  325. if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
  326. return err
  327. }
  328. return nil
  329. }
  330. func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
  331. if raceenabled {
  332. raceReleaseMerge(unsafe.Pointer(&ioSync))
  333. }
  334. var length = int64(count)
  335. err = sendfile(infd, outfd, *offset, &length, nil, 0)
  336. written = int(length)
  337. return
  338. }
  339. //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
  340. /*
  341. * Exposed directly
  342. */
  343. //sys Access(path string, mode uint32) (err error)
  344. //sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
  345. //sys Chdir(path string) (err error)
  346. //sys Chflags(path string, flags int) (err error)
  347. //sys Chmod(path string, mode uint32) (err error)
  348. //sys Chown(path string, uid int, gid int) (err error)
  349. //sys Chroot(path string) (err error)
  350. //sys ClockGettime(clockid int32, time *Timespec) (err error)
  351. //sys Close(fd int) (err error)
  352. //sys Dup(fd int) (nfd int, err error)
  353. //sys Dup2(from int, to int) (err error)
  354. //sys Exchangedata(path1 string, path2 string, options int) (err error)
  355. //sys Exit(code int)
  356. //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
  357. //sys Fchdir(fd int) (err error)
  358. //sys Fchflags(fd int, flags int) (err error)
  359. //sys Fchmod(fd int, mode uint32) (err error)
  360. //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
  361. //sys Fchown(fd int, uid int, gid int) (err error)
  362. //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
  363. //sys Flock(fd int, how int) (err error)
  364. //sys Fpathconf(fd int, name int) (val int, err error)
  365. //sys Fsync(fd int) (err error)
  366. //sys Ftruncate(fd int, length int64) (err error)
  367. //sys Getdtablesize() (size int)
  368. //sysnb Getegid() (egid int)
  369. //sysnb Geteuid() (uid int)
  370. //sysnb Getgid() (gid int)
  371. //sysnb Getpgid(pid int) (pgid int, err error)
  372. //sysnb Getpgrp() (pgrp int)
  373. //sysnb Getpid() (pid int)
  374. //sysnb Getppid() (ppid int)
  375. //sys Getpriority(which int, who int) (prio int, err error)
  376. //sysnb Getrlimit(which int, lim *Rlimit) (err error)
  377. //sysnb Getrusage(who int, rusage *Rusage) (err error)
  378. //sysnb Getsid(pid int) (sid int, err error)
  379. //sysnb Getuid() (uid int)
  380. //sysnb Issetugid() (tainted bool)
  381. //sys Kqueue() (fd int, err error)
  382. //sys Lchown(path string, uid int, gid int) (err error)
  383. //sys Link(path string, link string) (err error)
  384. //sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
  385. //sys Listen(s int, backlog int) (err error)
  386. //sys Mkdir(path string, mode uint32) (err error)
  387. //sys Mkdirat(dirfd int, path string, mode uint32) (err error)
  388. //sys Mkfifo(path string, mode uint32) (err error)
  389. //sys Mknod(path string, mode uint32, dev int) (err error)
  390. //sys Open(path string, mode int, perm uint32) (fd int, err error)
  391. //sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
  392. //sys Pathconf(path string, name int) (val int, err error)
  393. //sys Pread(fd int, p []byte, offset int64) (n int, err error)
  394. //sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
  395. //sys read(fd int, p []byte) (n int, err error)
  396. //sys Readlink(path string, buf []byte) (n int, err error)
  397. //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
  398. //sys Rename(from string, to string) (err error)
  399. //sys Renameat(fromfd int, from string, tofd int, to string) (err error)
  400. //sys Revoke(path string) (err error)
  401. //sys Rmdir(path string) (err error)
  402. //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
  403. //sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
  404. //sys Setegid(egid int) (err error)
  405. //sysnb Seteuid(euid int) (err error)
  406. //sysnb Setgid(gid int) (err error)
  407. //sys Setlogin(name string) (err error)
  408. //sysnb Setpgid(pid int, pgid int) (err error)
  409. //sys Setpriority(which int, who int, prio int) (err error)
  410. //sys Setprivexec(flag int) (err error)
  411. //sysnb Setregid(rgid int, egid int) (err error)
  412. //sysnb Setreuid(ruid int, euid int) (err error)
  413. //sysnb Setrlimit(which int, lim *Rlimit) (err error)
  414. //sysnb Setsid() (pid int, err error)
  415. //sysnb Settimeofday(tp *Timeval) (err error)
  416. //sysnb Setuid(uid int) (err error)
  417. //sys Symlink(path string, link string) (err error)
  418. //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
  419. //sys Sync() (err error)
  420. //sys Truncate(path string, length int64) (err error)
  421. //sys Umask(newmask int) (oldmask int)
  422. //sys Undelete(path string) (err error)
  423. //sys Unlink(path string) (err error)
  424. //sys Unlinkat(dirfd int, path string, flags int) (err error)
  425. //sys Unmount(path string, flags int) (err error)
  426. //sys write(fd int, p []byte) (n int, err error)
  427. //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
  428. //sys munmap(addr uintptr, length uintptr) (err error)
  429. //sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
  430. //sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
  431. /*
  432. * Unimplemented
  433. */
  434. // Profil
  435. // Sigaction
  436. // Sigprocmask
  437. // Getlogin
  438. // Sigpending
  439. // Sigaltstack
  440. // Ioctl
  441. // Reboot
  442. // Execve
  443. // Vfork
  444. // Sbrk
  445. // Sstk
  446. // Ovadvise
  447. // Mincore
  448. // Setitimer
  449. // Swapon
  450. // Select
  451. // Sigsuspend
  452. // Readv
  453. // Writev
  454. // Nfssvc
  455. // Getfh
  456. // Quotactl
  457. // Mount
  458. // Csops
  459. // Waitid
  460. // Add_profil
  461. // Kdebug_trace
  462. // Sigreturn
  463. // Atsocket
  464. // Kqueue_from_portset_np
  465. // Kqueue_portset
  466. // Getattrlist
  467. // Setattrlist
  468. // Getdirentriesattr
  469. // Searchfs
  470. // Delete
  471. // Copyfile
  472. // Watchevent
  473. // Waitevent
  474. // Modwatch
  475. // Fsctl
  476. // Initgroups
  477. // Posix_spawn
  478. // Nfsclnt
  479. // Fhopen
  480. // Minherit
  481. // Semsys
  482. // Msgsys
  483. // Shmsys
  484. // Semctl
  485. // Semget
  486. // Semop
  487. // Msgctl
  488. // Msgget
  489. // Msgsnd
  490. // Msgrcv
  491. // Shmat
  492. // Shmctl
  493. // Shmdt
  494. // Shmget
  495. // Shm_open
  496. // Shm_unlink
  497. // Sem_open
  498. // Sem_close
  499. // Sem_unlink
  500. // Sem_wait
  501. // Sem_trywait
  502. // Sem_post
  503. // Sem_getvalue
  504. // Sem_init
  505. // Sem_destroy
  506. // Open_extended
  507. // Umask_extended
  508. // Stat_extended
  509. // Lstat_extended
  510. // Fstat_extended
  511. // Chmod_extended
  512. // Fchmod_extended
  513. // Access_extended
  514. // Settid
  515. // Gettid
  516. // Setsgroups
  517. // Getsgroups
  518. // Setwgroups
  519. // Getwgroups
  520. // Mkfifo_extended
  521. // Mkdir_extended
  522. // Identitysvc
  523. // Shared_region_check_np
  524. // Shared_region_map_np
  525. // __pthread_mutex_destroy
  526. // __pthread_mutex_init
  527. // __pthread_mutex_lock
  528. // __pthread_mutex_trylock
  529. // __pthread_mutex_unlock
  530. // __pthread_cond_init
  531. // __pthread_cond_destroy
  532. // __pthread_cond_broadcast
  533. // __pthread_cond_signal
  534. // Setsid_with_pid
  535. // __pthread_cond_timedwait
  536. // Aio_fsync
  537. // Aio_return
  538. // Aio_suspend
  539. // Aio_cancel
  540. // Aio_error
  541. // Aio_read
  542. // Aio_write
  543. // Lio_listio
  544. // __pthread_cond_wait
  545. // Iopolicysys
  546. // __pthread_kill
  547. // __pthread_sigmask
  548. // __sigwait
  549. // __disable_threadsignal
  550. // __pthread_markcancel
  551. // __pthread_canceled
  552. // __semwait_signal
  553. // Proc_info
  554. // sendfile
  555. // Stat64_extended
  556. // Lstat64_extended
  557. // Fstat64_extended
  558. // __pthread_chdir
  559. // __pthread_fchdir
  560. // Audit
  561. // Auditon
  562. // Getauid
  563. // Setauid
  564. // Getaudit
  565. // Setaudit
  566. // Getaudit_addr
  567. // Setaudit_addr
  568. // Auditctl
  569. // Bsdthread_create
  570. // Bsdthread_terminate
  571. // Stack_snapshot
  572. // Bsdthread_register
  573. // Workq_open
  574. // Workq_ops
  575. // __mac_execve
  576. // __mac_syscall
  577. // __mac_get_file
  578. // __mac_set_file
  579. // __mac_get_link
  580. // __mac_set_link
  581. // __mac_get_proc
  582. // __mac_set_proc
  583. // __mac_get_fd
  584. // __mac_set_fd
  585. // __mac_get_pid
  586. // __mac_get_lcid
  587. // __mac_get_lctx
  588. // __mac_set_lctx
  589. // Setlcid
  590. // Read_nocancel
  591. // Write_nocancel
  592. // Open_nocancel
  593. // Close_nocancel
  594. // Wait4_nocancel
  595. // Recvmsg_nocancel
  596. // Sendmsg_nocancel
  597. // Recvfrom_nocancel
  598. // Accept_nocancel
  599. // Fcntl_nocancel
  600. // Select_nocancel
  601. // Fsync_nocancel
  602. // Connect_nocancel
  603. // Sigsuspend_nocancel
  604. // Readv_nocancel
  605. // Writev_nocancel
  606. // Sendto_nocancel
  607. // Pread_nocancel
  608. // Pwrite_nocancel
  609. // Waitid_nocancel
  610. // Poll_nocancel
  611. // Msgsnd_nocancel
  612. // Msgrcv_nocancel
  613. // Sem_wait_nocancel
  614. // Aio_suspend_nocancel
  615. // __sigwait_nocancel
  616. // __semwait_signal_nocancel
  617. // __mac_mount
  618. // __mac_get_mount
  619. // __mac_getfsstat