Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

syscall_darwin_386.go 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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,darwin
  5. package unix
  6. import (
  7. "syscall"
  8. )
  9. //sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
  10. func setTimespec(sec, nsec int64) Timespec {
  11. return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
  12. }
  13. func setTimeval(sec, usec int64) Timeval {
  14. return Timeval{Sec: int32(sec), Usec: int32(usec)}
  15. }
  16. //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
  17. func Gettimeofday(tv *Timeval) (err error) {
  18. // The tv passed to gettimeofday must be non-nil
  19. // but is otherwise unused. The answers come back
  20. // in the two registers.
  21. sec, usec, err := gettimeofday(tv)
  22. tv.Sec = int32(sec)
  23. tv.Usec = int32(usec)
  24. return err
  25. }
  26. func SetKevent(k *Kevent_t, fd, mode, flags int) {
  27. k.Ident = uint32(fd)
  28. k.Filter = int16(mode)
  29. k.Flags = uint16(flags)
  30. }
  31. func (iov *Iovec) SetLen(length int) {
  32. iov.Len = uint32(length)
  33. }
  34. func (msghdr *Msghdr) SetControllen(length int) {
  35. msghdr.Controllen = uint32(length)
  36. }
  37. func (cmsg *Cmsghdr) SetLen(length int) {
  38. cmsg.Len = uint32(length)
  39. }
  40. func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
  41. // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
  42. // of darwin/386 the syscall is called sysctl instead of __sysctl.
  43. const SYS___SYSCTL = SYS_SYSCTL
  44. //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
  45. //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
  46. //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
  47. //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
  48. //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
  49. //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
  50. //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
  51. //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64