Subject: Re: malloc and errno
To: None <itojun@iijlab.net>
From: Simon Burge <simonb@netbsd.org>
List: tech-userlevel
Date: 06/02/2000 13:09:01
itojun@iijlab.net wrote:

> 
> 	1.4.2 malloc(3) does not update errno.  sbrk may update it.
> 	1.5Z malloc(3) explicitly updates errno to ENOMEM, when it fails.
> 
> 	does anyone know which is more correct behavior to expect?

From the malloc(3) manpage on www.opengroup.org:

	ERRORS
		On all systems that conform to the Single UNIX
		Specification, the malloc() function sets errno as
		listed for the following conditions:

		[ENOMEM]
			Insufficient memory is available.

Simon.