本站源代码
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.

681 lines
19KB

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