-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unix: make Fcntl* routines use libSystem on Darwin
Missed this one. Update golang/go#17490. Change-Id: I5ab2197f9981b712b37d3060f72209bebcadf291 Reviewed-on: https://go-review.googlesource.com/c/156346 Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) | ||
return err | ||
} |