...
Source file src/pkg/cmd/vendor/golang.org/x/sys/unix/fcntl.go
1
2
3
4
5
6
7 package unix
8
9 import "unsafe"
10
11
12
13 var fcntl64Syscall uintptr = SYS_FCNTL
14
15
16 func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
17 valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg))
18 var err error
19 if errno != 0 {
20 err = errno
21 }
22 return int(valptr), err
23 }
24
25
26 func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
27 _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))
28 if errno == 0 {
29 return nil
30 }
31 return errno
32 }
33
View as plain text