---
name: "function::ns_sid"
section: "3stap"
platform: "linux"
package: "systemtap-doc"
version: "5.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/function::ns_sid"
---

# function::ns\_sid(3stap)

Returns the session ID of the current process as seen in a pid namespace

## NAME

function::ns\_sid - Returns the session ID of the current process as seen in a pid namespace

## SYNOPSIS

```
    ns_sid:long()
```

## ARGUMENTS

None

## DESCRIPTION

The namespace-aware session ID of a process is the process group ID of the session leader as seen in the target pid namespace if provided, or the stap process namespace. Session ID is stored in the signal\_struct since Kernel 2.6.0.

## SEE ALSO0

[*tapset::context*(3stap)](/tapset::context/3stap.md)
