# %pgetpid() function

The %pgetpid() function returns the
UNIX Process-ID (PID) associated to the D3 process line.

**For Windows:** Not Supported

## Syntax

```
var = %pgetpid(line)
```

## Description

If *line* is
equal to -1, the PID of the current process is returned. If *line* is equal to -2, the PID of the flush process is returned.
If the D3 process is not connected, 0 is returned.

Note: This
function is a D3 extension. It is not part of libc.a.

## Example(s)

```
* Get our own pid
pid=%pgetpid(system(22))
```

## See also

- [%kill() function](https://d3codex.com/pickbasic-flashbasic/percent-kill-function/)
- [FlashBASIC C functions overview](https://d3codex.com/pickbasic-flashbasic/flashbasic-c-functions-overview/)
- [cfunction statement](https://d3codex.com/pickbasic-flashbasic/cfunction-statement/)
- [PID](https://d3codex.com/definitions/pid/)
- [pid command](https://d3codex.com/tcl/pid-command/)

---
Source: https://d3codex.com/pickbasic-flashbasic/percent-pgetpid-function/ - part of the D3Codex reference.
