getpid (BPX1GPI, BPX4GPI) — Get the process ID

Function

The getpid callable service gets the process ID (PID) of the calling process.

Requirements

Operation Environment
Authorization: Supervisor state or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE (BPX1GPI): 31-bit
AMODE (BPX4GPI): 64-bit
ASC mode: Primary mode
Interrupt status: Enabled for interrupts
Locks: Unlocked
Control parameters: All parameters must be addressable by the caller and in the primary address space.

Format

CALL BPX1GPI,(Process_ID)

Parameters

Process_ID
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword where the getpid service places the caller's process ID.

Usage notes

  1. If the getpid service fails, the process abends.
  2. To optimize performance, see Optimizing performance using process- and thread-level information.

Related services

Characteristics and restrictions

There are no restrictions on the use of the getpid service.

Examples

For an example using this callable service, see BPX1GPI (getpid) example.