[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)
commit1f465aa64a5e1120b20a320c2df20b967f14e3a5
tree5f78c08de74e6dda76b7e19b46e3b849f5f9ca71
parent25a09dd40853d6fb1137d7847f3cca1a1e813caf
[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.

llvm-svn: 317535
llvm/lib/Support/Unix/Path.inc