[Box Backup-dev] Problem/unportability with malloc(0) on AIX
Stefan Norlin
boxbackup-dev@fluffy.co.uk
Mon, 24 Apr 2006 13:50:42 +0200
Hi,
in my porting efforts on AIX I have comes across that
sometime malloc is called with a size argument of 0.
On Linux a pointer is returned anyway while on AIX
NULL is returned (with errno set to EINVAL) and an
exception is thrown.
I am unsure whether the malloc(0) call is correct first
place but the behavor is anyway different on different
OS:s.
Any comments on this and any ideas how to handle it?
There is a long discussion regarding this here:
http://groups.google.com/group/comp.unix.aix/browse_frm/thread/96cb665447260f64/7f8e35f319021cfd?tvc=1#7f8e35f319021cfd
With some hotfix using "mallopt(1, 0)".
Regards,
Stefan