1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>call_usermodehelper_setup</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="modload.html#idp1125664212" title="Module Loading"><link rel="prev" href="API---request-module.html" title="__request_module"><link rel="next" href="API-call-usermodehelper-exec.html" title="call_usermodehelper_exec"></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">call_usermodehelper_setup</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API---request-module.html">Prev</a>&#160;</td><th width="60%" align="center">Module Loading</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-call-usermodehelper-exec.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-call-usermodehelper-setup"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>call_usermodehelper_setup &#8212; 
2     prepare to call a usermode helper
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 subprocess_info * <b class="fsfunc">call_usermodehelper_setup </b>(</code></td><td>char * <var class="pdparam">path</var>, </td></tr><tr><td>&#160;</td><td>char ** <var class="pdparam">argv</var>, </td></tr><tr><td>&#160;</td><td>char ** <var class="pdparam">envp</var>, </td></tr><tr><td>&#160;</td><td>gfp_t <var class="pdparam">gfp_mask</var>, </td></tr><tr><td>&#160;</td><td>int (*<var class="pdparam">init</var>)
4     <code>(</code>struct subprocess_info *info, struct cred *new<code>)</code>, </td></tr><tr><td>&#160;</td><td>void (*<var class="pdparam">cleanup</var>)
5     <code>(</code>struct subprocess_info *info<code>)</code>, </td></tr><tr><td>&#160;</td><td>void * <var class="pdparam">data</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1125683356"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>path</code></em></span></dt><dd><p>
6     path to usermode executable
7    </p></dd><dt><span class="term"><em class="parameter"><code>argv</code></em></span></dt><dd><p>
8     arg vector for process
9    </p></dd><dt><span class="term"><em class="parameter"><code>envp</code></em></span></dt><dd><p>
10     environment for process
11    </p></dd><dt><span class="term"><em class="parameter"><code>gfp_mask</code></em></span></dt><dd><p>
12     gfp mask for memory allocation
13    </p></dd><dt><span class="term"><em class="parameter"><code>init</code></em></span></dt><dd><p>
14     an init function
15    </p></dd><dt><span class="term"><em class="parameter"><code>cleanup</code></em></span></dt><dd><p>
16     a cleanup function
17    </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p>
18     arbitrary context sensitive data
19    </p></dd></dl></div></div><div class="refsect1"><a name="idp1125691132"></a><h2>Description</h2><p>
20   Returns either <code class="constant">NULL</code> on allocation failure, or a subprocess_info
21   structure.  This should be passed to call_usermodehelper_exec to
22   exec the process and free the structure.
23   </p><p>
24
25   The init function is used to customize the helper process prior to
26   exec.  A non-zero return code causes the process to error out, exit,
27   and return the failure to the calling process
28   </p><p>
29
30   The cleanup function is just before ethe subprocess_info is about to
31   be freed.  This can be used for freeing the argv and envp.  The
32   Function must be runnable in either a process context or the
33   context in which call_usermodehelper_exec is called.
34</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API---request-module.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="modload.html#idp1125664212">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-call-usermodehelper-exec.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">__request_module</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">call_usermodehelper_exec</span></td></tr></table></div></body></html>
35