diff options
author | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
---|---|---|
committer | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
commit | 15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (patch) | |
tree | 255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/golang.org/x/sys/unix/fcntl.go | |
parent | 07971ca38143c5faf951d152fba370ddcbe26ad5 (diff) | |
download | terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.gz terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.zst terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.zip |
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
Updated via: go get github.com/hashicorp/terraform@sdk-v0.11-with-go-modules and go mod tidy
Diffstat (limited to 'vendor/golang.org/x/sys/unix/fcntl.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/fcntl.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/unix/fcntl.go b/vendor/golang.org/x/sys/unix/fcntl.go new file mode 100644 index 0000000..9379ba9 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/fcntl.go | |||
@@ -0,0 +1,32 @@ | |||
1 | // Copyright 2014 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 | // +build darwin dragonfly freebsd linux netbsd openbsd | ||
6 | |||
7 | package unix | ||
8 | |||
9 | import "unsafe" | ||
10 | |||
11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux | ||
12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. | ||
13 | var fcntl64Syscall uintptr = SYS_FCNTL | ||
14 | |||
15 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. | ||
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 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. | ||
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 | } | ||