---
name: "program_invocation_short_name"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/program_invocation_name"
---

# program\_invocation\_short\_name(3)

obtain name used to invoke calling program

Part of [program\_invocation\_name(3)](/program_invocation_name/3.md).

## NAME

program\_invocation\_name, program\_invocation\_short\_name - obtain name used to invoke calling program

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#define _GNU_SOURCE         /* See feature_test_macros(7) */
#include <errno.h>
```

**extern char \****program\_invocation\_name***;** **extern char \****program\_invocation\_short\_name***;**

## DESCRIPTION

*program\_invocation\_name* contains the name that was used to invoke the calling program. This is the same as the value of *argv\[0\]* in *main*(), with the difference that the scope of *program\_invocation\_name* is global.

*program\_invocation\_short\_name* contains the basename component of name that was used to invoke the calling program. That is, it is the same value as *program\_invocation\_name*, with all text up to and including the final slash (/), if any, removed.

These variables are automatically initialized by the glibc run-time startup code.

## VERSIONS

The Linux-specific */proc/*pid*/cmdline* file provides access to similar information.

## STANDARDS

GNU.

## SEE ALSO

[**proc**(5)](/proc/5.md)
