/usr/share/doc/libdaemon-doc/html/dpid_8h.html is in libdaemon-doc 0.14-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>libdaemon: dpid.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">libdaemon
 <span id="projectnumber">0.14</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('dpid_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#func-members">Functions</a> |
<a href="#var-members">Variables</a> </div>
<div class="headertitle">
<div class="title">dpid.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Contains an API for manipulating PID files.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include <sys/types.h></code><br/>
</div>
<p><a href="dpid_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a7398a8a97f9134d4c0e258ef8249216a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="dpid_8h.html#a7398a8a97f9134d4c0e258ef8249216a">DAEMON_PID_FILE_KILL_WAIT_AVAILABLE</a>   1</td></tr>
<tr class="memdesc:a7398a8a97f9134d4c0e258ef8249216a"><td class="mdescLeft"> </td><td class="mdescRight">This variable is defined to 1 iff <a class="el" href="dpid_8h.html#a91b0acbb786d1aa0d721ade4c8d9bc71" title="Similar to daemon_pid_file_kill() but waits until the process died. ">daemon_pid_file_kill_wait()</a> is supported. <a href="#a7398a8a97f9134d4c0e258ef8249216a">More...</a><br/></td></tr>
<tr class="separator:a7398a8a97f9134d4c0e258ef8249216a"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:acfbf6ffe12986bb7ffe399d1d2321d15"><td class="memItemLeft" align="right" valign="top">typedef const char *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="dpid_8h.html#acfbf6ffe12986bb7ffe399d1d2321d15">daemon_pid_file_proc_t</a> )(void)</td></tr>
<tr class="memdesc:acfbf6ffe12986bb7ffe399d1d2321d15"><td class="mdescLeft"> </td><td class="mdescRight">Prototype of a function for generating the name of a PID file. <a href="#acfbf6ffe12986bb7ffe399d1d2321d15">More...</a><br/></td></tr>
<tr class="separator:acfbf6ffe12986bb7ffe399d1d2321d15"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a0ffc26db1df6ac308d1669d3e40d2236"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="dpid_8h.html#a0ffc26db1df6ac308d1669d3e40d2236">daemon_pid_file_proc_default</a> (void)</td></tr>
<tr class="memdesc:a0ffc26db1df6ac308d1669d3e40d2236"><td class="mdescLeft"> </td><td class="mdescRight">A function for creating a pid file name from daemon_pid_file_ident. <a href="#a0ffc26db1df6ac308d1669d3e40d2236">More...</a><br/></td></tr>
<tr class="separator:a0ffc26db1df6ac308d1669d3e40d2236"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a058d4fec58507c64b15fd06f34aa9bea"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="dpid_8h.html#a058d4fec58507c64b15fd06f34aa9bea">daemon_pid_file_create</a> (void)</td></tr>
<tr class="memdesc:a058d4fec58507c64b15fd06f34aa9bea"><td class="mdescLeft"> </td><td class="mdescRight">Creates PID pid file for the current process. <a href="#a058d4fec58507c64b15fd06f34aa9bea">More...</a><br/></td></tr>
<tr class="separator:a058d4fec58507c64b15fd06f34aa9bea"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0d620a1d51b3863781caeaf5a99cb483"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="dpid_8h.html#a0d620a1d51b3863781caeaf5a99cb483">daemon_pid_file_remove</a> (void)</td></tr>
<tr class="memdesc:a0d620a1d51b3863781caeaf5a99cb483"><td class="mdescLeft"> </td><td class="mdescRight">Removes the PID file of the current process. <a href="#a0d620a1d51b3863781caeaf5a99cb483">More...</a><br/></td></tr>
<tr class="separator:a0d620a1d51b3863781caeaf5a99cb483"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a14d5b1ab3600f0771b2a1de11add3fb5"><td class="memItemLeft" align="right" valign="top">pid_t </td><td class="memItemRight" valign="bottom"><a class="el" href="dpid_8h.html#a14d5b1ab3600f0771b2a1de11add3fb5">daemon_pid_file_is_running</a> (void)</td></tr>
<tr class="memdesc:a14d5b1ab3600f0771b2a1de11add3fb5"><td class="mdescLeft"> </td><td class="mdescRight">Returns the PID file of a running daemon, if available. <a href="#a14d5b1ab3600f0771b2a1de11add3fb5">More...</a><br/></td></tr>
<tr class="separator:a14d5b1ab3600f0771b2a1de11add3fb5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9156802865287ccd2a49f043cb64a212"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="dpid_8h.html#a9156802865287ccd2a49f043cb64a212">daemon_pid_file_kill</a> (int s)</td></tr>
<tr class="memdesc:a9156802865287ccd2a49f043cb64a212"><td class="mdescLeft"> </td><td class="mdescRight">Kills a running daemon, if available. <a href="#a9156802865287ccd2a49f043cb64a212">More...</a><br/></td></tr>
<tr class="separator:a9156802865287ccd2a49f043cb64a212"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a91b0acbb786d1aa0d721ade4c8d9bc71"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="dpid_8h.html#a91b0acbb786d1aa0d721ade4c8d9bc71">daemon_pid_file_kill_wait</a> (int s, int m)</td></tr>
<tr class="memdesc:a91b0acbb786d1aa0d721ade4c8d9bc71"><td class="mdescLeft"> </td><td class="mdescRight">Similar to <a class="el" href="dpid_8h.html#a9156802865287ccd2a49f043cb64a212" title="Kills a running daemon, if available. ">daemon_pid_file_kill()</a> but waits until the process died. <a href="#a91b0acbb786d1aa0d721ade4c8d9bc71">More...</a><br/></td></tr>
<tr class="separator:a91b0acbb786d1aa0d721ade4c8d9bc71"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a432e89b3c0a2ca30fb8537cc8d684bfa"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="dpid_8h.html#a432e89b3c0a2ca30fb8537cc8d684bfa">daemon_pid_file_ident</a></td></tr>
<tr class="memdesc:a432e89b3c0a2ca30fb8537cc8d684bfa"><td class="mdescLeft"> </td><td class="mdescRight">Identification string for the PID file name, only used when daemon_pid_file_proc is set to <a class="el" href="dpid_8h.html#a0ffc26db1df6ac308d1669d3e40d2236" title="A function for creating a pid file name from daemon_pid_file_ident. ">daemon_pid_file_proc_default()</a>. <a href="#a432e89b3c0a2ca30fb8537cc8d684bfa">More...</a><br/></td></tr>
<tr class="separator:a432e89b3c0a2ca30fb8537cc8d684bfa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6f3a973f57b266131367efc3540467e9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="dpid_8h.html#acfbf6ffe12986bb7ffe399d1d2321d15">daemon_pid_file_proc_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="dpid_8h.html#a6f3a973f57b266131367efc3540467e9">daemon_pid_file_proc</a></td></tr>
<tr class="memdesc:a6f3a973f57b266131367efc3540467e9"><td class="mdescLeft"> </td><td class="mdescRight">A function pointer which is used to generate the name of the PID file to manipulate. <a href="#a6f3a973f57b266131367efc3540467e9">More...</a><br/></td></tr>
<tr class="separator:a6f3a973f57b266131367efc3540467e9"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Contains an API for manipulating PID files. </p>
<p>Definition in file <a class="el" href="dpid_8h_source.html">dpid.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a7398a8a97f9134d4c0e258ef8249216a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DAEMON_PID_FILE_KILL_WAIT_AVAILABLE   1</td>
</tr>
</table>
</div><div class="memdoc">
<p>This variable is defined to 1 iff <a class="el" href="dpid_8h.html#a91b0acbb786d1aa0d721ade4c8d9bc71" title="Similar to daemon_pid_file_kill() but waits until the process died. ">daemon_pid_file_kill_wait()</a> is supported. </p>
<dl class="section since"><dt>Since</dt><dd>0.3 </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="dpid_8h.html#a91b0acbb786d1aa0d721ade4c8d9bc71" title="Similar to daemon_pid_file_kill() but waits until the process died. ">daemon_pid_file_kill_wait()</a> </dd></dl>
<p>Definition at line <a class="el" href="dpid_8h_source.html#l00082">82</a> of file <a class="el" href="dpid_8h_source.html">dpid.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="acfbf6ffe12986bb7ffe399d1d2321d15"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef const char*(* daemon_pid_file_proc_t)(void)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Prototype of a function for generating the name of a PID file. </p>
<p>Definition at line <a class="el" href="dpid_8h_source.html#l00037">37</a> of file <a class="el" href="dpid_8h_source.html">dpid.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a058d4fec58507c64b15fd06f34aa9bea"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int daemon_pid_file_create </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates PID pid file for the current process. </p>
<dl class="section return"><dt>Returns</dt><dd>zero on success, nonzero on failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="testd_8c-example.html#a14">testd.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a14d5b1ab3600f0771b2a1de11add3fb5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">pid_t daemon_pid_file_is_running </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the PID file of a running daemon, if available. </p>
<dl class="section return"><dt>Returns</dt><dd>The PID or negative on failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="testd_8c-example.html#a7">testd.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a9156802865287ccd2a49f043cb64a212"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int daemon_pid_file_kill </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>s</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Kills a running daemon, if available. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">s</td><td>The signal to send </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>zero on success, nonzero on failure </dd></dl>
</div>
</div>
<a class="anchor" id="a91b0acbb786d1aa0d721ade4c8d9bc71"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int daemon_pid_file_kill_wait </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>m</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Similar to <a class="el" href="dpid_8h.html#a9156802865287ccd2a49f043cb64a212" title="Kills a running daemon, if available. ">daemon_pid_file_kill()</a> but waits until the process died. </p>
<p>This functions is new in libdaemon 0.3. The macro DAEMON_PID_FILE_KILL_WAIT_AVAILABLE is defined iff libdaemon supports this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">s</td><td>The signal to send </td></tr>
<tr><td class="paramname">m</td><td>Seconds to wait at maximum </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>zero on success, nonzero on failure (timeout condition is considered a failure) </dd></dl>
<dl class="section since"><dt>Since</dt><dd>0.3 </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="dpid_8h.html#a7398a8a97f9134d4c0e258ef8249216a" title="This variable is defined to 1 iff daemon_pid_file_kill_wait() is supported. ">DAEMON_PID_FILE_KILL_WAIT_AVAILABLE</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="testd_8c-example.html#a6">testd.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a0ffc26db1df6ac308d1669d3e40d2236"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* daemon_pid_file_proc_default </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>A function for creating a pid file name from daemon_pid_file_ident. </p>
<dl class="section return"><dt>Returns</dt><dd>The PID file path </dd></dl>
</div>
</div>
<a class="anchor" id="a0d620a1d51b3863781caeaf5a99cb483"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int daemon_pid_file_remove </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Removes the PID file of the current process. </p>
<dl class="section return"><dt>Returns</dt><dd>zero on success, nonzero on failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="testd_8c-example.html#a20">testd.c</a>.</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="a432e89b3c0a2ca30fb8537cc8d684bfa"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* daemon_pid_file_ident</td>
</tr>
</table>
</div><div class="memdoc">
<p>Identification string for the PID file name, only used when daemon_pid_file_proc is set to <a class="el" href="dpid_8h.html#a0ffc26db1df6ac308d1669d3e40d2236" title="A function for creating a pid file name from daemon_pid_file_ident. ">daemon_pid_file_proc_default()</a>. </p>
<p>Use <a class="el" href="dlog_8h.html#a63821209fcaa2a5c139d1db32a209e71" title="Return a sensible syslog identification for daemon_log_ident generated from argv[0]. ">daemon_ident_from_argv0()</a> to generate an identification string from argv[0] </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="testd_8c-example.html#a3">testd.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a6f3a973f57b266131367efc3540467e9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="dpid_8h.html#acfbf6ffe12986bb7ffe399d1d2321d15">daemon_pid_file_proc_t</a> daemon_pid_file_proc</td>
</tr>
</table>
</div><div class="memdoc">
<p>A function pointer which is used to generate the name of the PID file to manipulate. </p>
<p>Points to <a class="el" href="dpid_8h.html#a0ffc26db1df6ac308d1669d3e40d2236" title="A function for creating a pid file name from daemon_pid_file_ident. ">daemon_pid_file_proc_default()</a> by default. </p>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_20ddce5748dc29883719f99930173c08.html">libdaemon</a></li><li class="navelem"><a class="el" href="dpid_8h.html">dpid.h</a></li>
<li class="footer">Generated on Mon May 5 2014 17:59:55 for libdaemon by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
</ul>
</div>
</body>
</html>
|