syscall_openbsd_arm.go 1022 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2017 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 arm && openbsd
  5. // +build arm,openbsd
  6. package unix
  7. func setTimespec(sec, nsec int64) Timespec {
  8. return Timespec{Sec: sec, Nsec: int32(nsec)}
  9. }
  10. func setTimeval(sec, usec int64) Timeval {
  11. return Timeval{Sec: sec, Usec: int32(usec)}
  12. }
  13. func SetKevent(k *Kevent_t, fd, mode, flags int) {
  14. k.Ident = uint32(fd)
  15. k.Filter = int16(mode)
  16. k.Flags = uint16(flags)
  17. }
  18. func (iov *Iovec) SetLen(length int) {
  19. iov.Len = uint32(length)
  20. }
  21. func (msghdr *Msghdr) SetControllen(length int) {
  22. msghdr.Controllen = uint32(length)
  23. }
  24. func (msghdr *Msghdr) SetIovlen(length int) {
  25. msghdr.Iovlen = uint32(length)
  26. }
  27. func (cmsg *Cmsghdr) SetLen(length int) {
  28. cmsg.Len = uint32(length)
  29. }
  30. // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
  31. // of openbsd/arm the syscall is called sysctl instead of __sysctl.
  32. const SYS___SYSCTL = SYS_SYSCTL