syscall_hurd.go 635 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2022 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. //go:build hurd
  5. package unix
  6. /*
  7. #include <stdint.h>
  8. int ioctl(int, unsigned long int, uintptr_t);
  9. */
  10. import "C"
  11. func ioctl(fd int, req uint, arg uintptr) (err error) {
  12. r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg))
  13. if r0 == -1 && er != nil {
  14. err = er
  15. }
  16. return
  17. }
  18. func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) {
  19. r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg)))
  20. if r0 == -1 && er != nil {
  21. err = er
  22. }
  23. return
  24. }