Date: Thu, 28 Feb 2008 04:09:08 +0000 (UTC) From: Sean Farley <scf@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libc/stdlib getenv.c Message-ID: <200802280409.m1S498YJ062561@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802280409.m1S498YJ062561>
