Black Lives Matter. Support the Equal Justice Initiative.

Source file src/syscall/flock_aix.go

Documentation: syscall

     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 syscall
     6  
     7  import "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.
    12  func 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  

View as plain text