Commit Graph

4 Commits (bc9e433ca26be0314a37c8c6ead66429a584bbc9)

Author SHA1 Message Date
Tobias Klauser add86bbd1a
pkg/fileutil: use fcntl syscall wrappers from golang.org/x/sys/unix (#12316)
Direct syscalls using syscall.Syscall(SYS_*, ...) should no longer be
used on darwin, see [1]. Instead, use the fcntl libSystem wrappers
provided by the golang.org/x/sys/unix package which implement the same
functionality.

[1] https://golang.org/doc/go1.12#darwin
2020-09-24 23:02:32 -07:00
Gyu-Ho Lee 962976f2df pkg/fileutil: fix preallocate under OS X kernel
ftruncate changes st_blocks, and following fallocate
syscalls would return EINVAL when allocated block size
is already greater than requested block size
(e.g. st_blocks==8, requested blocks are 2).

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-12-14 10:36:57 -08:00
Gyu-Ho Lee 8b77de4e99 pkg: update LICENSE header 2016-05-12 20:48:53 -07:00
Anthony Romano aafe717f2f fileutil: support file extending preallocate 2016-03-21 09:42:30 -07:00