1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ipcctl_pre_down_nolock</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="ipc.html#idp1124933524" title="IPC utilities"><link rel="prev" href="API-ipc-update-perm.html" title="ipc_update_perm"><link rel="next" href="API-ipc-parse-version.html" title="ipc_parse_version"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">ipcctl_pre_down_nolock</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-ipc-update-perm.html">Prev</a>&#160;</td><th width="60%" align="center">IPC utilities</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-ipc-parse-version.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-ipcctl-pre-down-nolock"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ipcctl_pre_down_nolock &#8212; 
2     retrieve an ipc and check permissions for some IPC_XXX cmd
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">struct kern_ipc_perm * <b class="fsfunc">ipcctl_pre_down_nolock </b>(</code></td><td>struct ipc_namespace * <var class="pdparam">ns</var>, </td></tr><tr><td>&#160;</td><td>struct ipc_ids * <var class="pdparam">ids</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">id</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">cmd</var>, </td></tr><tr><td>&#160;</td><td>struct ipc64_perm * <var class="pdparam">perm</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">extra_perm</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1125138164"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>ns</code></em></span></dt><dd><p>
4     ipc namespace
5    </p></dd><dt><span class="term"><em class="parameter"><code>ids</code></em></span></dt><dd><p>
6     the table of ids where to look for the ipc
7    </p></dd><dt><span class="term"><em class="parameter"><code>id</code></em></span></dt><dd><p>
8     the id of the ipc to retrieve
9    </p></dd><dt><span class="term"><em class="parameter"><code>cmd</code></em></span></dt><dd><p>
10     the cmd to check
11    </p></dd><dt><span class="term"><em class="parameter"><code>perm</code></em></span></dt><dd><p>
12     the permission to set
13    </p></dd><dt><span class="term"><em class="parameter"><code>extra_perm</code></em></span></dt><dd><p>
14     one extra permission parameter used by msq
15    </p></dd></dl></div></div><div class="refsect1"><a name="idp1125144876"></a><h2>Description</h2><p>
16   This function does some common audit and permissions check for some IPC_XXX
17   cmd and is called from semctl_down, shmctl_down and msgctl_down.
18   It must be called without any lock held and
19   - retrieves the ipc with the given id in the given table.
20   - performs some audit and permission check, depending on the given cmd
21   - returns a pointer to the ipc object or otherwise, the corresponding error.
22   </p><p>
23
24   Call holding the both the rwsem and the rcu read lock.
25</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-ipc-update-perm.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ipc.html#idp1124933524">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-ipc-parse-version.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">ipc_update_perm</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">ipc_parse_version</span></td></tr></table></div></body></html>
26