锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美精品成人一区二区在线观看,亚洲一二三区视频,国产91露脸中文字幕在线http://www.aygfsteel.com/wenhl5656/category/43225.html鎯寵搗鍜岃佽倴鐮旂┒涓柇鐨勬棩瀛愶紝鍊嶈娓╅Θzh-cnMon, 21 Dec 2009 18:04:43 GMTMon, 21 Dec 2009 18:04:43 GMT60Linux涓繘紼嬪浣曟垚涓哄畧鎶よ繘紼?/title><link>http://www.aygfsteel.com/wenhl5656/archive/2009/12/11/305533.html</link><dc:creator>鐖卞悆楸煎ご</dc:creator><author>鐖卞悆楸煎ご</author><pubDate>Fri, 11 Dec 2009 03:33:00 GMT</pubDate><guid>http://www.aygfsteel.com/wenhl5656/archive/2009/12/11/305533.html</guid><wfw:comment>http://www.aygfsteel.com/wenhl5656/comments/305533.html</wfw:comment><comments>http://www.aygfsteel.com/wenhl5656/archive/2009/12/11/305533.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wenhl5656/comments/commentRss/305533.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wenhl5656/services/trackbacks/305533.html</trackback:ping><description><![CDATA[<div>    瀹堟姢榪涚▼榪愯鍦ㄥ悗鍙?涓嶄笌浠諱綍鎺у埗緇堢鐩稿叧鑱?瀹堟姢榪涚▼浠oot鐢ㄦ埛榪愯鎴栬呭叾浠栫壒孌婄殑鐢ㄦ埛,騫跺鐞嗕竴浜涚郴緇熺駭鐨勪換鍔? 涔犳儻涓婂畧鎶よ繘紼嬬殑鍚嶅瓧浠緇撳熬,浣嗕笉鏄繀欏葷殑.</div> <div>    瀵瑰畧鎶よ繘紼嬬殑涓や釜鍩烘湰瑕佹眰: 瀹冨繀欏繪槸init榪涚▼鐨勫瓙榪涚▼; 涓嶄笌浠諱綍鎺у埗緇堢鐩稿叧鑱?</div> <div>    涓鑸潵璁? 榪涚▼鍙互閫氳繃浠ヤ笅姝ラ鎴愪負瀹堟姢榪涚▼:</div> <blockquote> <div>1. 璋冪敤fork(), 鍒涘緩鏂扮殑榪涚▼, 瀹冧細鏄皢鏉ョ殑瀹堟姢榪涚▼.</div> <div>2. 鍦ㄥ畧鎶よ繘紼嬬殑鐖惰繘紼嬩腑璋冪敤exit(). 榪欎繚璇佺鐖惰繘紼?瀹堟姢榪涚▼鐨勭鐖惰繘紼?紜鐖惰繘紼嬪凡緇忕粨鏉? 榪樹繚璇佺埗榪涚▼涓嶅啀緇х畫榪愯, 瀹堟姢榪涚▼涓嶆槸緇勯暱榪涚▼. 鏈鍚庝竴鐐規槸欏哄埄瀹屾垚涓涓嬫楠ょ殑鍓嶆彁.</div> <div>3. 璋冪敤setsid(), 浣垮緱瀹堟姢榪涚▼鏈変竴涓柊鐨勮繘紼嬬粍鍜屾柊鐨勪細璇? 涓よ呴兘鎶婂畠浣滀負棣栬繘紼? 榪欎篃淇濊瘉瀹冧笉浼氫笌鎺у埗緇堢鐩稿叧鑱?</div> <div>4. 鐢╟hdir()灝嗗綋鍓嶅伐浣滅洰褰曟敼涓烘牴鐩綍. 鍥犱負鍓嶉潰璋冪敤fork()鍒涘緩浜嗘柊榪涚▼, 瀹冩墍緇ф壙鏉ョ殑褰撳墠宸ヤ綔鐩綍鍙兘鍦ㄦ枃浠剁郴緇熺殑浠諱綍鍦版柟. 鑰屽畧鎶よ繘紼嬮氬父鍦ㄧ郴緇熷惎鍔ㄦ椂榪愯, 鍚屾椂涓嶅笇鏈涗竴浜涢殢鏈虹洰褰曚繚鎸佹墦寮鐘舵? 涔熷氨闃繪浜嗙鐞嗗憳鍗歌澆瀹堟姢榪涚▼宸ヤ綔鐩綍鎵鍦ㄧ殑閭d釜鏂囦歡緋葷粺.</div> <div>5. 鍏抽棴鎵鏈夌殑鏂囦歡鎻忚堪絎? 涓嶉渶瑕佺戶鎵夸換浣曟墦寮鐨勬枃浠舵弿榪扮, 瀵逛簬鏃犳硶紜鐨勬枃浠舵弿榪扮, 璁╁畠浠戶緇浜庢墦寮鐘舵?</div> <div>6. 鎵撳紑0, 1鍜?鍙鋒枃浠舵弿榪扮(鏍囧噯杈撳叆, 鏍囧噯杈撳嚭鍜屾爣鍑嗛敊璇?, 鎶婂畠浠噸瀹氬悜鍒?dev/null.</div> </blockquote> <div>鏍規嵁榪欎簺瑙勫垯, 涓嬮潰紼嬪簭鍙互鎴愪負瀹堟姢榪涚▼:</div> <div> <div style="padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 0);">#include</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">sys</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">types.h</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(0, 0, 0);">#include</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">sys</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">stat.h</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(0, 0, 0);">#include</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">stdlib.h</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(0, 0, 0);">#include</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">stdio.h</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(0, 0, 0);">#include</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">fcntl.h</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 0, 0);">#include</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">unistd.h</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 0, 0);">#include</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">linux</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">fs.h</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> main(</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">)<br /> </span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 0, 0);">{<br /> </span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(0, 0, 0);"> pid_t pid;<br /> </span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i;<br /> </span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"> create new process </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">14</span> <span style="color: rgb(0, 0, 0);"> pid </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> fork();<br /> </span><span style="color: rgb(0, 128, 128);">15</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(pid </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">16</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(pid </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">) exit(EXIT_SUCCESS);<br /> </span><span style="color: rgb(0, 128, 128);">17</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"> create new session and process group </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">18</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(setsid() </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">19</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"> set the working directory to the root directory</span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">20</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(chdir(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">21</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"> close all open files -- NR_OPEN is overkill, but works </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">22</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(i </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">; i </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> NR_OPEN; i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">) close(i);<br /> </span><span style="color: rgb(0, 128, 128);">23</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"> redirect fd's 0, 1, 2 to /dev/null </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">24</span> <span style="color: rgb(0, 0, 0);"> open(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/dev/null</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, O_RDWR); </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"> stdin </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">25</span> <span style="color: rgb(0, 0, 0);"> dup(</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">); </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"> stdout </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">26</span> <span style="color: rgb(0, 0, 0);"> dup(</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">); </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"> stderr </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">27</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"> do it daemon thing<img src="http://www.aygfsteel.com/Images/dot.gif" alt="" />.</span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 128);">28</span> <span style="color: rgb(0, 0, 0);"> <br /> </span><span style="color: rgb(0, 128, 128);">29</span> <span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 128, 128);">30</span> <span style="color: rgb(0, 0, 0);">}</span></div> </div> <div><br /> </div> <div>璁稿Unix緋葷粺鍦ㄥ畠浠殑C鍑芥暟搴撲腑鎻愪緵浜哾aemon()鍑芥暟鏉ュ畬鎴愯繖浜涘伐浣?</div> <div><span id="wmqeeuq" class="Apple-tab-span" style="white-space: pre;"> </span>#include <unistd.h></div> <div><span id="wmqeeuq" class="Apple-tab-span" style="white-space: pre;"> </span>int daemon(int nochdir, int noclose);</div> <div><br /> </div> <img src ="http://www.aygfsteel.com/wenhl5656/aggbug/305533.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wenhl5656/" target="_blank">鐖卞悆楸煎ご</a> 2009-12-11 11:33 <a href="http://www.aygfsteel.com/wenhl5656/archive/2009/12/11/305533.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> 主站蜘蛛池模板: <a href="http://" target="_blank">湖南省</a>| <a href="http://" target="_blank">个旧市</a>| <a href="http://" target="_blank">永春县</a>| <a href="http://" target="_blank">山东</a>| <a href="http://" target="_blank">峨山</a>| <a href="http://" target="_blank">和平县</a>| <a href="http://" target="_blank">银川市</a>| <a href="http://" target="_blank">神木县</a>| <a href="http://" target="_blank">奉新县</a>| <a href="http://" target="_blank">班玛县</a>| <a href="http://" target="_blank">绍兴县</a>| <a href="http://" target="_blank">忻城县</a>| <a href="http://" target="_blank">黑龙江省</a>| <a href="http://" target="_blank">思茅市</a>| <a href="http://" target="_blank">仁布县</a>| <a href="http://" target="_blank">闻喜县</a>| <a href="http://" target="_blank">乌兰察布市</a>| <a href="http://" target="_blank">灵山县</a>| <a href="http://" target="_blank">万荣县</a>| <a href="http://" target="_blank">洮南市</a>| <a href="http://" target="_blank">怀集县</a>| <a href="http://" target="_blank">余干县</a>| <a href="http://" target="_blank">瑞安市</a>| <a href="http://" target="_blank">寻乌县</a>| <a href="http://" target="_blank">翼城县</a>| <a href="http://" target="_blank">凉山</a>| <a href="http://" target="_blank">白朗县</a>| <a href="http://" target="_blank">安康市</a>| <a href="http://" target="_blank">黔江区</a>| <a href="http://" target="_blank">铁力市</a>| <a href="http://" target="_blank">翼城县</a>| <a href="http://" target="_blank">宝兴县</a>| <a href="http://" target="_blank">泸州市</a>| <a href="http://" target="_blank">安图县</a>| <a href="http://" target="_blank">罗江县</a>| <a href="http://" target="_blank">时尚</a>| <a href="http://" target="_blank">涡阳县</a>| <a href="http://" target="_blank">定日县</a>| <a href="http://" target="_blank">罗城</a>| <a href="http://" target="_blank">邵东县</a>| <a href="http://" target="_blank">抚顺市</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>