[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getdelim doesn't set errno on failure?
From: |
Bruno Haible |
Subject: |
Re: getdelim doesn't set errno on failure? |
Date: |
Wed, 24 Aug 2005 15:40:52 +0200 |
User-agent: |
KMail/1.5 |
Jim Meyering wrote:
> Note that POSIX *does* require a failed malloc call to set errno to
> ENOMEM, albeit with CX shading (meaning IEEE Std 1003.1-2001).
>
> http://www.opengroup.org/susv3xsh/malloc.html
>
> Let's try not to let substandard systems dictate interface design.
> If some system has a poor implementation of a function like malloc
> we can easily ensure that it is replaced.
I'm not in favour of a wrapper around malloc(), that would add overhead to
a function called as frequently as malloc(), just to set 'errno'.
ISO C 99 is not a "substandard", and Windows malloc() is not "poor" just
because it does not set errno.
What value do you expect in errno after malloc() failed? ENOMEM is
the most frequent and maybe also the only reasonable choice when malloc()
fails. What's the purpose then of setting errno then?
ISO C 99 is not a "substandard", and Windows malloc() is not "poor" just
because it does not set errno.
Bruno
- getdelim doesn't set errno on failure?, Oskar Liljeblad, 2005/08/23
- Re: getdelim doesn't set errno on failure?, Jim Meyering, 2005/08/23
- Re: getdelim doesn't set errno on failure?, Oskar Liljeblad, 2005/08/23
- Re: getdelim doesn't set errno on failure?, Bruno Haible, 2005/08/24
- Re: getdelim doesn't set errno on failure?, Jim Meyering, 2005/08/24
- Re: getdelim doesn't set errno on failure?,
Bruno Haible <=
- Re: getdelim doesn't set errno on failure?, Oskar Liljeblad, 2005/08/24
- Re: getdelim doesn't set errno on failure?, Jim Meyering, 2005/08/24
- Re: ISO C 99 versus POSIX 2001, Bruno Haible, 2005/08/24
- Re: ISO C 99 versus POSIX 2001, Paul Eggert, 2005/08/24
- Re: getdelim doesn't set errno on failure?, Oskar Liljeblad, 2005/08/24
- Re: getdelim doesn't set errno on failure?, Derek Price, 2005/08/31
- Re: getdelim doesn't set errno on failure?, Derek Price, 2005/08/31
Re: [bug-gnulib] getdelim doesn't set errno on failure?, Bruno Haible, 2005/08/23