syscall_openbsd_arm.go 996 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. // +build arm,openbsd
  5. package unix
  6. func setTimespec(sec, nsec int64) Timespec {
  7. return Timespec{Sec: sec, Nsec: int32(nsec)}
  8. }
  9. func setTimeval(sec, usec int64) Timeval {
  10. return Timeval{Sec: sec, Usec: int32(usec)}
  11. }
  12. func SetKevent(k *Kevent_t, fd, mode, flags int) {
  13. k.Ident = uint32(fd)
  14. k.Filter = int16(mode)
  15. k.Flags = uint16(flags)
  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 = uint32(length)
  25. }
  26. func (cmsg *Cmsghdr) SetLen(length int) {
  27. cmsg.Len = uint32(length)
  28. }
  29. // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
  30. // of openbsd/arm the syscall is called sysctl instead of __sysctl.
  31. const SYS___SYSCTL = SYS_SYSCTL