musl/src/internal/libc.c
Rich Felker b4ea63856a 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.
2013-04-06 17:50:37 -04:00

23 lines
403 B
C

#include "libc.h"
#ifdef USE_LIBC_ACCESSOR
struct __libc *__libc_loc()
{
static struct __libc __libc;
return &__libc;
}
#else
struct __libc __libc;
#endif
#ifdef BROKEN_VISIBILITY
__asm__(".hidden __libc");
#endif
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);