1 // +build linux darwin freebsd openbsd netbsd dragonfly
3 // Copyright 2014 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // +build darwin dragonfly freebsd linux netbsd openbsd
13 // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux
14 // systems by flock_linux_32bit.go to be SYS_FCNTL64.
15 var fcntl64Syscall uintptr = SYS_FCNTL
17 // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
18 func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
19 _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))