From 76fe441a7bf75d73962641b785f158b5cc9dc7f8 Mon Sep 17 00:00:00 2001 From: markm Date: Fri, 29 Mar 2002 22:43:43 +0000 Subject: Do not use __progname directly (except in [gs]etprogname(3)). Also, make an internal _getprogname() that is used only inside libc. For libc, getprogname(3) is a weak symbol in case a function of the same name is defined in userland. --- lib/libc/gen/getprogname.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/libc/gen/getprogname.c') diff --git a/lib/libc/gen/getprogname.c b/lib/libc/gen/getprogname.c index b0a8dec..fd51d13 100644 --- a/lib/libc/gen/getprogname.c +++ b/lib/libc/gen/getprogname.c @@ -1,12 +1,16 @@ #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #include +#include "un-namespace.h" -extern const char *__progname; +#include "libc_private.h" + +__weak_reference(_getprogname, getprogname); const char * -getprogname(void) +_getprogname(void) { return (__progname); -- cgit v1.1