1 // Copyright 2018 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 5 package unix 6 7 import ( 8 "syscall" 9 "unsafe" 10 ) 11 12 //go:cgo_import_dynamic libc_ioctl ioctl "libc.a/shr_64.o" 13 //go:linkname libc_ioctl libc_ioctl 14 var libc_ioctl uintptr 15 16 // Implemented in syscall/syscall_aix.go. 17 func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 18 19 func Ioctl(fd int, cmd int, args unsafe.Pointer) (err error) { 20 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_ioctl)), 3, uintptr(fd), uintptr(cmd), uintptr(args), 0, 0, 0) 21 if e1 != 0 { 22 err = e1 23 } 24 return 25 } 26