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
5package syscall
6
7import "unsafe"
8
9// On AIX, there is no flock() system call.
10
11// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
12func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) {
13	_, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_fcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(lk)), 0, 0, 0)
14	if e1 != 0 {
15		err = errnoErr(e1)
16	}
17	return
18}
19