mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-05 08:37:31 -04:00
unix: add FcntlFstore on darwin
This allows to perform a fcntl syscall with the F_PREALLOCATE command. See man fcntl(2) on macOS for details. Change-Id: I21f95b91269513064859425ab7adc42a73d6adb5 Reviewed-on: https://go-review.googlesource.com/c/sys/+/255917 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
efd3b9a0ff
commit
af09f7315a
@@ -16,3 +16,9 @@ func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
|
||||
_, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk))))
|
||||
return err
|
||||
}
|
||||
|
||||
// FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command.
|
||||
func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error {
|
||||
_, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore))))
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user