syscall_freebsd.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  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. // FreeBSD 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 "unsafe"
  13. type SockaddrDatalink struct {
  14. Len uint8
  15. Family uint8
  16. Index uint16
  17. Type uint8
  18. Nlen uint8
  19. Alen uint8
  20. Slen uint8
  21. Data [46]int8
  22. raw RawSockaddrDatalink
  23. }
  24. // Translate "kern.hostname" to []_C_int{0,1,2,3}.
  25. func nametomib(name string) (mib []_C_int, err error) {
  26. const siz = unsafe.Sizeof(mib[0])
  27. // NOTE(rsc): It seems strange to set the buffer to have
  28. // size CTL_MAXNAME+2 but use only CTL_MAXNAME
  29. // as the size. I don't know why the +2 is here, but the
  30. // kernel uses +2 for its own implementation of this function.
  31. // I am scared that if we don't include the +2 here, the kernel
  32. // will silently write 2 words farther than we specify
  33. // and we'll get memory corruption.
  34. var buf [CTL_MAXNAME + 2]_C_int
  35. n := uintptr(CTL_MAXNAME) * siz
  36. p := (*byte)(unsafe.Pointer(&buf[0]))
  37. bytes, err := ByteSliceFromString(name)
  38. if err != nil {
  39. return nil, err
  40. }
  41. // Magic sysctl: "setting" 0.3 to a string name
  42. // lets you read back the array of integers form.
  43. if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {
  44. return nil, err
  45. }
  46. return buf[0 : n/siz], nil
  47. }
  48. // ParseDirent parses up to max directory entries in buf,
  49. // appending the names to names. It returns the number
  50. // bytes consumed from buf, the number of entries added
  51. // to names, and the new names slice.
  52. func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
  53. origlen := len(buf)
  54. for max != 0 && len(buf) > 0 {
  55. dirent := (*Dirent)(unsafe.Pointer(&buf[0]))
  56. if dirent.Reclen == 0 {
  57. buf = nil
  58. break
  59. }
  60. buf = buf[dirent.Reclen:]
  61. if dirent.Fileno == 0 { // File absent in directory.
  62. continue
  63. }
  64. bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))
  65. var name = string(bytes[0:dirent.Namlen])
  66. if name == "." || name == ".." { // Useless names
  67. continue
  68. }
  69. max--
  70. count++
  71. names = append(names, name)
  72. }
  73. return origlen - len(buf), count, names
  74. }
  75. //sysnb pipe() (r int, w int, err error)
  76. func Pipe(p []int) (err error) {
  77. if len(p) != 2 {
  78. return EINVAL
  79. }
  80. p[0], p[1], err = pipe()
  81. return
  82. }
  83. func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
  84. var value IPMreqn
  85. vallen := _Socklen(SizeofIPMreqn)
  86. errno := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
  87. return &value, errno
  88. }
  89. func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
  90. return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
  91. }
  92. func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
  93. var rsa RawSockaddrAny
  94. var len _Socklen = SizeofSockaddrAny
  95. nfd, err = accept4(fd, &rsa, &len, flags)
  96. if err != nil {
  97. return
  98. }
  99. if len > SizeofSockaddrAny {
  100. panic("RawSockaddrAny too small")
  101. }
  102. sa, err = anyToSockaddr(&rsa)
  103. if err != nil {
  104. Close(nfd)
  105. nfd = 0
  106. }
  107. return
  108. }
  109. func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
  110. var _p0 unsafe.Pointer
  111. var bufsize uintptr
  112. if len(buf) > 0 {
  113. _p0 = unsafe.Pointer(&buf[0])
  114. bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
  115. }
  116. r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
  117. n = int(r0)
  118. if e1 != 0 {
  119. err = e1
  120. }
  121. return
  122. }
  123. // Derive extattr namespace and attribute name
  124. func xattrnamespace(fullattr string) (ns int, attr string, err error) {
  125. s := -1
  126. for idx, val := range fullattr {
  127. if val == '.' {
  128. s = idx
  129. break
  130. }
  131. }
  132. if s == -1 {
  133. return -1, "", ENOATTR
  134. }
  135. namespace := fullattr[0:s]
  136. attr = fullattr[s+1:]
  137. switch namespace {
  138. case "user":
  139. return EXTATTR_NAMESPACE_USER, attr, nil
  140. case "system":
  141. return EXTATTR_NAMESPACE_SYSTEM, attr, nil
  142. default:
  143. return -1, "", ENOATTR
  144. }
  145. }
  146. func initxattrdest(dest []byte, idx int) (d unsafe.Pointer) {
  147. if len(dest) > idx {
  148. return unsafe.Pointer(&dest[idx])
  149. } else {
  150. return unsafe.Pointer(_zero)
  151. }
  152. }
  153. // FreeBSD implements its own syscalls to handle extended attributes
  154. func Getxattr(file string, attr string, dest []byte) (sz int, err error) {
  155. d := initxattrdest(dest, 0)
  156. destsize := len(dest)
  157. nsid, a, err := xattrnamespace(attr)
  158. if err != nil {
  159. return -1, err
  160. }
  161. return ExtattrGetFile(file, nsid, a, uintptr(d), destsize)
  162. }
  163. func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) {
  164. d := initxattrdest(dest, 0)
  165. destsize := len(dest)
  166. nsid, a, err := xattrnamespace(attr)
  167. if err != nil {
  168. return -1, err
  169. }
  170. return ExtattrGetFd(fd, nsid, a, uintptr(d), destsize)
  171. }
  172. func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) {
  173. d := initxattrdest(dest, 0)
  174. destsize := len(dest)
  175. nsid, a, err := xattrnamespace(attr)
  176. if err != nil {
  177. return -1, err
  178. }
  179. return ExtattrGetLink(link, nsid, a, uintptr(d), destsize)
  180. }
  181. // flags are unused on FreeBSD
  182. func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) {
  183. d := unsafe.Pointer(&data[0])
  184. datasiz := len(data)
  185. nsid, a, err := xattrnamespace(attr)
  186. if err != nil {
  187. return
  188. }
  189. _, err = ExtattrSetFd(fd, nsid, a, uintptr(d), datasiz)
  190. return
  191. }
  192. func Setxattr(file string, attr string, data []byte, flags int) (err error) {
  193. d := unsafe.Pointer(&data[0])
  194. datasiz := len(data)
  195. nsid, a, err := xattrnamespace(attr)
  196. if err != nil {
  197. return
  198. }
  199. _, err = ExtattrSetFile(file, nsid, a, uintptr(d), datasiz)
  200. return
  201. }
  202. func Lsetxattr(link string, attr string, data []byte, flags int) (err error) {
  203. d := unsafe.Pointer(&data[0])
  204. datasiz := len(data)
  205. nsid, a, err := xattrnamespace(attr)
  206. if err != nil {
  207. return
  208. }
  209. _, err = ExtattrSetLink(link, nsid, a, uintptr(d), datasiz)
  210. return
  211. }
  212. func Removexattr(file string, attr string) (err error) {
  213. nsid, a, err := xattrnamespace(attr)
  214. if err != nil {
  215. return
  216. }
  217. err = ExtattrDeleteFile(file, nsid, a)
  218. return
  219. }
  220. func Fremovexattr(fd int, attr string) (err error) {
  221. nsid, a, err := xattrnamespace(attr)
  222. if err != nil {
  223. return
  224. }
  225. err = ExtattrDeleteFd(fd, nsid, a)
  226. return
  227. }
  228. func Lremovexattr(link string, attr string) (err error) {
  229. nsid, a, err := xattrnamespace(attr)
  230. if err != nil {
  231. return
  232. }
  233. err = ExtattrDeleteLink(link, nsid, a)
  234. return
  235. }
  236. func Listxattr(file string, dest []byte) (sz int, err error) {
  237. d := initxattrdest(dest, 0)
  238. destsiz := len(dest)
  239. // FreeBSD won't allow you to list xattrs from multiple namespaces
  240. s := 0
  241. var e error
  242. for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
  243. stmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz)
  244. /* Errors accessing system attrs are ignored so that
  245. * we can implement the Linux-like behavior of omitting errors that
  246. * we don't have read permissions on
  247. *
  248. * Linux will still error if we ask for user attributes on a file that
  249. * we don't have read permissions on, so don't ignore those errors
  250. */
  251. if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
  252. e = nil
  253. continue
  254. } else if e != nil {
  255. return s, e
  256. }
  257. s += stmp
  258. destsiz -= s
  259. if destsiz < 0 {
  260. destsiz = 0
  261. }
  262. d = initxattrdest(dest, s)
  263. }
  264. return s, e
  265. }
  266. func Flistxattr(fd int, dest []byte) (sz int, err error) {
  267. d := initxattrdest(dest, 0)
  268. destsiz := len(dest)
  269. s := 0
  270. var e error
  271. for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
  272. stmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz)
  273. if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
  274. e = nil
  275. continue
  276. } else if e != nil {
  277. return s, e
  278. }
  279. s += stmp
  280. destsiz -= s
  281. if destsiz < 0 {
  282. destsiz = 0
  283. }
  284. d = initxattrdest(dest, s)
  285. }
  286. return s, e
  287. }
  288. func Llistxattr(link string, dest []byte) (sz int, err error) {
  289. d := initxattrdest(dest, 0)
  290. destsiz := len(dest)
  291. s := 0
  292. var e error
  293. for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
  294. stmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz)
  295. if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
  296. e = nil
  297. continue
  298. } else if e != nil {
  299. return s, e
  300. }
  301. s += stmp
  302. destsiz -= s
  303. if destsiz < 0 {
  304. destsiz = 0
  305. }
  306. d = initxattrdest(dest, s)
  307. }
  308. return s, e
  309. }
  310. /*
  311. * Exposed directly
  312. */
  313. //sys Access(path string, mode uint32) (err error)
  314. //sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
  315. //sys Chdir(path string) (err error)
  316. //sys Chflags(path string, flags int) (err error)
  317. //sys Chmod(path string, mode uint32) (err error)
  318. //sys Chown(path string, uid int, gid int) (err error)
  319. //sys Chroot(path string) (err error)
  320. //sys Close(fd int) (err error)
  321. //sys Dup(fd int) (nfd int, err error)
  322. //sys Dup2(from int, to int) (err error)
  323. //sys Exit(code int)
  324. //sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  325. //sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  326. //sys ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error)
  327. //sys ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
  328. //sys ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  329. //sys ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  330. //sys ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error)
  331. //sys ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
  332. //sys ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  333. //sys ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  334. //sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)
  335. //sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
  336. //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE
  337. //sys Fchdir(fd int) (err error)
  338. //sys Fchflags(fd int, flags int) (err error)
  339. //sys Fchmod(fd int, mode uint32) (err error)
  340. //sys Fchown(fd int, uid int, gid int) (err error)
  341. //sys Flock(fd int, how int) (err error)
  342. //sys Fpathconf(fd int, name int) (val int, err error)
  343. //sys Fstat(fd int, stat *Stat_t) (err error)
  344. //sys Fstatfs(fd int, stat *Statfs_t) (err error)
  345. //sys Fsync(fd int) (err error)
  346. //sys Ftruncate(fd int, length int64) (err error)
  347. //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
  348. //sys Getdtablesize() (size int)
  349. //sysnb Getegid() (egid int)
  350. //sysnb Geteuid() (uid int)
  351. //sysnb Getgid() (gid int)
  352. //sysnb Getpgid(pid int) (pgid int, err error)
  353. //sysnb Getpgrp() (pgrp int)
  354. //sysnb Getpid() (pid int)
  355. //sysnb Getppid() (ppid int)
  356. //sys Getpriority(which int, who int) (prio int, err error)
  357. //sysnb Getrlimit(which int, lim *Rlimit) (err error)
  358. //sysnb Getrusage(who int, rusage *Rusage) (err error)
  359. //sysnb Getsid(pid int) (sid int, err error)
  360. //sysnb Gettimeofday(tv *Timeval) (err error)
  361. //sysnb Getuid() (uid int)
  362. //sys Issetugid() (tainted bool)
  363. //sys Kill(pid int, signum syscall.Signal) (err error)
  364. //sys Kqueue() (fd int, err error)
  365. //sys Lchown(path string, uid int, gid int) (err error)
  366. //sys Link(path string, link string) (err error)
  367. //sys Listen(s int, backlog int) (err error)
  368. //sys Lstat(path string, stat *Stat_t) (err error)
  369. //sys Mkdir(path string, mode uint32) (err error)
  370. //sys Mkfifo(path string, mode uint32) (err error)
  371. //sys Mknod(path string, mode uint32, dev int) (err error)
  372. //sys Mlock(b []byte) (err error)
  373. //sys Mlockall(flags int) (err error)
  374. //sys Mprotect(b []byte, prot int) (err error)
  375. //sys Munlock(b []byte) (err error)
  376. //sys Munlockall() (err error)
  377. //sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
  378. //sys Open(path string, mode int, perm uint32) (fd int, err error)
  379. //sys Pathconf(path string, name int) (val int, err error)
  380. //sys Pread(fd int, p []byte, offset int64) (n int, err error)
  381. //sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
  382. //sys read(fd int, p []byte) (n int, err error)
  383. //sys Readlink(path string, buf []byte) (n int, err error)
  384. //sys Rename(from string, to string) (err error)
  385. //sys Revoke(path string) (err error)
  386. //sys Rmdir(path string) (err error)
  387. //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
  388. //sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
  389. //sysnb Setegid(egid int) (err error)
  390. //sysnb Seteuid(euid int) (err error)
  391. //sysnb Setgid(gid int) (err error)
  392. //sys Setlogin(name string) (err error)
  393. //sysnb Setpgid(pid int, pgid int) (err error)
  394. //sys Setpriority(which int, who int, prio int) (err error)
  395. //sysnb Setregid(rgid int, egid int) (err error)
  396. //sysnb Setreuid(ruid int, euid int) (err error)
  397. //sysnb Setresgid(rgid int, egid int, sgid int) (err error)
  398. //sysnb Setresuid(ruid int, euid int, suid int) (err error)
  399. //sysnb Setrlimit(which int, lim *Rlimit) (err error)
  400. //sysnb Setsid() (pid int, err error)
  401. //sysnb Settimeofday(tp *Timeval) (err error)
  402. //sysnb Setuid(uid int) (err error)
  403. //sys Stat(path string, stat *Stat_t) (err error)
  404. //sys Statfs(path string, stat *Statfs_t) (err error)
  405. //sys Symlink(path string, link string) (err error)
  406. //sys Sync() (err error)
  407. //sys Truncate(path string, length int64) (err error)
  408. //sys Umask(newmask int) (oldmask int)
  409. //sys Undelete(path string) (err error)
  410. //sys Unlink(path string) (err error)
  411. //sys Unmount(path string, flags int) (err error)
  412. //sys write(fd int, p []byte) (n int, err error)
  413. //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
  414. //sys munmap(addr uintptr, length uintptr) (err error)
  415. //sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
  416. //sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
  417. //sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
  418. /*
  419. * Unimplemented
  420. */
  421. // Profil
  422. // Sigaction
  423. // Sigprocmask
  424. // Getlogin
  425. // Sigpending
  426. // Sigaltstack
  427. // Ioctl
  428. // Reboot
  429. // Execve
  430. // Vfork
  431. // Sbrk
  432. // Sstk
  433. // Ovadvise
  434. // Mincore
  435. // Setitimer
  436. // Swapon
  437. // Select
  438. // Sigsuspend
  439. // Readv
  440. // Writev
  441. // Nfssvc
  442. // Getfh
  443. // Quotactl
  444. // Mount
  445. // Csops
  446. // Waitid
  447. // Add_profil
  448. // Kdebug_trace
  449. // Sigreturn
  450. // Mmap
  451. // Mlock
  452. // Munlock
  453. // Atsocket
  454. // Kqueue_from_portset_np
  455. // Kqueue_portset
  456. // Getattrlist
  457. // Setattrlist
  458. // Getdirentriesattr
  459. // Searchfs
  460. // Delete
  461. // Copyfile
  462. // Poll
  463. // Watchevent
  464. // Waitevent
  465. // Modwatch
  466. // Getxattr
  467. // Fgetxattr
  468. // Setxattr
  469. // Fsetxattr
  470. // Removexattr
  471. // Fremovexattr
  472. // Listxattr
  473. // Flistxattr
  474. // Fsctl
  475. // Initgroups
  476. // Posix_spawn
  477. // Nfsclnt
  478. // Fhopen
  479. // Minherit
  480. // Semsys
  481. // Msgsys
  482. // Shmsys
  483. // Semctl
  484. // Semget
  485. // Semop
  486. // Msgctl
  487. // Msgget
  488. // Msgsnd
  489. // Msgrcv
  490. // Shmat
  491. // Shmctl
  492. // Shmdt
  493. // Shmget
  494. // Shm_open
  495. // Shm_unlink
  496. // Sem_open
  497. // Sem_close
  498. // Sem_unlink
  499. // Sem_wait
  500. // Sem_trywait
  501. // Sem_post
  502. // Sem_getvalue
  503. // Sem_init
  504. // Sem_destroy
  505. // Open_extended
  506. // Umask_extended
  507. // Stat_extended
  508. // Lstat_extended
  509. // Fstat_extended
  510. // Chmod_extended
  511. // Fchmod_extended
  512. // Access_extended
  513. // Settid
  514. // Gettid
  515. // Setsgroups
  516. // Getsgroups
  517. // Setwgroups
  518. // Getwgroups
  519. // Mkfifo_extended
  520. // Mkdir_extended
  521. // Identitysvc
  522. // Shared_region_check_np
  523. // Shared_region_map_np
  524. // __pthread_mutex_destroy
  525. // __pthread_mutex_init
  526. // __pthread_mutex_lock
  527. // __pthread_mutex_trylock
  528. // __pthread_mutex_unlock
  529. // __pthread_cond_init
  530. // __pthread_cond_destroy
  531. // __pthread_cond_broadcast
  532. // __pthread_cond_signal
  533. // Setsid_with_pid
  534. // __pthread_cond_timedwait
  535. // Aio_fsync
  536. // Aio_return
  537. // Aio_suspend
  538. // Aio_cancel
  539. // Aio_error
  540. // Aio_read
  541. // Aio_write
  542. // Lio_listio
  543. // __pthread_cond_wait
  544. // Iopolicysys
  545. // Mlockall
  546. // Munlockall
  547. // __pthread_kill
  548. // __pthread_sigmask
  549. // __sigwait
  550. // __disable_threadsignal
  551. // __pthread_markcancel
  552. // __pthread_canceled
  553. // __semwait_signal
  554. // Proc_info
  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. // Msync_nocancel
  600. // Fcntl_nocancel
  601. // Select_nocancel
  602. // Fsync_nocancel
  603. // Connect_nocancel
  604. // Sigsuspend_nocancel
  605. // Readv_nocancel
  606. // Writev_nocancel
  607. // Sendto_nocancel
  608. // Pread_nocancel
  609. // Pwrite_nocancel
  610. // Waitid_nocancel
  611. // Poll_nocancel
  612. // Msgsnd_nocancel
  613. // Msgrcv_nocancel
  614. // Sem_wait_nocancel
  615. // Aio_suspend_nocancel
  616. // __sigwait_nocancel
  617. // __semwait_signal_nocancel
  618. // __mac_mount
  619. // __mac_get_mount
  620. // __mac_getfsstat