bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: malloc failure and errno


From: Bruno Haible
Subject: Re: malloc failure and errno
Date: Sun, 9 Sep 2007 16:03:55 +0200
User-agent: KMail/1.5.4

Jim Meyering wrote:
> POSIX guarantees that errno is defined when malloc or realloc
> fails, so there's no need to set it manually in that case.

Yet glibc does set it manually in some cases:

glibc-2.6.1/login/openpty.c:69
glibc-2.6.1/login/login.c:67
glibc-2.6.1/stdlib/setenv.c:180
glibc-2.6.1/sysdeps/unix/grantpt.c:82

What is the reason? Can malloc() return NULL with errno being set to something
different than ENOMEM?

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]