syscall_netbsd_386.go 815 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2009 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 386,netbsd
  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 = uint32(mode)
  15. k.Flags = uint32(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 = int32(length)
  25. }
  26. func (cmsg *Cmsghdr) SetLen(length int) {
  27. cmsg.Len = uint32(length)
  28. }