Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Program-name variables - glibc

Split from the chapter glibc: stdio and Formatted I/O into the per-function layout; see the method page and the glibc ledger for coverage status.

VariableHeaderMeaning
program_invocation_nameerrno.h (_GNU_SOURCE)Full argv[0] as invoked; set up by libc before main (manual, Error Messages).
program_invocation_short_nameerrno.h (_GNU_SOURCE)Same with everything up to the last slash removed.

GNU extension; on non-GNU libcs save argv[0] yourself (manual). These are what error() and warn() print.