syscall_openbsd_arm64.go 906 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2019 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. package syscall
  5. func setTimespec(sec, nsec int64) Timespec {
  6. return Timespec{Sec: sec, Nsec: nsec}
  7. }
  8. func setTimeval(sec, usec int64) Timeval {
  9. return Timeval{Sec: sec, Usec: usec}
  10. }
  11. func SetKevent(k *Kevent_t, fd, mode, flags int) {
  12. k.Ident = uint64(fd)
  13. k.Filter = int16(mode)
  14. k.Flags = uint16(flags)
  15. }
  16. func (iov *Iovec) SetLen(length int) {
  17. iov.Len = uint64(length)
  18. }
  19. func (msghdr *Msghdr) SetControllen(length int) {
  20. msghdr.Controllen = uint32(length)
  21. }
  22. func (cmsg *Cmsghdr) SetLen(length int) {
  23. cmsg.Len = uint32(length)
  24. }
  25. // RTM_LOCK only exists in OpenBSD 6.3 and earlier.
  26. const RTM_LOCK = 0x8
  27. // SYS___SYSCTL only exists in OpenBSD 5.8 and earlier, when it was
  28. // was renamed to SYS_SYSCTL.
  29. const SYS___SYSCTL = SYS_SYSCTL