syscall_hurd.go 460 B

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