Hacker News new | ask | show | jobs
by st_goliath 661 days ago
There is also a neat little BSD extension, also supported on a number of other Unix-like systems and GNU userspace (i.e. glibc, but also other libcs like Musl):

    extern char *__progname;
which holds the program name without the (optional) invocation path in front of it. Basically the last path component of argv[0].
2 comments

Nice, thank you.
wattttt? nice thank you