OSDN Git Service

[Support/UNIX] posix_fallocate() can fail with EINVAL.
authorDavide Italiano <davide@freebsd.org>
Tue, 7 Nov 2017 00:47:04 +0000 (00:47 +0000)
committerDavide Italiano <davide@freebsd.org>
Tue, 7 Nov 2017 00:47:04 +0000 (00:47 +0000)
commit59aa4918d09a5f79d10a367fedde111385c2b482
tree90e1cca9b5943703c1cce44f1f266b875d1d8ef2
parent0227fe59a98b795b40e1e4b1b08cbe373d4c54c7
[Support/UNIX] posix_fallocate() can fail with EINVAL.

According to the docs on opegroup.org, the function can return
EINVAL if:

The len argument is less than zero, or the offset argument is less
than zero, or the underlying file system does not support this
operation.

I'd say it's a peculiar choice (when EONOTSUPP is right there), but
let's keep POSIX happy for now. This was independently discovered
by Mark Millard (on FreeBSD/ZFS).

Quickly ack'ed by Rui on IRC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317535 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Unix/Path.inc