[Dovecot] AIX and posix_fallocate

Timo Sirainen tss at iki.fi
Thu Jul 30 20:44:18 EEST 2009


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 */ ) {
> +			/* Ignore this error silently.
> +			   You have to test err, because errno is not
> +			   correcly set on some versions of 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..
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20090730/7244ac4f/attachment.bin 


More information about the dovecot mailing list