cvs commit: src/lib/libc/stdlib getenv.c
Sean Farley
scf at FreeBSD.org
Thu Feb 28 04:09:08 UTC 2008
scf 2008-02-28 04:09:08 UTC
FreeBSD src repository
Modified files:
lib/libc/stdlib getenv.c
Log:
Replace the use of warnx() with direct output to stderr using _write().
This reduces the size of a statically-linked binary by approximately 100KB
in a trivial "return (0)" test application. readelf -S was used to verify
that the .text section was reduced and that using strlen() saved a few
more bytes over using sizeof(). Since the section of code is only called
when environ is corrupt (program bug), I went with fewer bytes over fewer
cycles.
I made minor edits to the submitted patch to make the output resemble
warnx().
Submitted by: kib bz
Approved by: wes (mentor)
MFC after: 5 days
Revision Changes Path
1.13 +36 -12 src/lib/libc/stdlib/getenv.c
More information about the cvs-src
mailing list