syscall_freebsd.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  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. func direntIno(buf []byte) (uint64, bool) {
  49. return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
  50. }
  51. func direntReclen(buf []byte) (uint64, bool) {
  52. return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
  53. }
  54. func direntNamlen(buf []byte) (uint64, bool) {
  55. return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
  56. }
  57. //sysnb pipe() (r int, w int, err error)
  58. func Pipe(p []int) (err error) {
  59. if len(p) != 2 {
  60. return EINVAL
  61. }
  62. p[0], p[1], err = pipe()
  63. return
  64. }
  65. func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
  66. var value IPMreqn
  67. vallen := _Socklen(SizeofIPMreqn)
  68. errno := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
  69. return &value, errno
  70. }
  71. func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
  72. return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
  73. }
  74. func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
  75. var rsa RawSockaddrAny
  76. var len _Socklen = SizeofSockaddrAny
  77. nfd, err = accept4(fd, &rsa, &len, flags)
  78. if err != nil {
  79. return
  80. }
  81. if len > SizeofSockaddrAny {
  82. panic("RawSockaddrAny too small")
  83. }
  84. sa, err = anyToSockaddr(&rsa)
  85. if err != nil {
  86. Close(nfd)
  87. nfd = 0
  88. }
  89. return
  90. }
  91. func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
  92. var _p0 unsafe.Pointer
  93. var bufsize uintptr
  94. if len(buf) > 0 {
  95. _p0 = unsafe.Pointer(&buf[0])
  96. bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
  97. }
  98. r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
  99. n = int(r0)
  100. if e1 != 0 {
  101. err = e1
  102. }
  103. return
  104. }
  105. func setattrlistTimes(path string, times []Timespec, flags int) error {
  106. // used on Darwin for UtimesNano
  107. return ENOSYS
  108. }
  109. // Derive extattr namespace and attribute name
  110. func xattrnamespace(fullattr string) (ns int, attr string, err error) {
  111. s := -1
  112. for idx, val := range fullattr {
  113. if val == '.' {
  114. s = idx
  115. break
  116. }
  117. }
  118. if s == -1 {
  119. return -1, "", ENOATTR
  120. }
  121. namespace := fullattr[0:s]
  122. attr = fullattr[s+1:]
  123. switch namespace {
  124. case "user":
  125. return EXTATTR_NAMESPACE_USER, attr, nil
  126. case "system":
  127. return EXTATTR_NAMESPACE_SYSTEM, attr, nil
  128. default:
  129. return -1, "", ENOATTR
  130. }
  131. }
  132. func initxattrdest(dest []byte, idx int) (d unsafe.Pointer) {
  133. if len(dest) > idx {
  134. return unsafe.Pointer(&dest[idx])
  135. } else {
  136. return unsafe.Pointer(_zero)
  137. }
  138. }
  139. // FreeBSD implements its own syscalls to handle extended attributes
  140. func Getxattr(file string, attr string, dest []byte) (sz int, err error) {
  141. d := initxattrdest(dest, 0)
  142. destsize := len(dest)
  143. nsid, a, err := xattrnamespace(attr)
  144. if err != nil {
  145. return -1, err
  146. }
  147. return ExtattrGetFile(file, nsid, a, uintptr(d), destsize)
  148. }
  149. func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) {
  150. d := initxattrdest(dest, 0)
  151. destsize := len(dest)
  152. nsid, a, err := xattrnamespace(attr)
  153. if err != nil {
  154. return -1, err
  155. }
  156. return ExtattrGetFd(fd, nsid, a, uintptr(d), destsize)
  157. }
  158. func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) {
  159. d := initxattrdest(dest, 0)
  160. destsize := len(dest)
  161. nsid, a, err := xattrnamespace(attr)
  162. if err != nil {
  163. return -1, err
  164. }
  165. return ExtattrGetLink(link, nsid, a, uintptr(d), destsize)
  166. }
  167. // flags are unused on FreeBSD
  168. func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) {
  169. d := unsafe.Pointer(&data[0])
  170. datasiz := len(data)
  171. nsid, a, err := xattrnamespace(attr)
  172. if err != nil {
  173. return
  174. }
  175. _, err = ExtattrSetFd(fd, nsid, a, uintptr(d), datasiz)
  176. return
  177. }
  178. func Setxattr(file string, attr string, data []byte, flags int) (err error) {
  179. d := unsafe.Pointer(&data[0])
  180. datasiz := len(data)
  181. nsid, a, err := xattrnamespace(attr)
  182. if err != nil {
  183. return
  184. }
  185. _, err = ExtattrSetFile(file, nsid, a, uintptr(d), datasiz)
  186. return
  187. }
  188. func Lsetxattr(link string, attr string, data []byte, flags int) (err error) {
  189. d := unsafe.Pointer(&data[0])
  190. datasiz := len(data)
  191. nsid, a, err := xattrnamespace(attr)
  192. if err != nil {
  193. return
  194. }
  195. _, err = ExtattrSetLink(link, nsid, a, uintptr(d), datasiz)
  196. return
  197. }
  198. func Removexattr(file string, attr string) (err error) {
  199. nsid, a, err := xattrnamespace(attr)
  200. if err != nil {
  201. return
  202. }
  203. err = ExtattrDeleteFile(file, nsid, a)
  204. return
  205. }
  206. func Fremovexattr(fd int, attr string) (err error) {
  207. nsid, a, err := xattrnamespace(attr)
  208. if err != nil {
  209. return
  210. }
  211. err = ExtattrDeleteFd(fd, nsid, a)
  212. return
  213. }
  214. func Lremovexattr(link string, attr string) (err error) {
  215. nsid, a, err := xattrnamespace(attr)
  216. if err != nil {
  217. return
  218. }
  219. err = ExtattrDeleteLink(link, nsid, a)
  220. return
  221. }
  222. func Listxattr(file string, dest []byte) (sz int, err error) {
  223. d := initxattrdest(dest, 0)
  224. destsiz := len(dest)
  225. // FreeBSD won't allow you to list xattrs from multiple namespaces
  226. s := 0
  227. var e error
  228. for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
  229. stmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz)
  230. /* Errors accessing system attrs are ignored so that
  231. * we can implement the Linux-like behavior of omitting errors that
  232. * we don't have read permissions on
  233. *
  234. * Linux will still error if we ask for user attributes on a file that
  235. * we don't have read permissions on, so don't ignore those errors
  236. */
  237. if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
  238. e = nil
  239. continue
  240. } else if e != nil {
  241. return s, e
  242. }
  243. s += stmp
  244. destsiz -= s
  245. if destsiz < 0 {
  246. destsiz = 0
  247. }
  248. d = initxattrdest(dest, s)
  249. }
  250. return s, e
  251. }
  252. func Flistxattr(fd int, dest []byte) (sz int, err error) {
  253. d := initxattrdest(dest, 0)
  254. destsiz := len(dest)
  255. s := 0
  256. var e error
  257. for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
  258. stmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz)
  259. if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
  260. e = nil
  261. continue
  262. } else if e != nil {
  263. return s, e
  264. }
  265. s += stmp
  266. destsiz -= s
  267. if destsiz < 0 {
  268. destsiz = 0
  269. }
  270. d = initxattrdest(dest, s)
  271. }
  272. return s, e
  273. }
  274. func Llistxattr(link string, dest []byte) (sz int, err error) {
  275. d := initxattrdest(dest, 0)
  276. destsiz := len(dest)
  277. s := 0
  278. var e error
  279. for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
  280. stmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz)
  281. if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
  282. e = nil
  283. continue
  284. } else if e != nil {
  285. return s, e
  286. }
  287. s += stmp
  288. destsiz -= s
  289. if destsiz < 0 {
  290. destsiz = 0
  291. }
  292. d = initxattrdest(dest, s)
  293. }
  294. return s, e
  295. }
  296. //sys ioctl(fd int, req uint, arg uintptr) (err error)
  297. // ioctl itself should not be exposed directly, but additional get/set
  298. // functions for specific types are permissible.
  299. // IoctlSetInt performs an ioctl operation which sets an integer value
  300. // on fd, using the specified request number.
  301. func IoctlSetInt(fd int, req uint, value int) error {
  302. return ioctl(fd, req, uintptr(value))
  303. }
  304. func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
  305. return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
  306. }
  307. func IoctlSetTermios(fd int, req uint, value *Termios) error {
  308. return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
  309. }
  310. // IoctlGetInt performs an ioctl operation which gets an integer value
  311. // from fd, using the specified request number.
  312. func IoctlGetInt(fd int, req uint) (int, error) {
  313. var value int
  314. err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
  315. return value, err
  316. }
  317. func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
  318. var value Winsize
  319. err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
  320. return &value, err
  321. }
  322. func IoctlGetTermios(fd int, req uint) (*Termios, error) {
  323. var value Termios
  324. err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
  325. return &value, err
  326. }
  327. /*
  328. * Exposed directly
  329. */
  330. //sys Access(path string, mode uint32) (err error)
  331. //sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
  332. //sys CapEnter() (err error)
  333. //sys capRightsGet(version int, fd int, rightsp *CapRights) (err error) = SYS___CAP_RIGHTS_GET
  334. //sys capRightsLimit(fd int, rightsp *CapRights) (err error)
  335. //sys Chdir(path string) (err error)
  336. //sys Chflags(path string, flags int) (err error)
  337. //sys Chmod(path string, mode uint32) (err error)
  338. //sys Chown(path string, uid int, gid int) (err error)
  339. //sys Chroot(path string) (err error)
  340. //sys Close(fd int) (err error)
  341. //sys Dup(fd int) (nfd int, err error)
  342. //sys Dup2(from int, to int) (err error)
  343. //sys Exit(code int)
  344. //sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  345. //sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  346. //sys ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error)
  347. //sys ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
  348. //sys ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  349. //sys ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  350. //sys ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error)
  351. //sys ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
  352. //sys ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  353. //sys ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
  354. //sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)
  355. //sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
  356. //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE
  357. //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
  358. //sys Fchdir(fd int) (err error)
  359. //sys Fchflags(fd int, flags int) (err error)
  360. //sys Fchmod(fd int, mode uint32) (err error)
  361. //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
  362. //sys Fchown(fd int, uid int, gid int) (err error)
  363. //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
  364. //sys Flock(fd int, how int) (err error)
  365. //sys Fpathconf(fd int, name int) (val int, err error)
  366. //sys Fstat(fd int, stat *Stat_t) (err error)
  367. //sys Fstatfs(fd int, stat *Statfs_t) (err error)
  368. //sys Fsync(fd int) (err error)
  369. //sys Ftruncate(fd int, length int64) (err error)
  370. //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
  371. //sys Getdtablesize() (size int)
  372. //sysnb Getegid() (egid int)
  373. //sysnb Geteuid() (uid int)
  374. //sysnb Getgid() (gid int)
  375. //sysnb Getpgid(pid int) (pgid int, err error)
  376. //sysnb Getpgrp() (pgrp int)
  377. //sysnb Getpid() (pid int)
  378. //sysnb Getppid() (ppid int)
  379. //sys Getpriority(which int, who int) (prio int, err error)
  380. //sysnb Getrlimit(which int, lim *Rlimit) (err error)
  381. //sysnb Getrusage(who int, rusage *Rusage) (err error)
  382. //sysnb Getsid(pid int) (sid int, err error)
  383. //sysnb Gettimeofday(tv *Timeval) (err error)
  384. //sysnb Getuid() (uid int)
  385. //sys Issetugid() (tainted bool)
  386. //sys Kill(pid int, signum syscall.Signal) (err error)
  387. //sys Kqueue() (fd int, err error)
  388. //sys Lchown(path string, uid int, gid int) (err error)
  389. //sys Link(path string, link string) (err error)
  390. //sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
  391. //sys Listen(s int, backlog int) (err error)
  392. //sys Lstat(path string, stat *Stat_t) (err error)
  393. //sys Mkdir(path string, mode uint32) (err error)
  394. //sys Mkdirat(dirfd int, path string, mode uint32) (err error)
  395. //sys Mkfifo(path string, mode uint32) (err error)
  396. //sys Mknod(path string, mode uint32, dev int) (err error)
  397. //sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
  398. //sys Open(path string, mode int, perm uint32) (fd int, err error)
  399. //sys Openat(fdat int, path string, mode int, perm uint32) (fd int, err error)
  400. //sys Pathconf(path string, name int) (val int, err error)
  401. //sys Pread(fd int, p []byte, offset int64) (n int, err error)
  402. //sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
  403. //sys read(fd int, p []byte) (n int, err error)
  404. //sys Readlink(path string, buf []byte) (n int, err error)
  405. //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
  406. //sys Rename(from string, to string) (err error)
  407. //sys Renameat(fromfd int, from string, tofd int, to string) (err error)
  408. //sys Revoke(path string) (err error)
  409. //sys Rmdir(path string) (err error)
  410. //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
  411. //sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
  412. //sysnb Setegid(egid int) (err error)
  413. //sysnb Seteuid(euid int) (err error)
  414. //sysnb Setgid(gid int) (err error)
  415. //sys Setlogin(name string) (err error)
  416. //sysnb Setpgid(pid int, pgid int) (err error)
  417. //sys Setpriority(which int, who int, prio int) (err error)
  418. //sysnb Setregid(rgid int, egid int) (err error)
  419. //sysnb Setreuid(ruid int, euid int) (err error)
  420. //sysnb Setresgid(rgid int, egid int, sgid int) (err error)
  421. //sysnb Setresuid(ruid int, euid int, suid int) (err error)
  422. //sysnb Setrlimit(which int, lim *Rlimit) (err error)
  423. //sysnb Setsid() (pid int, err error)
  424. //sysnb Settimeofday(tp *Timeval) (err error)
  425. //sysnb Setuid(uid int) (err error)
  426. //sys Stat(path string, stat *Stat_t) (err error)
  427. //sys Statfs(path string, stat *Statfs_t) (err error)
  428. //sys Symlink(path string, link string) (err error)
  429. //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
  430. //sys Sync() (err error)
  431. //sys Truncate(path string, length int64) (err error)
  432. //sys Umask(newmask int) (oldmask int)
  433. //sys Undelete(path string) (err error)
  434. //sys Unlink(path string) (err error)
  435. //sys Unlinkat(dirfd int, path string, flags int) (err error)
  436. //sys Unmount(path string, flags int) (err error)
  437. //sys write(fd int, p []byte) (n int, err error)
  438. //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
  439. //sys munmap(addr uintptr, length uintptr) (err error)
  440. //sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
  441. //sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
  442. //sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
  443. //sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
  444. /*
  445. * Unimplemented
  446. */
  447. // Profil
  448. // Sigaction
  449. // Sigprocmask
  450. // Getlogin
  451. // Sigpending
  452. // Sigaltstack
  453. // Ioctl
  454. // Reboot
  455. // Execve
  456. // Vfork
  457. // Sbrk
  458. // Sstk
  459. // Ovadvise
  460. // Mincore
  461. // Setitimer
  462. // Swapon
  463. // Select
  464. // Sigsuspend
  465. // Readv
  466. // Writev
  467. // Nfssvc
  468. // Getfh
  469. // Quotactl
  470. // Mount
  471. // Csops
  472. // Waitid
  473. // Add_profil
  474. // Kdebug_trace
  475. // Sigreturn
  476. // Atsocket
  477. // Kqueue_from_portset_np
  478. // Kqueue_portset
  479. // Getattrlist
  480. // Setattrlist
  481. // Getdirentriesattr
  482. // Searchfs
  483. // Delete
  484. // Copyfile
  485. // Watchevent
  486. // Waitevent
  487. // Modwatch
  488. // Getxattr
  489. // Fgetxattr
  490. // Setxattr
  491. // Fsetxattr
  492. // Removexattr
  493. // Fremovexattr
  494. // Listxattr
  495. // Flistxattr
  496. // Fsctl
  497. // Initgroups
  498. // Posix_spawn
  499. // Nfsclnt
  500. // Fhopen
  501. // Minherit
  502. // Semsys
  503. // Msgsys
  504. // Shmsys
  505. // Semctl
  506. // Semget
  507. // Semop
  508. // Msgctl
  509. // Msgget
  510. // Msgsnd
  511. // Msgrcv
  512. // Shmat
  513. // Shmctl
  514. // Shmdt
  515. // Shmget
  516. // Shm_open
  517. // Shm_unlink
  518. // Sem_open
  519. // Sem_close
  520. // Sem_unlink
  521. // Sem_wait
  522. // Sem_trywait
  523. // Sem_post
  524. // Sem_getvalue
  525. // Sem_init
  526. // Sem_destroy
  527. // Open_extended
  528. // Umask_extended
  529. // Stat_extended
  530. // Lstat_extended
  531. // Fstat_extended
  532. // Chmod_extended
  533. // Fchmod_extended
  534. // Access_extended
  535. // Settid
  536. // Gettid
  537. // Setsgroups
  538. // Getsgroups
  539. // Setwgroups
  540. // Getwgroups
  541. // Mkfifo_extended
  542. // Mkdir_extended
  543. // Identitysvc
  544. // Shared_region_check_np
  545. // Shared_region_map_np
  546. // __pthread_mutex_destroy
  547. // __pthread_mutex_init
  548. // __pthread_mutex_lock
  549. // __pthread_mutex_trylock
  550. // __pthread_mutex_unlock
  551. // __pthread_cond_init
  552. // __pthread_cond_destroy
  553. // __pthread_cond_broadcast
  554. // __pthread_cond_signal
  555. // Setsid_with_pid
  556. // __pthread_cond_timedwait
  557. // Aio_fsync
  558. // Aio_return
  559. // Aio_suspend
  560. // Aio_cancel
  561. // Aio_error
  562. // Aio_read
  563. // Aio_write
  564. // Lio_listio
  565. // __pthread_cond_wait
  566. // Iopolicysys
  567. // __pthread_kill
  568. // __pthread_sigmask
  569. // __sigwait
  570. // __disable_threadsignal
  571. // __pthread_markcancel
  572. // __pthread_canceled
  573. // __semwait_signal
  574. // Proc_info
  575. // Stat64_extended
  576. // Lstat64_extended
  577. // Fstat64_extended
  578. // __pthread_chdir
  579. // __pthread_fchdir
  580. // Audit
  581. // Auditon
  582. // Getauid
  583. // Setauid
  584. // Getaudit
  585. // Setaudit
  586. // Getaudit_addr
  587. // Setaudit_addr
  588. // Auditctl
  589. // Bsdthread_create
  590. // Bsdthread_terminate
  591. // Stack_snapshot
  592. // Bsdthread_register
  593. // Workq_open
  594. // Workq_ops
  595. // __mac_execve
  596. // __mac_syscall
  597. // __mac_get_file
  598. // __mac_set_file
  599. // __mac_get_link
  600. // __mac_set_link
  601. // __mac_get_proc
  602. // __mac_set_proc
  603. // __mac_get_fd
  604. // __mac_set_fd
  605. // __mac_get_pid
  606. // __mac_get_lcid
  607. // __mac_get_lctx
  608. // __mac_set_lctx
  609. // Setlcid
  610. // Read_nocancel
  611. // Write_nocancel
  612. // Open_nocancel
  613. // Close_nocancel
  614. // Wait4_nocancel
  615. // Recvmsg_nocancel
  616. // Sendmsg_nocancel
  617. // Recvfrom_nocancel
  618. // Accept_nocancel
  619. // Fcntl_nocancel
  620. // Select_nocancel
  621. // Fsync_nocancel
  622. // Connect_nocancel
  623. // Sigsuspend_nocancel
  624. // Readv_nocancel
  625. // Writev_nocancel
  626. // Sendto_nocancel
  627. // Pread_nocancel
  628. // Pwrite_nocancel
  629. // Waitid_nocancel
  630. // Poll_nocancel
  631. // Msgsnd_nocancel
  632. // Msgrcv_nocancel
  633. // Sem_wait_nocancel
  634. // Aio_suspend_nocancel
  635. // __sigwait_nocancel
  636. // __semwait_signal_nocancel
  637. // __mac_mount
  638. // __mac_get_mount
  639. // __mac_getfsstat