You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

syscall_darwin.go 19KB

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