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

# msgsid(2)

find the sid associated with a message queue

## NAME

msgsid - find the sid associated with a message queue

## SYNOPSIS

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

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

## DESCRIPTION

The SID of the message queue 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 message queue.

- **EIDRM**

  The message queue is marked as to be deleted.

- **EINVAL**

  The *id* is not valid.

## SEE ALSO

[**ipc**(5)](/man/ipc/5.md), [**msgget**(2)](/man/msgget/2.md), [**msgop**(2)](/man/msgop/2.md), [**msgget\_secure**(2)](/man/msgget_secure/2.md), [**msgctl**(2)](/man/msgctl/2.md), [**msgsnd**(2)](/man/msgsnd/2.md), [**msgsnd\_secure**(2)](/man/msgsnd_secure/2.md), [**msgrcv**(2)](/man/msgrcv/2.md), [**msgrcv\_secure**(2)](/man/msgrcv_secure/2.md).
