[patch] Error on setenv(..., NULL, ...)

Paul Eggert eggert@cs.ucla.edu
Thu Mar 12 23:01:00 GMT 2015


On 03/12/2015 02:53 PM, Roland McGrath wrote:
> The only reason I can see not
> to do that is to force the fault to be before the lock is taken.  If that
> is the explicit intent of the code, then its comments should say so.

I had assumed that lengths are computed before locking to minimize the 
size of the critical section, making it less of a bottleneck. Attached 
is a revised (untested) patch with comments saying that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-stdlib-setenv.c-__add_to_environ.patch
Type: text/x-patch
Size: 1487 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150312/cc7c3e5b/attachment.bin>


More information about the Libc-alpha mailing list