cvs commit: src/lib/libc/stdlib getenv.c
Sean Farley
scf at FreeBSD.org
Thu Mar 6 15:14:37 UTC 2008
scf 2008-03-06 15:14:36 UTC
FreeBSD src repository
Modified files: (Branch: RELENG_7)
lib/libc/stdlib getenv.c
Log:
MFC:
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().
src/lib/libc/stdlib/getenv.c: rev 1.12 -> 1.13
Submitted by: kib bz
Approved by: wes (mentor)
Revision Changes Path
1.12.2.1 +36 -12 src/lib/libc/stdlib/getenv.c
More information about the cvs-src
mailing list