reentrant functions

Bernd Schmidt bernds_cb1 at
Sun Jun 8 14:21:41 UTC 2008

Denys Vlasenko wrote:
> Ok, this is a scenario: the user runs a "passwd" utility on NOMMU box.
> This utility has 20k of text and 80k of data. 70k of this data
> is occupied by des.c static buffer.
> At this moment the machine has only 90k RAM available, has no swap etc.
> It cannot satisfy load request for this application.
> So user gets some error message from the shell to this effect.
> If des.c buffer is not static but is __uc_malloc'ed, program will
> load succesfully, and then __uc_malloc will fail and exit
> with "no memory!" message.
> In both cases user's experience is essentially the same - [s]he cannot
> run the program because there is not enough memory.

Except the program that called crypt may have left some state - 
temporary files, partial modifications in other files, whatever - 
because it did not expect to fail at this point.

Essentially your argument comes down to "it doesn't really matter what 
the documented interface is".  That's not an attitude I want to see in 
people who implement a C library.

>>> This is not exactly true. They can exit *if* program author did not
>>> install alternative handler for __uc_malloc failure.
>> And __uc_malloc is documented in which standard? 
> None.

Thank you for proving my point.

This footer brought to you by insane German lawmakers.
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif

More information about the uClibc mailing list