30 Jul
2009
30 Jul
'09
7:44 p.m.
On Thu, 2009-07-30 at 11:24 +0200, Ralf Becker wrote:
if ((err = posix_fallocate(fd, st.st_size, size - st.st_size)) == 0) return 0;
if (err == EOPNOTSUPP /* AIX */ ) {
} else
First I thought: Why didn't IBM even fix this properly by setting errno? Then I read posix_fallocate man page:
RETURN VALUE posix_fallocate() returns zero on success, or an error number on fail‐ ure. Note that errno is not set.
What the hell were POSIX people thinking?? This is the first syscall I've seen that behaves like this, and apparently without any good reason! Wonder how many other new system calls there are like this, that I haven't noticed yet..