Skip to content

Commit

Permalink
Add GNU libc extension variables __progname and __progname_full
Browse files Browse the repository at this point in the history
This patch adds GNU libc extension variables __progname and __progname_full
used by coreutils. These seem to come from BSD as 'BSD' paragraph
explains - https://rosettacode.org/wiki/Program_name#C.

Signed-off-by: Waldemar Kozaczuk <jwkozaczuk@gmail.com>
Message-Id: <20190501040302.13344-1-jwkozaczuk@gmail.com>
  • Loading branch information
wkozaczuk authored and nyh committed May 1, 2019
1 parent 47804c4 commit 4e425d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc/libc.cc
Expand Up @@ -32,6 +32,9 @@
char *program_invocation_name;
char *program_invocation_short_name;

weak_alias(program_invocation_name, __progname_full);
weak_alias(program_invocation_short_name, __progname);

int libc_error(int err)
{
errno = err;
Expand Down

0 comments on commit 4e425d4

Please sign in to comment.