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.
5 // +build dragonfly freebsd hurd linux netbsd openbsd
13 // Use a helper function to call fcntl. This is defined in C in
15 //extern __go_fcntl_uintptr
16 func libc_fcntl(uintptr, uintptr, uintptr) (uintptr, uintptr)
18 func fcntl(fd int, cmd int, arg int) (int, error) {
19 syscall.Entersyscall()
20 r, e := libc_fcntl(uintptr(fd), uintptr(cmd), uintptr(arg))
23 return int(r), syscall.Errno(e)