Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Oct 1995 20:05:02 +0100 (MET)
From:      Ollivier Robert <roberto@keltia.freenix.fr>
To:        freebsd-hackers@FreeBSD.ORG (FreeBSD Hackers' list)
Subject:   crt0.c
Message-ID:  <199510171905.UAA01970@keltia.freenix.fr>

next in thread | raw e-mail | index | archive | help
With  all  the  talk  about crt0.c, locale    and friends, I   just saw the
following :

crt0.c:

	if (getenv("ENABLE_STARTUP_LOCALE") != NULL)
		_startup_setlocale(LC_ALL, "");

asm ("__callmain:");		/* Defined for the benefit of debuggers */
	exit(main(kfp->kargc, argv, environ));
}

[...] 

static char *
_getenv(name)
	register char *name;
{
	extern char **environ;
	register int len;
	register char **P, *C;

Why  is it using "regular"  getenv when it already  has its own private one
_getenv ? 

Note that  changing  getenv to  _getenv  does   not really  reduce   binary
size. I've tried  to recompile   crt0.c  without any *STARTUP*    variables
defined to remove  Andrey's "hack" and link  "ls"  static with  it but "ls"
doesn't change. 

-r-xr-xr-x  1 bin   bin    167936 Oct  8 09:02 /bin/ls*
-rwxr-xr-x  1 root  wheel  167936 Oct 17 20:03 /usr/src/bin/ls/obj/ls*

That's probably expected, maybe I did not follow the proper procedure.
-- 
Ollivier ROBERT    -=- The daemon is FREE! -=-    roberto@keltia.frmug.fr.net
   FreeBSD keltia.freenix.fr 2.2-CURRENT #0: Sat Oct 14 19:05:10 MET 1995



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510171905.UAA01970>