diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-04-06 17:50:37 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-04-06 17:50:37 -0400 |
commit | b4ea63856a6af3d1bcc2db12537785371ac2024c (patch) | |
tree | 689c9acbdd5e5339261988fb4f6ba007eb345d6b /src/internal/libc.c | |
parent | 5c5ac810c31a77dd17b95bb93e13487a3c1c1433 (diff) | |
download | musl-b4ea63856a6af3d1bcc2db12537785371ac2024c.tar.gz musl-b4ea63856a6af3d1bcc2db12537785371ac2024c.tar.bz2 musl-b4ea63856a6af3d1bcc2db12537785371ac2024c.tar.xz musl-b4ea63856a6af3d1bcc2db12537785371ac2024c.zip |
add support for program_invocation[_short]_name
this is a bit ugly, and the motivation for supporting it is
questionable. however the main factors were:
1. it will be useful to have this for certain internal purposes
anyway -- things like syslog.
2. applications can just save argv[0] in main, but it's hard to fix
non-portable library code that's depending on being able to get the
invocation name without the main application's help.
Diffstat (limited to 'src/internal/libc.c')
-rw-r--r-- | src/internal/libc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/internal/libc.c b/src/internal/libc.c index d22d2747..942f6b44 100644 --- a/src/internal/libc.c +++ b/src/internal/libc.c @@ -16,3 +16,7 @@ __asm__(".hidden __libc"); size_t __hwcap; size_t __sysinfo; +char *__progname=0, *__progname_full=0; + +weak_alias(__progname, program_invocation_short_name); +weak_alias(__progname_full, program_invocation_name); |