syscall_aix.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. // Copyright 2018 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. //go:build aix
  5. // Aix system calls.
  6. // This file is compiled as ordinary Go code,
  7. // but it is also input to mksyscall,
  8. // which parses the //sys lines and generates system call stubs.
  9. // Note that sometimes we use a lowercase //sys name and
  10. // wrap it in our own nicer implementation.
  11. package unix
  12. import "unsafe"
  13. /*
  14. * Wrapped
  15. */
  16. func Access(path string, mode uint32) (err error) {
  17. return Faccessat(AT_FDCWD, path, mode, 0)
  18. }
  19. func Chmod(path string, mode uint32) (err error) {
  20. return Fchmodat(AT_FDCWD, path, mode, 0)
  21. }
  22. func Chown(path string, uid int, gid int) (err error) {
  23. return Fchownat(AT_FDCWD, path, uid, gid, 0)
  24. }
  25. func Creat(path string, mode uint32) (fd int, err error) {
  26. return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode)
  27. }
  28. //sys utimes(path string, times *[2]Timeval) (err error)
  29. func Utimes(path string, tv []Timeval) error {
  30. if len(tv) != 2 {
  31. return EINVAL
  32. }
  33. return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
  34. }
  35. //sys utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error)
  36. func UtimesNano(path string, ts []Timespec) error {
  37. if len(ts) != 2 {
  38. return EINVAL
  39. }
  40. return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
  41. }
  42. func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
  43. if ts == nil {
  44. return utimensat(dirfd, path, nil, flags)
  45. }
  46. if len(ts) != 2 {
  47. return EINVAL
  48. }
  49. return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)
  50. }
  51. func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
  52. if sa.Port < 0 || sa.Port > 0xFFFF {
  53. return nil, 0, EINVAL
  54. }
  55. sa.raw.Family = AF_INET
  56. p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))
  57. p[0] = byte(sa.Port >> 8)
  58. p[1] = byte(sa.Port)
  59. sa.raw.Addr = sa.Addr
  60. return unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil
  61. }
  62. func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) {
  63. if sa.Port < 0 || sa.Port > 0xFFFF {
  64. return nil, 0, EINVAL
  65. }
  66. sa.raw.Family = AF_INET6
  67. p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port))
  68. p[0] = byte(sa.Port >> 8)
  69. p[1] = byte(sa.Port)
  70. sa.raw.Scope_id = sa.ZoneId
  71. sa.raw.Addr = sa.Addr
  72. return unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil
  73. }
  74. func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
  75. name := sa.Name
  76. n := len(name)
  77. if n > len(sa.raw.Path) {
  78. return nil, 0, EINVAL
  79. }
  80. if n == len(sa.raw.Path) && name[0] != '@' {
  81. return nil, 0, EINVAL
  82. }
  83. sa.raw.Family = AF_UNIX
  84. for i := 0; i < n; i++ {
  85. sa.raw.Path[i] = uint8(name[i])
  86. }
  87. // length is family (uint16), name, NUL.
  88. sl := _Socklen(2)
  89. if n > 0 {
  90. sl += _Socklen(n) + 1
  91. }
  92. if sa.raw.Path[0] == '@' || (sa.raw.Path[0] == 0 && sl > 3) {
  93. // Check sl > 3 so we don't change unnamed socket behavior.
  94. sa.raw.Path[0] = 0
  95. // Don't count trailing NUL for abstract address.
  96. sl--
  97. }
  98. return unsafe.Pointer(&sa.raw), sl, nil
  99. }
  100. func Getsockname(fd int) (sa Sockaddr, err error) {
  101. var rsa RawSockaddrAny
  102. var len _Socklen = SizeofSockaddrAny
  103. if err = getsockname(fd, &rsa, &len); err != nil {
  104. return
  105. }
  106. return anyToSockaddr(fd, &rsa)
  107. }
  108. //sys getcwd(buf []byte) (err error)
  109. const ImplementsGetwd = true
  110. func Getwd() (ret string, err error) {
  111. for len := uint64(4096); ; len *= 2 {
  112. b := make([]byte, len)
  113. err := getcwd(b)
  114. if err == nil {
  115. i := 0
  116. for b[i] != 0 {
  117. i++
  118. }
  119. return string(b[0:i]), nil
  120. }
  121. if err != ERANGE {
  122. return "", err
  123. }
  124. }
  125. }
  126. func Getcwd(buf []byte) (n int, err error) {
  127. err = getcwd(buf)
  128. if err == nil {
  129. i := 0
  130. for buf[i] != 0 {
  131. i++
  132. }
  133. n = i + 1
  134. }
  135. return
  136. }
  137. func Getgroups() (gids []int, err error) {
  138. n, err := getgroups(0, nil)
  139. if err != nil {
  140. return nil, err
  141. }
  142. if n == 0 {
  143. return nil, nil
  144. }
  145. // Sanity check group count. Max is 16 on BSD.
  146. if n < 0 || n > 1000 {
  147. return nil, EINVAL
  148. }
  149. a := make([]_Gid_t, n)
  150. n, err = getgroups(n, &a[0])
  151. if err != nil {
  152. return nil, err
  153. }
  154. gids = make([]int, n)
  155. for i, v := range a[0:n] {
  156. gids[i] = int(v)
  157. }
  158. return
  159. }
  160. func Setgroups(gids []int) (err error) {
  161. if len(gids) == 0 {
  162. return setgroups(0, nil)
  163. }
  164. a := make([]_Gid_t, len(gids))
  165. for i, v := range gids {
  166. a[i] = _Gid_t(v)
  167. }
  168. return setgroups(len(a), &a[0])
  169. }
  170. /*
  171. * Socket
  172. */
  173. //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
  174. func Accept(fd int) (nfd int, sa Sockaddr, err error) {
  175. var rsa RawSockaddrAny
  176. var len _Socklen = SizeofSockaddrAny
  177. nfd, err = accept(fd, &rsa, &len)
  178. if nfd == -1 {
  179. return
  180. }
  181. sa, err = anyToSockaddr(fd, &rsa)
  182. if err != nil {
  183. Close(nfd)
  184. nfd = 0
  185. }
  186. return
  187. }
  188. func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) {
  189. var msg Msghdr
  190. msg.Name = (*byte)(unsafe.Pointer(rsa))
  191. msg.Namelen = uint32(SizeofSockaddrAny)
  192. var dummy byte
  193. if len(oob) > 0 {
  194. // receive at least one normal byte
  195. if emptyIovecs(iov) {
  196. var iova [1]Iovec
  197. iova[0].Base = &dummy
  198. iova[0].SetLen(1)
  199. iov = iova[:]
  200. }
  201. msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
  202. msg.SetControllen(len(oob))
  203. }
  204. if len(iov) > 0 {
  205. msg.Iov = &iov[0]
  206. msg.SetIovlen(len(iov))
  207. }
  208. if n, err = recvmsg(fd, &msg, flags); n == -1 {
  209. return
  210. }
  211. oobn = int(msg.Controllen)
  212. recvflags = int(msg.Flags)
  213. return
  214. }
  215. func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) {
  216. var msg Msghdr
  217. msg.Name = (*byte)(unsafe.Pointer(ptr))
  218. msg.Namelen = uint32(salen)
  219. var dummy byte
  220. var empty bool
  221. if len(oob) > 0 {
  222. // send at least one normal byte
  223. empty = emptyIovecs(iov)
  224. if empty {
  225. var iova [1]Iovec
  226. iova[0].Base = &dummy
  227. iova[0].SetLen(1)
  228. iov = iova[:]
  229. }
  230. msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
  231. msg.SetControllen(len(oob))
  232. }
  233. if len(iov) > 0 {
  234. msg.Iov = &iov[0]
  235. msg.SetIovlen(len(iov))
  236. }
  237. if n, err = sendmsg(fd, &msg, flags); err != nil {
  238. return 0, err
  239. }
  240. if len(oob) > 0 && empty {
  241. n = 0
  242. }
  243. return n, nil
  244. }
  245. func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
  246. switch rsa.Addr.Family {
  247. case AF_UNIX:
  248. pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))
  249. sa := new(SockaddrUnix)
  250. // Some versions of AIX have a bug in getsockname (see IV78655).
  251. // We can't rely on sa.Len being set correctly.
  252. n := SizeofSockaddrUnix - 3 // subtract leading Family, Len, terminating NUL.
  253. for i := 0; i < n; i++ {
  254. if pp.Path[i] == 0 {
  255. n = i
  256. break
  257. }
  258. }
  259. sa.Name = string(unsafe.Slice((*byte)(unsafe.Pointer(&pp.Path[0])), n))
  260. return sa, nil
  261. case AF_INET:
  262. pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
  263. sa := new(SockaddrInet4)
  264. p := (*[2]byte)(unsafe.Pointer(&pp.Port))
  265. sa.Port = int(p[0])<<8 + int(p[1])
  266. sa.Addr = pp.Addr
  267. return sa, nil
  268. case AF_INET6:
  269. pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))
  270. sa := new(SockaddrInet6)
  271. p := (*[2]byte)(unsafe.Pointer(&pp.Port))
  272. sa.Port = int(p[0])<<8 + int(p[1])
  273. sa.ZoneId = pp.Scope_id
  274. sa.Addr = pp.Addr
  275. return sa, nil
  276. }
  277. return nil, EAFNOSUPPORT
  278. }
  279. func Gettimeofday(tv *Timeval) (err error) {
  280. err = gettimeofday(tv, nil)
  281. return
  282. }
  283. func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
  284. if raceenabled {
  285. raceReleaseMerge(unsafe.Pointer(&ioSync))
  286. }
  287. return sendfile(outfd, infd, offset, count)
  288. }
  289. // TODO
  290. func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
  291. return -1, ENOSYS
  292. }
  293. func direntIno(buf []byte) (uint64, bool) {
  294. return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
  295. }
  296. func direntReclen(buf []byte) (uint64, bool) {
  297. return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
  298. }
  299. func direntNamlen(buf []byte) (uint64, bool) {
  300. reclen, ok := direntReclen(buf)
  301. if !ok {
  302. return 0, false
  303. }
  304. return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true
  305. }
  306. //sys getdirent(fd int, buf []byte) (n int, err error)
  307. func Getdents(fd int, buf []byte) (n int, err error) {
  308. return getdirent(fd, buf)
  309. }
  310. //sys wait4(pid Pid_t, status *_C_int, options int, rusage *Rusage) (wpid Pid_t, err error)
  311. func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {
  312. var status _C_int
  313. var r Pid_t
  314. err = ERESTART
  315. // AIX wait4 may return with ERESTART errno, while the processus is still
  316. // active.
  317. for err == ERESTART {
  318. r, err = wait4(Pid_t(pid), &status, options, rusage)
  319. }
  320. wpid = int(r)
  321. if wstatus != nil {
  322. *wstatus = WaitStatus(status)
  323. }
  324. return
  325. }
  326. /*
  327. * Wait
  328. */
  329. type WaitStatus uint32
  330. func (w WaitStatus) Stopped() bool { return w&0x40 != 0 }
  331. func (w WaitStatus) StopSignal() Signal {
  332. if !w.Stopped() {
  333. return -1
  334. }
  335. return Signal(w>>8) & 0xFF
  336. }
  337. func (w WaitStatus) Exited() bool { return w&0xFF == 0 }
  338. func (w WaitStatus) ExitStatus() int {
  339. if !w.Exited() {
  340. return -1
  341. }
  342. return int((w >> 8) & 0xFF)
  343. }
  344. func (w WaitStatus) Signaled() bool { return w&0x40 == 0 && w&0xFF != 0 }
  345. func (w WaitStatus) Signal() Signal {
  346. if !w.Signaled() {
  347. return -1
  348. }
  349. return Signal(w>>16) & 0xFF
  350. }
  351. func (w WaitStatus) Continued() bool { return w&0x01000000 != 0 }
  352. func (w WaitStatus) CoreDump() bool { return w&0x80 == 0x80 }
  353. func (w WaitStatus) TrapCause() int { return -1 }
  354. //sys ioctl(fd int, req int, arg uintptr) (err error)
  355. //sys ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) = ioctl
  356. // fcntl must never be called with cmd=F_DUP2FD because it doesn't work on AIX
  357. // There is no way to create a custom fcntl and to keep //sys fcntl easily,
  358. // Therefore, the programmer must call dup2 instead of fcntl in this case.
  359. // FcntlInt performs a fcntl syscall on fd with the provided command and argument.
  360. //sys FcntlInt(fd uintptr, cmd int, arg int) (r int,err error) = fcntl
  361. // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
  362. //sys FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) = fcntl
  363. //sys fcntl(fd int, cmd int, arg int) (val int, err error)
  364. //sys fsyncRange(fd int, how int, start int64, length int64) (err error) = fsync_range
  365. func Fsync(fd int) error {
  366. return fsyncRange(fd, O_SYNC, 0, 0)
  367. }
  368. /*
  369. * Direct access
  370. */
  371. //sys Acct(path string) (err error)
  372. //sys Chdir(path string) (err error)
  373. //sys Chroot(path string) (err error)
  374. //sys Close(fd int) (err error)
  375. //sys Dup(oldfd int) (fd int, err error)
  376. //sys Exit(code int)
  377. //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
  378. //sys Fchdir(fd int) (err error)
  379. //sys Fchmod(fd int, mode uint32) (err error)
  380. //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
  381. //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
  382. //sys Fdatasync(fd int) (err error)
  383. // readdir_r
  384. //sysnb Getpgid(pid int) (pgid int, err error)
  385. //sys Getpgrp() (pid int)
  386. //sysnb Getpid() (pid int)
  387. //sysnb Getppid() (ppid int)
  388. //sys Getpriority(which int, who int) (prio int, err error)
  389. //sysnb Getrusage(who int, rusage *Rusage) (err error)
  390. //sysnb Getsid(pid int) (sid int, err error)
  391. //sysnb Kill(pid int, sig Signal) (err error)
  392. //sys Klogctl(typ int, buf []byte) (n int, err error) = syslog
  393. //sys Mkdir(dirfd int, path string, mode uint32) (err error)
  394. //sys Mkdirat(dirfd int, path string, mode uint32) (err error)
  395. //sys Mkfifo(path string, mode uint32) (err error)
  396. //sys Mknod(path string, mode uint32, dev int) (err error)
  397. //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
  398. //sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
  399. //sys Open(path string, mode int, perm uint32) (fd int, err error) = open64
  400. //sys Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)
  401. //sys read(fd int, p []byte) (n int, err error)
  402. //sys Readlink(path string, buf []byte) (n int, err error)
  403. //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
  404. //sys Setdomainname(p []byte) (err error)
  405. //sys Sethostname(p []byte) (err error)
  406. //sysnb Setpgid(pid int, pgid int) (err error)
  407. //sysnb Setsid() (pid int, err error)
  408. //sysnb Settimeofday(tv *Timeval) (err error)
  409. //sys Setuid(uid int) (err error)
  410. //sys Setgid(uid int) (err error)
  411. //sys Setpriority(which int, who int, prio int) (err error)
  412. //sys Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error)
  413. //sys Sync()
  414. //sysnb Times(tms *Tms) (ticks uintptr, err error)
  415. //sysnb Umask(mask int) (oldmask int)
  416. //sysnb Uname(buf *Utsname) (err error)
  417. //sys Unlink(path string) (err error)
  418. //sys Unlinkat(dirfd int, path string, flags int) (err error)
  419. //sys Ustat(dev int, ubuf *Ustat_t) (err error)
  420. //sys write(fd int, p []byte) (n int, err error)
  421. //sys Dup2(oldfd int, newfd int) (err error)
  422. //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = posix_fadvise64
  423. //sys Fchown(fd int, uid int, gid int) (err error)
  424. //sys fstat(fd int, stat *Stat_t) (err error)
  425. //sys fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = fstatat
  426. //sys Fstatfs(fd int, buf *Statfs_t) (err error)
  427. //sys Ftruncate(fd int, length int64) (err error)
  428. //sysnb Getegid() (egid int)
  429. //sysnb Geteuid() (euid int)
  430. //sysnb Getgid() (gid int)
  431. //sysnb Getuid() (uid int)
  432. //sys Lchown(path string, uid int, gid int) (err error)
  433. //sys Listen(s int, n int) (err error)
  434. //sys lstat(path string, stat *Stat_t) (err error)
  435. //sys Pause() (err error)
  436. //sys pread(fd int, p []byte, offset int64) (n int, err error) = pread64
  437. //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = pwrite64
  438. //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
  439. //sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error)
  440. //sysnb Setregid(rgid int, egid int) (err error)
  441. //sysnb Setreuid(ruid int, euid int) (err error)
  442. //sys Shutdown(fd int, how int) (err error)
  443. //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
  444. //sys stat(path string, statptr *Stat_t) (err error)
  445. //sys Statfs(path string, buf *Statfs_t) (err error)
  446. //sys Truncate(path string, length int64) (err error)
  447. //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
  448. //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
  449. //sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
  450. //sysnb setgroups(n int, list *_Gid_t) (err error)
  451. //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
  452. //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
  453. //sysnb socket(domain int, typ int, proto int) (fd int, err error)
  454. //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
  455. //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
  456. //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
  457. //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
  458. //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
  459. // In order to use msghdr structure with Control, Controllen, nrecvmsg and nsendmsg must be used.
  460. //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = nrecvmsg
  461. //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = nsendmsg
  462. //sys munmap(addr uintptr, length uintptr) (err error)
  463. //sys Madvise(b []byte, advice int) (err error)
  464. //sys Mprotect(b []byte, prot int) (err error)
  465. //sys Mlock(b []byte) (err error)
  466. //sys Mlockall(flags int) (err error)
  467. //sys Msync(b []byte, flags int) (err error)
  468. //sys Munlock(b []byte) (err error)
  469. //sys Munlockall() (err error)
  470. //sysnb pipe(p *[2]_C_int) (err error)
  471. func Pipe(p []int) (err error) {
  472. if len(p) != 2 {
  473. return EINVAL
  474. }
  475. var pp [2]_C_int
  476. err = pipe(&pp)
  477. if err == nil {
  478. p[0] = int(pp[0])
  479. p[1] = int(pp[1])
  480. }
  481. return
  482. }
  483. //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
  484. func Poll(fds []PollFd, timeout int) (n int, err error) {
  485. if len(fds) == 0 {
  486. return poll(nil, 0, timeout)
  487. }
  488. return poll(&fds[0], len(fds), timeout)
  489. }
  490. //sys gettimeofday(tv *Timeval, tzp *Timezone) (err error)
  491. //sysnb Time(t *Time_t) (tt Time_t, err error)
  492. //sys Utime(path string, buf *Utimbuf) (err error)
  493. //sys Getsystemcfg(label int) (n uint64)
  494. //sys umount(target string) (err error)
  495. func Unmount(target string, flags int) (err error) {
  496. if flags != 0 {
  497. // AIX doesn't have any flags for umount.
  498. return ENOSYS
  499. }
  500. return umount(target)
  501. }