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

# NS\_GET\_NSTYPE(2const)

discovering the namespace type

## NAME

NS\_GET\_NSTYPE - discovering the namespace type

## SYNOPSIS

```
#include <linux/nsfs.h>  /* Definition of NS_GET_NSTYPE */
#include <sys/ioctl.h>
```

**int ioctl(int** *fd***, NS\_GET\_NSTYPE);**

## DESCRIPTION

The **NS\_GET\_NSTYPE** operation can be used to discover the type of namespace referred to by the file descriptor *fd*.

*fd* refers to a */proc/*pid*/ns/\** file.

## RETURN VALUE

On success, the return value is one of the **CLONE\_NEW\*** values that can be specified to [**clone**(2)](/clone/2.md) or [**unshare**(2)](/unshare/2.md) in order to create a namespace.

On error, -1 is returned, and *errno* is set to indicate the error.

## STANDARDS

Linux.

## HISTORY

Linux 4.11.

## SEE ALSO

[**ioctl**(2)](/ioctl/2.md), [**ioctl\_nsfs**(2)](/ioctl_nsfs/2.md)
