linux进程管理(c语言)

  • L4_907639
    了解作者
  • 25.4MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-29 14:08
    上传日期
利用PPT介绍了linux进程的知识,以及如何使用进程和线程,并用c程序给出了相关重要函数的实例帮助理解和学习
linux进程管理(c语言).rar
  • zuo
  • 81
  • jobno12.doc
    27.5KB
  • syslog_dameon.c
    1001B
  • uucp.txt
    6KB
  • 进程管理.ppt
    13.1MB
  • thread.c
    882B
  • execlp.c
    321B
  • jobno12.doc
    50.5KB
  • waitpid.c
    922B
  • exit.c
    378B
  • fork3.c
    439B
  • sem_syn.c
    1.3KB
  • syslog_dameon.c
    1001B
  • jc.txt
    6KB
  • uucp.txt
    6KB
  • 新建 文本文档 (2).txt
    422B
  • execve.c
    535B
  • find jc.txt
    17.6KB
  • _exit.c
    215B
  • 进程管理.ppt
    13MB
  • execle.c
    415B
  • mutex.c
    1.9KB
  • daemeon.c
    887B
  • fork.c
    633B
  • thread.c
    882B
  • 新建 文本文档.txt
    10.4KB
  • 资料.doc
    83KB
  • sem_num.c
    1.4KB
  • execl.c
    341B
  • attr_thread.c
    1KB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/6283c45b9b6e2b6d55d85848/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/6283c45b9b6e2b6d55d85848/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">#include&lt;unistd.h&gt;</div><div class="t m0 x1 h3 y3 ff1 fs0 fc0 sc0 ls0 ws0">#include&lt;sys/types.h&gt;</div><div class="t m0 x1 h3 y4 ff1 fs0 fc1 sc0 ls0 ws0">gid_t getegid(void);</div><div class="t m0 x1 h4 y5 ff1 fs0 fc0 sc0 ls0 ws0">getegid<span class="ff2">&#65288;<span class="_ _0"></span>&#65289;&#29992;<span class="_ _0"></span>&#26469;&#21462;&#24471;<span class="_ _0"></span>&#25191;&#34892;<span class="_ _0"></span>&#30446;&#21069;<span class="_ _0"></span>&#36827;&#31243;<span class="_ _0"></span>&#26377;&#25928;<span class="_ _0"></span>&#32452;&#35782;&#21035;<span class="_ _0"></span>&#30721;&#12290;<span class="_ _0"></span>&#26377;&#25928;&#30340;<span class="_ _0"></span>&#32452;&#35782;<span class="_ _0"></span>&#21035;&#30721;<span class="_ _0"></span>&#29992;&#26469;<span class="_ _0"></span>&#20915;&#23450;<span class="_ _0"></span>&#36827;&#31243;&#25191;<span class="_ _0"></span>&#34892;&#26102;<span class="_ _0"></span>&#32452;</span></div><div class="t m0 x1 h4 y6 ff2 fs0 fc0 sc0 ls0 ws0">&#30340;&#26435;&#38480;&#12290;</div><div class="t m0 x1 h4 y7 ff2 fs0 fc0 sc0 ls0 ws0">&#36820;&#22238;&#26377;&#25928;&#30340;&#32452;&#35782;&#21035;&#30721;&#12290;</div><div class="t m0 x1 h3 y8 ff1 fs0 fc0 sc0 ls0 ws0">#include&lt;unistd.h&gt;</div><div class="t m0 x1 h3 y9 ff1 fs0 fc0 sc0 ls0 ws0">#include&lt;sys/types.h&gt;</div><div class="t m0 x1 h3 ya ff1 fs0 fc1 sc0 ls0 ws0">uid_t geteuid(void)</div><div class="t m0 x1 h4 yb ff1 fs0 fc0 sc0 ls0 ws0">geteuid<span class="ff2">&#65288;<span class="_ _0"></span>&#65289;&#29992;<span class="_ _0"></span>&#26469;&#21462;&#24471;<span class="_ _0"></span>&#25191;&#34892;<span class="_ _0"></span>&#30446;&#21069;<span class="_ _0"></span>&#36827;&#31243;<span class="_ _0"></span>&#26377;&#25928;<span class="_ _0"></span>&#30340;&#29992;&#25143;<span class="_ _0"></span>&#35782;&#21035;<span class="_ _0"></span>&#30721;&#12290;&#26377;<span class="_ _0"></span>&#25928;&#30340;<span class="_ _0"></span>&#29992;&#25143;<span class="_ _0"></span>&#35782;&#21035;<span class="_ _0"></span>&#30721;&#29992;<span class="_ _0"></span>&#26469;&#20915;&#23450;<span class="_ _0"></span>&#36827;&#31243;<span class="_ _0"></span>&#25191;</span></div><div class="t m0 x1 h4 yc ff2 fs0 fc0 sc0 ls0 ws0">&#34892;&#30340;&#26435;&#38480;&#65292;</div><div class="t m0 x1 h4 yd ff2 fs0 fc0 sc0 ls0 ws0">&#36820;&#22238;&#26377;&#25928;&#30340;&#29992;&#25143;&#35782;&#21035;&#30721;&#12290;</div><div class="t m0 x1 h3 ye ff1 fs0 fc1 sc0 ls0 ws0">gid_t getgid(void);</div><div class="t m0 x1 h4 yf ff1 fs0 fc0 sc0 ls0 ws0">getgid<span class="ff2">&#65288;&#65289;&#29992;&#26469;&#21462;&#24471;&#25191;&#34892;&#30446;&#21069;&#36827;&#31243;&#30340;&#32452;&#35782;&#21035;&#30721;&#12290;</span></div><div class="t m0 x1 h4 y10 ff2 fs0 fc0 sc0 ls0 ws0">&#36820;&#22238;&#32452;&#35782;&#21035;&#30721;</div><div class="t m0 x1 h3 y11 ff1 fs0 fc1 sc0 ls0 ws0">uid_t getuid(void);</div><div class="t m0 x1 h4 y12 ff1 fs0 fc0 sc0 ls0 ws0">getuid<span class="ff2">&#65288;&#65289;&#29992;&#26469;&#21462;&#24471;&#25191;&#34892;&#30446;&#21069;&#36827;&#31243;&#30340;&#29992;&#25143;&#35782;&#21035;&#30721;&#12290;</span></div><div class="t m0 x1 h4 y13 ff2 fs0 fc0 sc0 ls0 ws0">&#29992;&#25143;&#35782;&#21035;&#30721;</div><div class="t m0 x1 h4 y14 ff2 fs0 fc0 sc0 ls0 ws0">&#34920;&#22836;&#25991;&#20214;<span class="_ _1"> </span><span class="ff1">#include&lt;unistd.h&gt;</span></div><div class="t m0 x1 h4 y15 ff2 fs0 fc0 sc0 ls0 ws0">&#23450;&#20041;&#20989;&#25968;<span class="_ _1"> </span><span class="ff1">pid_t getpgid( pid_t pid);</span></div><div class="t m0 x1 h4 y16 ff2 fs0 fc0 sc0 ls0 ws0">&#20989;&#25968;&#35828;&#26126;<span class="_ _1"> </span><span class="ff1 fc1">getpgid<span class="ff2">&#65288;<span class="_ _0"></span>&#65289;</span></span>&#29992;<span class="_ _0"></span>&#26469;&#21462;<span class="_ _0"></span>&#24471;&#21442;<span class="_ _0"></span>&#25968;<span class="_ _2"> </span><span class="ff1">pid<span class="_ _2"> </span></span>&#25351;&#23450;&#36827;&#31243;<span class="_ _0"></span>&#25152;&#23646;<span class="_ _0"></span>&#30340;&#32452;&#35782;<span class="_ _0"></span>&#21035;&#30721;<span class="_ _0"></span>&#12290;&#22914;<span class="_ _0"></span>&#26524;&#21442;<span class="_ _0"></span>&#25968;<span class="_ _3"> </span><span class="ff1">pid<span class="_ _2"> </span></span>&#20026;<span class="_ _4"> </span><span class="ff1">0</span>&#65292;</div><div class="t m0 x1 h4 y17 ff2 fs0 fc0 sc0 ls0 ws0">&#21017;&#20250;&#21462;&#24471;&#30446;&#21069;&#36827;&#31243;&#30340;&#32452;&#35782;&#21035;&#30721;&#12290;</div><div class="t m0 x1 h4 y18 ff2 fs0 fc0 sc0 ls0 ws0">&#36820;&#22238;&#20540;<span class="_"> </span>&#25191;&#34892;&#25104;&#21151;&#21017;&#36820;&#22238;&#32452;&#35782;&#21035;&#30721;&#65292;&#22914;&#26524;&#26377;&#38169;&#35823;&#21017;&#36820;&#22238;<span class="ff1">-1</span>&#65292;&#38169;&#35823;&#21407;&#22240;&#23384;&#20110;<span class="_ _4"> </span><span class="ff1">errno<span class="_ _4"> </span></span>&#20013;&#12290;</div><div class="t m0 x1 h4 y19 ff2 fs0 fc0 sc0 ls0 ws0">&#38169;&#35823;&#20195;&#30721;<span class="_ _1"> </span><span class="ff1">ESRCH </span>&#25214;&#19981;&#21040;&#31526;&#21512;&#21442;&#25968;<span class="_ _4"> </span><span class="ff1">pid<span class="_ _4"> </span></span>&#25351;&#23450;&#30340;&#36827;&#31243;&#12290;</div><div class="t m0 x1 h4 y1a ff2 fs0 fc0 sc0 ls0 ws0">&#33539;&#20363;</div><div class="t m0 x1 h4 y1b ff1 fs0 fc0 sc0 ls0 ws0">/*<span class="ff2">&#21462;&#24471;<span class="_ _4"> </span></span>init <span class="ff2">&#36827;&#31243;&#65288;</span>pid<span class="ff2">&#65309;</span>1<span class="ff2">&#65289;&#30340;&#32452;&#35782;&#21035;&#30721;</span>*/</div><div class="t m0 x1 h3 y1c ff1 fs0 fc0 sc0 ls0 ws0">#include&lt;unistd.h&gt;</div><div class="t m0 x1 h3 y1d ff1 fs0 fc0 sc0 ls0 ws0">mian()</div><div class="t m0 x1 h3 y1e ff1 fs0 fc0 sc0 ls0 ws0">{</div><div class="t m0 x1 h3 y1f ff1 fs0 fc0 sc0 ls0 ws0"> printf(&#8220;init gid = %d &#8221;,getpgid(1));</div><div class="t m0 x1 h3 y20 ff1 fs0 fc0 sc0 ls0 ws0">}</div><div class="t m0 x1 h4 y21 ff2 fs0 fc0 sc0 ls0 ws0">&#25191;&#34892;</div><div class="t m0 x1 h3 y22 ff1 fs0 fc0 sc0 ls0 ws0">init gid = 0</div><div class="t m0 x1 h3 y23 ff1 fs0 fc0 sc0 ls0 ws0">#include&lt;unistd.h&gt;</div><div class="t m0 x1 h3 y24 ff1 fs0 fc1 sc0 ls0 ws0">pid_t getpid(void);</div><div class="t m0 x1 h4 y25 ff1 fs0 fc0 sc0 ls0 ws0">getpid<span class="ff2">&#65288;&#65289;&#29992;&#26469;&#21462;&#24471;&#30446;&#21069;&#36827;&#31243;&#30340;&#36827;&#31243;&#35782;&#21035;&#30721;&#65292;&#35768;&#22810;&#31243;&#24207;&#21033;&#29992;&#21462;&#21040;&#30340;&#27492;&#20540;&#26469;&#24314;&#31435;&#20020;&#26102;&#25991;&#20214;&#65292;&#20197;</span></div><div class="t m0 x1 h4 y26 ff2 fs0 fc0 sc0 ls0 ws0">&#36991;&#20813;&#20020;&#26102;&#25991;&#20214;&#30456;&#21516;&#24102;&#26469;&#30340;&#38382;&#39064;&#12290;</div><div class="t m0 x1 h4 y27 ff2 fs0 fc0 sc0 ls0 ws0">&#30446;&#21069;&#36827;&#31243;&#30340;&#36827;&#31243;&#35782;&#21035;&#30721;</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐