freebsd-dev/lib/libc/stdlib
Sean Farley 9bab236702 Added environ-replacement detection. For programs that "clean" (i.e., su)
or replace (i.e., zdump) the environment after a call to setenv(), putenv()
or unsetenv() has been made, a few changes were made.
  - getenv() will return the value from the new environ array.
  - setenv() was split into two functions:  __setenv() which is most of the
    previous setenv() without checks on the name and setenv() which
    contains the checks before calling __setenv().
  - setenv(), putenv() and unsetenv() will unset all previous values and
    call __setenv() on all entries in the new environ array which in turn
    adds them to the end of the envVars array.  Calling __setenv() instead
    of setenv() is done to avoid the temporary replacement of the '=' in a
    string with a NUL byte.  Some strings may be read-only data.

Added more regression checks for clearing the environment array.

Replaced gettimeofday() with getrusage() in timing regression check for
better accuracy.

Fixed an off-by-one bug in __remove_putenv() in the use of memmove().  This
went unnoticed due to the allocation of double the number of environ
entries when building envVars.

Fixed a few spelling mistakes in the comments.

Reviewed by:	ache
Approved by:	wes
Approved by:	re (kensmith)
2007-07-20 23:30:13 +00:00
..
_Exit.c
a64l.3 Revise markup in recently added manpages. 2006-09-30 10:34:13 +00:00
a64l.c Correct decoding a string containing '/'. 2006-05-19 19:06:38 +00:00
abort.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
abort.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
abs.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
abs.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
alloca.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
atexit.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
atexit.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
atexit.h Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
atof.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
atof.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
atoi.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
atoi.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
atol.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
atol.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
atoll.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
bsearch.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
bsearch.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
div.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
div.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
exit.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
exit.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
getenv.3 Significantly reduce the memory leak as noted in BUGS section for 2007-07-04 00:00:41 +00:00
getenv.c Added environ-replacement detection. For programs that "clean" (i.e., su) 2007-07-20 23:30:13 +00:00
getopt_long.3 Sort sections. 2005-01-20 09:17:07 +00:00
getopt_long.c Keep compatible parts in sync with OpenBSD v1.21, add some comments. 2006-09-23 14:48:31 +00:00
getopt.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
getopt.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
getsubopt.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
getsubopt.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
grantpt.3 Get rid of duplicates. 2003-09-14 13:41:59 +00:00
grantpt.c Remove extra slash from pty slave device name returned by ptsname. 2006-02-13 00:04:04 +00:00
hcreate.3 Sort sections. 2005-01-20 09:17:07 +00:00
hcreate.c
heapsort.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
imaxabs.3
imaxabs.c
imaxdiv.3
imaxdiv.c
insque.3
insque.c
l64a.c Add a64l(), l64a(), and l64a_r() XSI extentions. These functions convert 2005-12-24 22:37:59 +00:00
labs.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
labs.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
ldiv.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
ldiv.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
llabs.3
llabs.c
lldiv.3
lldiv.c
lsearch.3 Sort sections. 2005-01-20 09:17:07 +00:00
lsearch.c
Makefile.inc Significantly reduce the memory leak as noted in BUGS section for 2007-07-04 00:00:41 +00:00
malloc.3 Add information about the implications of using mmap(2) instead of sbrk(2). 2007-06-15 22:32:33 +00:00
malloc.c Fix junk/zero filling for realloc(). Junk filling was missing in one case, 2007-06-15 22:00:16 +00:00
memory.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
merge.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
posix_memalign.3 Add a HISTORY section. 2007-03-28 04:32:51 +00:00
qsort_r.c
qsort.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
qsort.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
radixsort.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
radixsort.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
rand.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
rand.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
random.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
random.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
reallocf.c
realpath.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
realpath.c
remque.c
strfmon.3
strfmon.c Include a couple of headers to ensure consistency between the prototype and 2005-09-12 19:52:42 +00:00
strtod.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
strtoimax.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
strtol.3 Swap "underflow"/"overflow" in the table header. 2007-04-10 11:17:00 +00:00
strtol.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
strtoll.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
strtonum.3 Revise markup in recently added manpages. 2006-09-30 10:34:13 +00:00
strtonum.c POSIXed strtoll() (and ours one too) can set errno to EINVAL, so check 2006-03-14 19:53:03 +00:00
strtoq.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
strtoul.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
strtoul.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
strtoull.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
strtoumax.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
strtouq.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
Symbol.map Backout 1.5 as requested by deischen 2007-05-22 05:28:40 +00:00
system.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
system.c Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
tdelete.c
tfind.c
tsearch.3 twalk() expects an `action' function not a comparison function. 2006-06-23 13:36:33 +00:00
tsearch.c
twalk.c