---
name: "ipcctl_pre_down"
section: "9"
platform: "linux"
package: "linux-manual-3.2"
version: "3.2.78-1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/ipcctl_pre_down"
---

# ipcctl\_pre\_down(9)

retrieve an ipc and check permissions for some IPC\_XXX cmd

## NAME

ipcctl\_pre\_down - retrieve an ipc and check permissions for some IPC\_XXX cmd

## SYNOPSIS

**struct kern\_ipc\_perm \* ipcctl\_pre\_down(struct ipc\_namespace \*** *ns***, struct ipc\_ids \*** *ids***, int** *id***, int** *cmd***, struct ipc64\_perm \*** *perm***, int** *extra\_perm***);**

## ARGUMENTS

*ns*

the ipc namespace

*ids*

the table of ids where to look for the ipc

*id*

the id of the ipc to retrieve

*cmd*

the cmd to check

*perm*

the permission to set

*extra\_perm*

one extra permission parameter used by msq

## DESCRIPTION

This function does some common audit and permissions check for some IPC\_XXX cmd and is called from semctl\_down, shmctl\_down and msgctl\_down. It must be called without any lock held and - retrieves the ipc with the given id in the given table. - performs some audit and permission check, depending on the given cmd - returns the ipc with both ipc and rw\_mutex locks held in case of success or an err-code without any lock held otherwise.

## COPYRIGHT
