-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
Future OpenBSD releases will remove the syscall(2) interface. This converts the Fcntl functions to use fcntl(2) from libc, rather than indirectly through syscall(2). Updates #63569.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2019 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. | ||
|
||
package unix | ||
|
||
import "unsafe" | ||
|
||
// 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 { | ||
_, err := fcntlPtr(int(fd), cmd, unsafe.Pointer(lk)) | ||
return err | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.