syscall_darwin.go 20 KB

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