1INVOCATION_NAME(3) Linux Programmer's Manual INVOCATION_NAME(3)
2
3
4
6 program_invocation_name, program_invocation_short_name - obtain name
7 used to invoke calling program
8
10 #define _GNU_SOURCE
11 #include <errno.h>
12
13 extern char *program_invocation_name;
14 extern char *program_invocation_short_name;
15
17 program_invocation_name contains the name that was used to invoke the
18 calling program. This is the same as the value of argv[0] in main(),
19 with the difference that the scope of program_invocation_name is
20 global.
21
22 program_invocation_short_name contains the basename component of name
23 that was used to invoke the calling program. That is, it is the same
24 value as program_invocation_name, with all text up to and including the
25 final slash (/), if any, removed.
26
27 These variables are automatically initialized by the glibc run-time
28 startup code.
29
31 These variables are GNU extensions, and should not be used in programs
32 intended to be portable.
33
35 The Linux-specific /proc/[number]/cmdline file provides access to simi‐
36 lar information.
37
39 proc(5), feature_test_macros(7)
40
42 This page is part of release 3.25 of the Linux man-pages project. A
43 description of the project, and information about reporting bugs, can
44 be found at http://www.kernel.org/doc/man-pages/.
45
46
47
48GNU 2006-04-29 INVOCATION_NAME(3)