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. use(unsafe.Pointer(_p0))
  118. n = int(r0)
  119. if e1 != 0 {
  120. err = e1
  121. }
  122. return
  123. }
  124. // Derive extattr namespace and attribute name
  125. func xattrnamespace(fullattr string) (ns int, attr string, err error) {
  126. s := -1
  127. for idx, val := range fullattr {
  128. if val == '.' {
  129. s = idx
  130. break
  131. }
  132. }
  133. if s == -1 {
  134. return -1, "", ENOATTR
  135. }
  136. namespace := fullattr[0:s]
  137. attr = fullattr[s+1:]
  138. switch namespace {
  139. case "user":
  140. return EXTATTR_NAMESPACE_USER, attr, nil
  141. case "system":
  142. return EXTATTR_NAMESPACE_SYSTEM, attr, nil
  143. default:
  144. return -1, "", ENOATTR
  145. }
  146. }
  147. func initxattrdest(dest []byte, idx int) (d unsafe.Pointer) {
  148. if len(dest) > idx {
  149. return unsafe.Pointer(&dest[idx])
  150. } else {
  151. return unsafe.Pointer(_zero)
  152. }
  153. }
  154. // FreeBSD implements its own syscalls to handle extended attributes
  155. func Getxattr(file string, attr string, dest []byte) (sz int, err error) {
  156. d := initxattrdest(dest, 0)
  157. destsize := len(dest)
  158. nsid, a, err := xattrnamespace(attr)
  159. if err != nil {
  160. return -1, err
  161. }
  162. return ExtattrGetFile(file, nsid, a, uintptr(d), destsize)
  163. }
  164. func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) {
  165. d := initxattrdest(dest, 0)
  166. destsize := len(dest)
  167. nsid, a, err := xattrnamespace(attr)
  168. if err != nil {
  169. return -1, err
  170. }
  171. return ExtattrGetFd(fd, nsid, a, uintptr(d), destsize)
  172. }
  173. func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) {
  174. d := initxattrdest(dest, 0)
  175. destsize := len(dest)
  176. nsid, a, err := xattrnamespace(attr)
  177. if err != nil {
  178. return -1, err
  179. }
  180. return ExtattrGetLink(link, nsid, a, uintptr(d), destsize)
  181. }
  182. // flags are unused on FreeBSD
  183. func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) {
  184. d := unsafe.Pointer(&data[0])
  185. datasiz := len(data)
  186. nsid, a, err := xattrnamespace(attr)
  187. if err != nil {
  188. return
  189. }
  190. _, err = ExtattrSetFd(fd, nsid, a, uintptr(d), datasiz)
  191. return
  192. }
  193. func Setxattr(file string, attr string, data []byte, flags int) (err error) {
  194. d := unsafe.Pointer(&data[0])
  195. datasiz := len(data)
  196. nsid, a, err := xattrnamespace(attr)
  197. if err != nil {
  198. return
  199. }
  200. _, err = ExtattrSetFile(file, nsid, a, uintptr(d), datasiz)
  201. return
  202. }
  203. func Lsetxattr(link string, attr string, data []byte, flags int) (err error) {
  204. d := unsafe.Pointer(&data[0])
  205. datasiz := len(data)
  206. nsid, a, err := xattrnamespace(attr)
  207. if err != nil {
  208. return
  209. }
  210. _, err = ExtattrSetLink(link, nsid, a, uintptr(d), datasiz)
  211. return
  212. }
  213. func Removexattr(file string, attr string) (err error) {
  214. nsid, a, err := xattrnamespace(attr)
  215. if err != nil {
  216. return
  217. }
  218. err = ExtattrDeleteFile(file, nsid, a)
  219. return
  220. }
  221. func Fremovexattr(fd int, attr string) (err error) {
  222. nsid, a, err := xattrnamespace(attr)
  223. if err != nil {
  224. return
  225. }
  226. err = ExtattrDeleteFd(fd, nsid, a)
  227. return
  228. }
  229. func Lremovexattr(link string, attr string) (err error) {
  230. nsid, a, err := xattrnamespace(attr)
  231. if err != nil {
  232. return
  233. }
  234. err = ExtattrDeleteLink(link, nsid, a)
  235. return
  236. }
  237. func Listxattr(file string, dest []byte) (sz int, err error) {
  238. d := initxattrdest(dest, 0)
  239. destsiz := len(dest)
  240. // FreeBSD won't allow you to list xattrs from multiple namespaces
  241. s := 0
  242. var e error
  243. for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
  244. stmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz)
  245. /* Errors accessing system attrs are ignored so that
  246. * we can implement the Linux-like behavior of omitting errors that
  247. * we don't have read permissions on
  248. *
  249. * Linux will still error if we ask for user attributes on a file that
  250. * we don't have read permissions on, so don't ignore those errors
  251. */
  252. if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
  253. e = nil
  254. continue
  255. } else if e != nil {
  256. return s, e
  257. }
  258. s += stmp
  259. destsiz -= s
  260. if destsiz < 0 {
  261. destsiz = 0
  262. }
  263. d = initxattrdest(dest, s)
  264. }
  265. return s, e
  266. }
  267. func Flistxattr(fd int, dest []byte) (sz int, err error) {
  268. d := initxattrdest(dest, 0)
  269. destsiz := len(dest)
  270. s := 0
  271. var e error
  272. for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
  273. stmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz)
  274. if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
  275. e = nil
  276. continue
  277. } else if e != nil {
  278. return s, e
  279. }
  280. s += stmp
  281. destsiz -= s
  282. if destsiz < 0 {
  283. destsiz = 0
  284. }
  285. d = initxattrdest(dest, s)
  286. }
  287. return s, e
  288. }
  289. func Llistxattr(link string, dest []byte) (sz int, err error) {
  290. d := initxattrdest(dest, 0)
  291. destsiz := len(dest)
  292. s := 0
  293. var e error
  294. for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
  295. stmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz)
  296. if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
  297. e = nil
  298. continue
  299. } else if e != nil {
  300. return s, e
  301. }
  302. s += stmp
  303. destsiz -= s
  304. if destsiz < 0 {
  305. destsiz = 0
  306. }
  307. d = initxattrdest(dest, s)
  308. }
  309. return s, e
  310. }
  311. /*
  312. * Exposed directly
  313. */
  314. //sys Access(path string, mode uint32) (err error)
  315. //sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
  316. //sys Chdir(path string) (err error)
  317. //sys Chflags(path string, flags int) (err error)
  318. //sys Chmod(path string, mode uint32) (err error)
  319. //sys Chown(path string, uid int, gid int) (err error)
  320. //sys Chroot(path string) (err error)
  321. //sys Close(fd int) (err error)
  322. //sys Dup(fd int) (nfd int, err error)
  323. //sys Dup2(from int, to int) (err error)
  324. //sys Exit(code int)
  325. //sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  326. //sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  327. //sys ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error)
  328. //sys ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
  329. //sys ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  330. //sys ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  331. //sys ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error)
  332. //sys ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
  333. //sys ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  334. //sys ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  335. //sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)
  336. //sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
  337. //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE
  338. //sys Fchdir(fd int) (err error)
  339. //sys Fchflags(fd int, flags int) (err error)
  340. //sys Fchmod(fd int, mode uint32) (err error)
  341. //sys Fchown(fd int, uid int, gid int) (err error)
  342. //sys Flock(fd int, how int) (err error)
  343. //sys Fpathconf(fd int, name int) (val int, err error)
  344. //sys Fstat(fd int, stat *Stat_t) (err error)
  345. //sys Fstatfs(fd int, stat *Statfs_t) (err error)
  346. //sys Fsync(fd int) (err error)
  347. //sys Ftruncate(fd int, length int64) (err error)
  348. //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
  349. //sys Getdtablesize() (size int)
  350. //sysnb Getegid() (egid int)
  351. //sysnb Geteuid() (uid int)
  352. //sysnb Getgid() (gid int)
  353. //sysnb Getpgid(pid int) (pgid int, err error)
  354. //sysnb Getpgrp() (pgrp int)
  355. //sysnb Getpid() (pid int)
  356. //sysnb Getppid() (ppid int)
  357. //sys Getpriority(which int, who int) (prio int, err error)
  358. //sysnb Getrlimit(which int, lim *Rlimit) (err error)
  359. //sysnb Getrusage(who int, rusage *Rusage) (err error)
  360. //sysnb Getsid(pid int) (sid int, err error)
  361. //sysnb Gettimeofday(tv *Timeval) (err error)
  362. //sysnb Getuid() (uid int)
  363. //sys Issetugid() (tainted bool)
  364. //sys Kill(pid int, signum syscall.Signal) (err error)
  365. //sys Kqueue() (fd int, err error)
  366. //sys Lchown(path string, uid int, gid int) (err error)
  367. //sys Link(path string, link string) (err error)
  368. //sys Listen(s int, backlog int) (err error)
  369. //sys Lstat(path string, stat *Stat_t) (err error)
  370. //sys Mkdir(path string, mode uint32) (err error)
  371. //sys Mkfifo(path string, mode uint32) (err error)
  372. //sys Mknod(path string, mode uint32, dev int) (err error)
  373. //sys Mlock(b []byte) (err error)
  374. //sys Mlockall(flags int) (err error)
  375. //sys Mprotect(b []byte, prot int) (err error)
  376. //sys Munlock(b []byte) (err error)
  377. //sys Munlockall() (err error)
  378. //sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
  379. //sys Open(path string, mode int, perm uint32) (fd int, err error)
  380. //sys Pathconf(path string, name int) (val int, err error)
  381. //sys Pread(fd int, p []byte, offset int64) (n int, err error)
  382. //sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
  383. //sys read(fd int, p []byte) (n int, err error)
  384. //sys Readlink(path string, buf []byte) (n int, err error)
  385. //sys Rename(from string, to string) (err error)
  386. //sys Revoke(path string) (err error)
  387. //sys Rmdir(path string) (err error)
  388. //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
  389. //sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
  390. //sysnb Setegid(egid int) (err error)
  391. //sysnb Seteuid(euid int) (err error)
  392. //sysnb Setgid(gid int) (err error)
  393. //sys Setlogin(name string) (err error)
  394. //sysnb Setpgid(pid int, pgid int) (err error)
  395. //sys Setpriority(which int, who int, prio int) (err error)
  396. //sysnb Setregid(rgid int, egid int) (err error)
  397. //sysnb Setreuid(ruid int, euid int) (err error)
  398. //sysnb Setresgid(rgid int, egid int, sgid int) (err error)
  399. //sysnb Setresuid(ruid int, euid int, suid int) (err error)
  400. //sysnb Setrlimit(which int, lim *Rlimit) (err error)
  401. //sysnb Setsid() (pid int, err error)
  402. //sysnb Settimeofday(tp *Timeval) (err error)
  403. //sysnb Setuid(uid int) (err error)
  404. //sys Stat(path string, stat *Stat_t) (err error)
  405. //sys Statfs(path string, stat *Statfs_t) (err error)
  406. //sys Symlink(path string, link string) (err error)
  407. //sys Sync() (err error)
  408. //sys Truncate(path string, length int64) (err error)
  409. //sys Umask(newmask int) (oldmask int)
  410. //sys Undelete(path string) (err error)
  411. //sys Unlink(path string) (err error)
  412. //sys Unmount(path string, flags int) (err error)
  413. //sys write(fd int, p []byte) (n int, err error)
  414. //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
  415. //sys munmap(addr uintptr, length uintptr) (err error)
  416. //sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
  417. //sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
  418. //sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
  419. /*
  420. * Unimplemented
  421. */
  422. // Profil
  423. // Sigaction
  424. // Sigprocmask
  425. // Getlogin
  426. // Sigpending
  427. // Sigaltstack
  428. // Ioctl
  429. // Reboot
  430. // Execve
  431. // Vfork
  432. // Sbrk
  433. // Sstk
  434. // Ovadvise
  435. // Mincore
  436. // Setitimer
  437. // Swapon
  438. // Select
  439. // Sigsuspend
  440. // Readv
  441. // Writev
  442. // Nfssvc
  443. // Getfh
  444. // Quotactl
  445. // Mount
  446. // Csops
  447. // Waitid
  448. // Add_profil
  449. // Kdebug_trace
  450. // Sigreturn
  451. // Mmap
  452. // Mlock
  453. // Munlock
  454. // Atsocket
  455. // Kqueue_from_portset_np
  456. // Kqueue_portset
  457. // Getattrlist
  458. // Setattrlist
  459. // Getdirentriesattr
  460. // Searchfs
  461. // Delete
  462. // Copyfile
  463. // Poll
  464. // Watchevent
  465. // Waitevent
  466. // Modwatch
  467. // Getxattr
  468. // Fgetxattr
  469. // Setxattr
  470. // Fsetxattr
  471. // Removexattr
  472. // Fremovexattr
  473. // Listxattr
  474. // Flistxattr
  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. // Mlockall
  547. // Munlockall
  548. // __pthread_kill
  549. // __pthread_sigmask
  550. // __sigwait
  551. // __disable_threadsignal
  552. // __pthread_markcancel
  553. // __pthread_canceled
  554. // __semwait_signal
  555. // Proc_info
  556. // Stat64_extended
  557. // Lstat64_extended
  558. // Fstat64_extended
  559. // __pthread_chdir
  560. // __pthread_fchdir
  561. // Audit
  562. // Auditon
  563. // Getauid
  564. // Setauid
  565. // Getaudit
  566. // Setaudit
  567. // Getaudit_addr
  568. // Setaudit_addr
  569. // Auditctl
  570. // Bsdthread_create
  571. // Bsdthread_terminate
  572. // Stack_snapshot
  573. // Bsdthread_register
  574. // Workq_open
  575. // Workq_ops
  576. // __mac_execve
  577. // __mac_syscall
  578. // __mac_get_file
  579. // __mac_set_file
  580. // __mac_get_link
  581. // __mac_set_link
  582. // __mac_get_proc
  583. // __mac_set_proc
  584. // __mac_get_fd
  585. // __mac_set_fd
  586. // __mac_get_pid
  587. // __mac_get_lcid
  588. // __mac_get_lctx
  589. // __mac_set_lctx
  590. // Setlcid
  591. // Read_nocancel
  592. // Write_nocancel
  593. // Open_nocancel
  594. // Close_nocancel
  595. // Wait4_nocancel
  596. // Recvmsg_nocancel
  597. // Sendmsg_nocancel
  598. // Recvfrom_nocancel
  599. // Accept_nocancel
  600. // Msync_nocancel
  601. // Fcntl_nocancel
  602. // Select_nocancel
  603. // Fsync_nocancel
  604. // Connect_nocancel
  605. // Sigsuspend_nocancel
  606. // Readv_nocancel
  607. // Writev_nocancel
  608. // Sendto_nocancel
  609. // Pread_nocancel
  610. // Pwrite_nocancel
  611. // Waitid_nocancel
  612. // Poll_nocancel
  613. // Msgsnd_nocancel
  614. // Msgrcv_nocancel
  615. // Sem_wait_nocancel
  616. // Aio_suspend_nocancel
  617. // __sigwait_nocancel
  618. // __semwait_signal_nocancel
  619. // __mac_mount
  620. // __mac_get_mount
  621. // __mac_getfsstat