---
name: "shmsid"
section: "2"
platform: "linux"
package: "libselinux-dev"
version: "2002031409-4"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/shmsid/2"
---

# shmsid(2)

find the sid associated with a shared memory segment.

## NAME

shmsid - find the sid associated with a shared memory segment.

## SYNOPSIS

**#include \<linux/flask/flask\_types.h\>**

**int shmsid(const int** *id***, security\_id\_t \*** *sid***);**

## DESCRIPTION

The SID of the shared memory segment given by *id* is returned  by the *sid* parameter.

## RETURN VALUE

On success, zero is returned.  On error, -1 is returned, with *errno indicating the error.*

## ERRORS

For a failing return, **errno** will be set to one among the following values:

- **EACCES**

  The caller lacks permission to read the attributes of the shared memory segment.

- **EIDRM**

  The shared memory segment is marked as to be deleted.

- **EINVAL**

  The *id* is not valid.

## SEE ALSO

[**ipc**(5)](/ipc/5.md), [**shmget**(2)](/shmget/2.md), [**shmget\_secure**(2)](/shmget_secure/2.md), [**shmctl**(2)](/shmctl/2.md), [**shmat**(2)](/shmat/2.md), [**shmdt**(2)](/shmdt/2.md).
