mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	hack/pin-dependency.sh golang.org/x/crypto latest hack/pin-dependency.sh golang.org/x/net latest hack/pin-dependency.sh golang.org/x/exp latest hack/pin-dependency.sh golang.org/x/sys latest hack/pin-dependency.sh golang.org/x/time latest hack/pin-dependency.sh golang.org/x/tools latest hack/lint-dependencies.sh hack/pin-dependency.sh dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037 hack/pin-dependency.sh golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f hack/pin-dependency.sh golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449 hack/lint-dependencies.sh hack/update-internal-modules.sh hack/update-vendor.sh Co-authored-by: Stephen Augustus <foo@auggie.dev>
		
			
				
	
	
		
			38 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright 2014 The Go Authors. All rights reserved.
 | 
						|
// Use of this source code is governed by a BSD-style
 | 
						|
// license that can be found in the LICENSE file.
 | 
						|
 | 
						|
//go:build dragonfly || freebsd || linux || netbsd || openbsd
 | 
						|
// +build dragonfly freebsd linux netbsd openbsd
 | 
						|
 | 
						|
package unix
 | 
						|
 | 
						|
import "unsafe"
 | 
						|
 | 
						|
// fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux
 | 
						|
// systems by fcntl_linux_32bit.go to be SYS_FCNTL64.
 | 
						|
var fcntl64Syscall uintptr = SYS_FCNTL
 | 
						|
 | 
						|
func fcntl(fd int, cmd, arg int) (int, error) {
 | 
						|
	valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg))
 | 
						|
	var err error
 | 
						|
	if errno != 0 {
 | 
						|
		err = errno
 | 
						|
	}
 | 
						|
	return int(valptr), err
 | 
						|
}
 | 
						|
 | 
						|
// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
 | 
						|
func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
 | 
						|
	return fcntl(int(fd), cmd, arg)
 | 
						|
}
 | 
						|
 | 
						|
// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
 | 
						|
func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
 | 
						|
	_, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))
 | 
						|
	if errno == 0 {
 | 
						|
		return nil
 | 
						|
	}
 | 
						|
	return errno
 | 
						|
}
 |