syscall_aix_ppc.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 && ppc
  5. // +build aix,ppc
  6. package unix
  7. //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64
  8. //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64
  9. //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64
  10. //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
  11. func setTimespec(sec, nsec int64) Timespec {
  12. return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
  13. }
  14. func setTimeval(sec, usec int64) Timeval {
  15. return Timeval{Sec: int32(sec), Usec: int32(usec)}
  16. }
  17. func (iov *Iovec) SetLen(length int) {
  18. iov.Len = uint32(length)
  19. }
  20. func (msghdr *Msghdr) SetControllen(length int) {
  21. msghdr.Controllen = uint32(length)
  22. }
  23. func (msghdr *Msghdr) SetIovlen(length int) {
  24. msghdr.Iovlen = int32(length)
  25. }
  26. func (cmsg *Cmsghdr) SetLen(length int) {
  27. cmsg.Len = uint32(length)
  28. }
  29. func Fstat(fd int, stat *Stat_t) error {
  30. return fstat(fd, stat)
  31. }
  32. func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error {
  33. return fstatat(dirfd, path, stat, flags)
  34. }
  35. func Lstat(path string, stat *Stat_t) error {
  36. return lstat(path, stat)
  37. }
  38. func Stat(path string, statptr *Stat_t) error {
  39. return stat(path, statptr)
  40. }