syscall_freebsd.go 20 KB

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