Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

40 wiersze
955 B

  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 unix
  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 (msghdr *Msghdr) SetIovlen(length int) {
  23. msghdr.Iovlen = uint32(length)
  24. }
  25. func (cmsg *Cmsghdr) SetLen(length int) {
  26. cmsg.Len = uint32(length)
  27. }
  28. // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
  29. // of OpenBSD the syscall is called sysctl instead of __sysctl.
  30. const SYS___SYSCTL = SYS_SYSCTL