{"id":64134,"date":"2026-01-22T20:56:33","date_gmt":"2026-01-22T12:56:33","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/64134.html"},"modified":"2026-01-22T20:56:33","modified_gmt":"2026-01-22T12:56:33","slug":"%e8%bf%9b%e7%a8%8b%e4%b8%8e%e7%ba%bf%e7%a8%8b%ef%bc%9a%e8%bf%9b%e7%a8%8b%e5%9f%ba%e7%a1%80","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/64134.html","title":{"rendered":"\u8fdb\u7a0b\u4e0e\u7ebf\u7a0b\uff1a\u8fdb\u7a0b\u57fa\u7840"},"content":{"rendered":"<h2>\u8fdb\u7a0b\u57fa\u7840<\/h2>\n<h3>1. \u7a0b\u5e8f\u4e0e\u8fdb\u7a0b<\/h3>\n<h4>1.1 \u7a0b\u5e8f<\/h4>\n<h5>1.1.1 \u7a0b\u5e8f\u7684\u6838\u5fc3\u5b9a\u4e49<\/h5>\n<ul>\n<li>\u7a0b\u5e8f\u662f\u5b58\u50a8\u5728\u786c\u76d8\u4e0a\u7684\u9759\u6001\u6307\u4ee4\u96c6\u5408\u548c\u6570\u636e\u96c6\u5408&#xff0c;\u662f\u5b8c\u6210\u7279\u5b9a\u4efb\u52a1\u7684\u4ee3\u7801\u6587\u4ef6&#xff1b;<\/li>\n<li>\u7a0b\u5e8f\u4ec5\u5360\u7528\u78c1\u76d8\u8d44\u6e90&#xff0c;\u4e0d\u5360\u7528 CPU\u3001\u5185\u5b58\u3001\u8fdb\u7a0b ID&#xff08;PID&#xff09;\u7b49\u7cfb\u7edf\u8fd0\u884c\u8d44\u6e90&#xff1b;<\/li>\n<li>\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u683c\u5f0f\u5bf9\u6bd4&#xff1a;<\/li>\n<\/ul>\n<table>\n<tr>\u64cd\u4f5c\u7cfb\u7edf \/ \u5e73\u53f0\u5178\u578b\u53ef\u6267\u884c\u7a0b\u5e8f\u683c\u5f0f\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td align=\"center\">Windows<\/td>\n<td align=\"center\">.exe&#xff08;\u53ef\u6267\u884c\u6587\u4ef6&#xff09;<\/td>\n<td align=\"center\">\u53cc\u51fb\u53ef\u76f4\u63a5\u8fd0\u884c&#xff0c;\u662f Windows \u6700\u6838\u5fc3\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u683c\u5f0f<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">Android<\/td>\n<td align=\"center\">.apk&#xff08;\u5b89\u88c5\u5305&#xff09;<\/td>\n<td align=\"center\">\u672c\u8d28\u662f zip \u538b\u7f29\u5305&#xff0c;\u5185\u542b dex \u5b57\u8282\u7801\u3001\u8d44\u6e90\u6587\u4ef6\u3001\u6e05\u5355\u6587\u4ef6\u7b49&#xff0c;\u5b89\u88c5\u540e\u624d\u80fd\u8fd0\u884c<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">Linux<\/td>\n<td align=\"center\">ELF&#xff08;Executable and Linkable Format&#xff09;<\/td>\n<td align=\"center\">Linux\/Unix \u7c7b\u7cfb\u7edf\u7684\u6807\u51c6\u4e8c\u8fdb\u5236\u6587\u4ef6\u683c\u5f0f&#xff0c;\u662f\u6240\u6709\u53ef\u6267\u884c\u7a0b\u5e8f \/ \u5e93\u6587\u4ef6\u7684\u7edf\u4e00\u683c\u5f0f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6613\u9519\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u2705 \u5728 Linux \u4e2d\u53ef\u6267\u884c\u6587\u4ef6\u7684\u7c7b\u578b\u662f ELF \u683c\u5f0f&#xff1b;<\/li>\n<li>\u274c \u5728 Linux \u4e2d ELF \u5c31\u662f\u53ef\u6267\u884c\u6587\u4ef6&#xff08;ELF \u5305\u542b\u591a\u79cd\u6587\u4ef6\u7c7b\u578b&#xff0c;\u5e76\u975e\u4ec5\u53ef\u6267\u884c\u6587\u4ef6&#xff09;\u3002<\/li>\n<\/ul>\n<h5>1.1.2 ELF \u683c\u5f0f\u6587\u4ef6\u7c7b\u578b<\/h5>\n<p>ELF \u683c\u5f0f\u5305\u542b 4 \u7c7b\u6838\u5fc3\u6587\u4ef6\u7c7b\u578b&#xff1a;<\/p>\n<li>\u53ef\u6267\u884c\u6587\u4ef6&#xff1a;\u53ef\u88ab\u76f4\u63a5\u8fd0\u884c\u7684\u6587\u4ef6&#xff1b;<\/li>\n<li>\u53ef\u91cd\u5b9a\u4f4d\u6587\u4ef6&#xff1a;\u7f16\u8bd1\u5668\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\u751f\u6210\u7684\u4e2d\u95f4\u6587\u4ef6&#xff08;\u540e\u7f00\u4e3a .o\/.a&#xff09;&#xff1b;<\/li>\n<li>\u5171\u4eab\u76ee\u6807\u6587\u4ef6&#xff1a;\u53ef\u88ab\u591a\u4e2a\u7a0b\u5e8f\u5171\u4eab\u8c03\u7528\u7684\u5e93\u6587\u4ef6&#xff08;Linux \u4e0b\u7684 .so \u6587\u4ef6&#xff09;&#xff1b;<\/li>\n<li>\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6&#xff1a;\u7a0b\u5e8f\u5d29\u6e83\u65f6\u751f\u6210\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/li>\n<p>\u5b9e\u7528\u547d\u4ee4&#xff1a;readelf -h ELF\u683c\u5f0f\u6587\u4ef6 \u2192 \u67e5\u770b\u6587\u4ef6\u7684 ELF \u5934\u4fe1\u606f\u3002<\/p>\n<h5>1.1.3 ELF \u683c\u5f0f\u6587\u4ef6\u7ec4\u6210<\/h5>\n<p>ELF \u6587\u4ef6\u7531\u4ee5\u4e0b\u6838\u5fc3\u90e8\u5206\u6784\u6210&#xff1a;<\/p>\n<ul>\n<li>ELF \u5934&#xff1a;\u4f4d\u4e8e\u6587\u4ef6\u6700\u5f00\u59cb&#xff0c;\u8bb0\u5f55\u6587\u4ef6\u57fa\u672c\u4fe1\u606f&#xff08;\u6587\u4ef6\u7c7b\u578b\u3001\u67b6\u6784\u3001\u5165\u53e3\u5730\u5740\u3001\u7a0b\u5e8f\u5934\u8868 \/ \u8282\u533a\u5934\u8868\u7684\u4f4d\u7f6e\u548c\u5927\u5c0f&#xff09;&#xff1b;<\/li>\n<li>\u7a0b\u5e8f\u5934\u8868&#xff1a;\u63cf\u8ff0\u6587\u4ef6\u4e2d\u7684\u6bb5\u4fe1\u606f&#xff0c;\u4f9b\u52a0\u8f7d\u5668\u5c06\u6587\u4ef6\u52a0\u8f7d\u5230\u5185\u5b58\u65f6\u4f7f\u7528&#xff1b;<\/li>\n<li>\u8282\u533a&#xff1a;\u6587\u4ef6\u6838\u5fc3\u5185\u5bb9&#xff0c;\u5305\u542b\u4ee3\u7801&#xff08;.text&#xff09;\u3001\u6570\u636e&#xff08;.data\u3001.bss&#xff09;\u3001\u7b26\u53f7\u8868&#xff08;.symtab&#xff09;\u3001\u91cd\u5b9a\u4f4d\u4fe1\u606f\u7b49&#xff1b;<\/li>\n<li>\u8282\u533a\u5934\u8868&#xff1a;\u8bb0\u5f55\u6bcf\u4e2a\u8282\u533a\u7684\u540d\u79f0\u3001\u7c7b\u578b\u3001\u5927\u5c0f\u3001\u6587\u4ef6\u504f\u79fb\u91cf\u7b49&#xff0c;\u7528\u4e8e\u94fe\u63a5\u8fc7\u7a0b&#xff1b;<\/li>\n<li>\u6bb5&#xff1a;\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u8282\u533a\u7ec4\u6210&#xff0c;\u662f\u52a0\u8f7d\u5230\u5185\u5b58\u7684\u57fa\u672c\u5355\u5143\u3002<\/li>\n<\/ul>\n<h4>1.2 \u8fdb\u7a0b<\/h4>\n<h5>1.2.1 \u8fdb\u7a0b\u7684\u6838\u5fc3\u5b9a\u4e49<\/h5>\n<ul>\n<li>\u8fdb\u7a0b\u662f\u7a0b\u5e8f\u7684\u4e00\u6b21\u52a8\u6001\u6267\u884c\u8fc7\u7a0b&#xff0c;\u5360\u7528 CPU\u3001\u5185\u5b58\u7b49\u7cfb\u7edf\u8fd0\u884c\u8d44\u6e90&#xff0c;\u6709\u5b8c\u6574\u7684\u751f\u547d\u5468\u671f&#xff1b;<\/li>\n<li>\u4e00\u4e2a\u7a0b\u5e8f\u53ef\u4ee5\u5bf9\u5e94\u591a\u4e2a\u8fdb\u7a0b&#xff08;\u5982\u591a\u6b21\u542f\u52a8\u540c\u4e00\u4e2a\u8f6f\u4ef6&#xff09;&#xff1b;<\/li>\n<li>\u4e00\u4e2a\u8fdb\u7a0b\u5728\u8fd0\u884c\u8fc7\u7a0b\u4e2d&#xff0c;\u901a\u5e38\u53ea\u5bf9\u5e94\u4e00\u4e2a\u7a0b\u5e8f\u3002<\/li>\n<\/ul>\n<h5>1.2.2 \u7a0b\u5e8f\u52a0\u8f7d\u4e3a\u8fdb\u7a0b\u7684\u6838\u5fc3\u6b65\u9aa4<\/h5>\n<li>\u7528\u6237\u53d1\u8d77\u7a0b\u5e8f\u6267\u884c\u8bf7\u6c42&#xff1b;<\/li>\n<li>\u5185\u6838\u521b\u5efa\u8fdb\u7a0b\u63a7\u5236\u5757&#xff08;PCB&#xff09;&#xff1b;<\/li>\n<li>\u4e3a\u8fdb\u7a0b\u5206\u914d\u5185\u5b58\u7a7a\u95f4&#xff1b;<\/li>\n<li>\u52a0\u8f7d\u7a0b\u5e8f\u8fd0\u884c\u6240\u9700\u7684\u4f9d\u8d56\u8d44\u6e90&#xff1b;<\/li>\n<li>\u8bbe\u7f6e\u7a0b\u5e8f\u5165\u53e3\u5730\u5740\u4e0e\u8fd0\u884c\u4e0a\u4e0b\u6587&#xff1b;<\/li>\n<li>CPU \u8c03\u5ea6\u7b97\u6cd5\u9009\u4e2d\u8be5\u8fdb\u7a0b&#xff0c;\u5206\u914d CPU \u65f6\u95f4\u7247\u6267\u884c&#xff1b;<\/li>\n<li>\u8fdb\u7a0b\u7ec8\u6b62\u540e&#xff0c;\u5185\u6838\u56de\u6536\u5176\u5360\u7528\u7684\u7cfb\u7edf\u8d44\u6e90\u3002<\/li>\n<h3>2. \u8fdb\u7a0b\u76f8\u5173\u6838\u5fc3\u4fe1\u606f\u4e0e\u5de5\u5177<\/h3>\n<h4>2.1 task_struct \u7ed3\u6784\u4f53<\/h4>\n<ul>\n<li>\u8fdb\u7a0b\u63a7\u5236\u5757&#xff08;PCB&#xff09;\u7684\u6838\u5fc3\u5b9e\u73b0&#xff0c;\u5b58\u50a8\u8fdb\u7a0b\u7684\u6240\u6709\u6838\u5fc3\u4fe1\u606f&#xff08;PID\u3001\u72b6\u6001\u3001\u5185\u5b58\u5730\u5740\u3001\u4f18\u5148\u7ea7\u7b49&#xff09;&#xff1b;<\/li>\n<li>\u5b58\u50a8\u8def\u5f84&#xff1a;\/usr\/src\/linux-headers-4.10.0-28-generic\/include\/linux\/sched.h\u3002<\/li>\n<\/ul>\n<h4>2.2 Linux \u4e2d\u67e5\u770b\u8fdb\u7a0b\u7684\u547d\u4ee4<\/h4>\n<table>\n<tr>\u547d\u4ee4\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td align=\"center\">ps -ef \/ ps aux \/ ps axjf<\/td>\n<td align=\"center\">\u9759\u6001\u67e5\u770b\u8fdb\u7a0b\u5217\u8868&#xff08;\u4e0d\u540c\u53c2\u6570\u5c55\u793a\u7ef4\u5ea6\u4e0d\u540c&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">top<\/td>\n<td align=\"center\">\u52a8\u6001\u5b9e\u65f6\u76d1\u63a7\u8fdb\u7a0b\u8d44\u6e90\u5360\u7528\u60c5\u51b5<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">htop<\/td>\n<td align=\"center\">\u589e\u5f3a\u7248 top&#xff08;\u9700\u624b\u52a8\u5b89\u88c5&#xff1a;sudo apt-get install htop&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">pstree<\/td>\n<td align=\"center\">\u4ee5\u6811\u5f62\u7ed3\u6784\u5c55\u793a\u8fdb\u7a0b\u95f4\u7684\u7236\u5b50\u5173\u7cfb<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>2.3 \u8fdb\u7a0b\u7684\u7236\u5b50\u5173\u7cfb<\/h4>\n<ul>\n<li>Linux \u4e2d\u9664\u521d\u59cb\u5316\u8fdb\u7a0b\u5916&#xff0c;\u5176\u4f59\u6240\u6709\u8fdb\u7a0b\u90fd\u6709\u7236\u8fdb\u7a0b&#xff1b;<\/li>\n<li>\u82e5\u7236\u8fdb\u7a0b\u5148\u9000\u51fa&#xff0c;\u5b50\u8fdb\u7a0b\u4f1a\u88ab\u5176\u4ed6\u8fdb\u7a0b&#xff08;\u901a\u5e38\u662f init\/systemd \u8fdb\u7a0b&#xff09;\u63a5\u7ba1&#xff0c;\u907f\u514d\u6210\u4e3a \u201c\u5b64\u513f\u8fdb\u7a0b\u201d\u3002<\/li>\n<\/ul>\n<h3>3. \u8fdb\u7a0b\u72b6\u6001<\/h3>\n<h4>3.1 \u8fdb\u7a0b\u7684\u751f\u547d\u5468\u671f&#xff08;\u72b6\u6001\u8f6c\u6362&#xff09;<\/h4>\n<h5>3.1.1 \u8bde\u751f \u2192 \u5c31\u7eea\u6001<\/h5>\n<ul>\n<li>\u89e6\u53d1\u6761\u4ef6&#xff1a;\u7236\u8fdb\u7a0b\u8c03\u7528 fork \u51fd\u6570&#xff0c;\u5185\u6838\u4e3a\u65b0\u8fdb\u7a0b\u5206\u914d PID\u3001PCB \u7b49\u8d44\u6e90&#xff0c;\u65b0\u8fdb\u7a0b\u8fdb\u5165\u5230\u5c31\u7eea\u6001&#xff1b;<\/li>\n<li>\u5c31\u7eea\u961f\u5217&#xff1a;\u8fdb\u7a0b\u5df2\u5177\u5907\u6267\u884c\u6761\u4ef6&#xff0c;\u4f46\u672a\u88ab CPU \u8c03\u5ea6&#xff0c;\u4f1a\u5728\u5c31\u7eea\u961f\u5217\u4e2d\u7b49\u5f85\u3002<\/li>\n<\/ul>\n<h5>3.1.2 \u5c31\u7eea\u6001 \u2192 \u6267\u884c\u6001<\/h5>\n<ul>\n<li>\u89e6\u53d1\u6761\u4ef6&#xff1a;\u5185\u6838\u8c03\u7528\u8c03\u5ea6&#xff08;sched&#xff09;\u7b97\u6cd5&#xff0c;\u9009\u4e2d\u5c31\u7eea\u961f\u5217\u4e2d\u7684\u8fdb\u7a0b&#xff0c;\u4e3a\u5176\u5206\u914d CPU \u65f6\u95f4\u7247&#xff0c;\u8fdb\u7a0b\u8fdb\u5165\u6267\u884c\u6001\u3002<\/li>\n<\/ul>\n<h5>3.1.3 \u6267\u884c\u6001 \u2192 \u5c31\u7eea\u6001<\/h5>\n<p>\u89e6\u53d1\u4ee5\u4e0b\u4efb\u4e00\u6761\u4ef6&#xff0c;\u8fdb\u7a0b\u4f1a\u4ece\u6267\u884c\u6001\u56de\u5230\u5c31\u7eea\u6001&#xff1a;<\/p>\n<li>\u8fdb\u7a0b\u6267\u884c\u65f6\u95f4\u8017\u5c3d CPU \u65f6\u95f4\u7247&#xff1b;<\/li>\n<li>\u66f4\u9ad8\u4f18\u5148\u7ea7\u7684\u8fdb\u7a0b\u8fdb\u5165\u5c31\u7eea\u961f\u5217\u65f6&#xff0c;CPU\u4f1a\u4f18\u5148\u53bb\u6267\u884c\u9ad8\u4f18\u5148\u7ea7\u8fdb\u7a0b&#xff0c;\u5f53\u524d\u8fdb\u7a0b\u88ab\u62a2\u5360\u3002<\/li>\n<h5>3.1.4 \u6267\u884c\u6001 \u2192 \u7761\u7720\u6001<\/h5>\n<ul>\n<li>\u89e6\u53d1\u6761\u4ef6&#xff1a;\u8fdb\u7a0b\u56e0\u7b49\u5f85\u8d44\u6e90 \/ \u4e8b\u4ef6\u4e3b\u52a8\u653e\u5f03 CPU&#xff08;\u5982\u8bfb\u6587\u4ef6\u3001\u7f51\u7edc\u8bf7\u6c42&#xff09;&#xff1b;<\/li>\n<li>\u53ef\u4e2d\u65ad\u7761\u7720&#xff08;\u7761\u7720\u6001&#xff09;&#xff1a;\u7b49\u5f85\u952e\u76d8\u8f93\u5165\u7b49\u573a\u666f&#xff0c;\u53ef\u88ab\u4fe1\u53f7\u5524\u9192&#xff0c;\u56de\u5230\u5c31\u7eea\u6001&#xff1b;<\/li>\n<li>\u4e0d\u53ef\u4e2d\u65ad\u7761\u7720&#xff08;\u6302\u8d77\u6001&#xff09;&#xff1a;\u7b49\u5f85\u78c1\u76d8 IO \u5b8c\u6210&#xff08;\u5982\u5199\u5165\u5927\u6587\u4ef6&#xff09;&#xff0c;\u4e0d\u54cd\u5e94\u4fe1\u53f7&#xff08;\u907f\u514d IO \u4e2d\u65ad\u5bfc\u81f4\u6570\u636e\u635f\u574f&#xff09;&#xff0c;IO \u5b8c\u6210\u540e\u81ea\u52a8\u56de\u5230\u5c31\u7eea\u6001\u3002<\/li>\n<\/ul>\n<h5>3.1.5 \u6267\u884c\u6001 \u2192 \u6682\u505c\u6001<\/h5>\n<ul>\n<li>\u89e6\u53d1\u6761\u4ef6&#xff1a;\u8fdb\u7a0b\u6536\u5230 SIGSTOP&#xff08;\u6682\u505c&#xff09;\u3001SIGTSTP&#xff08;\u7ec8\u7aef\u6682\u505c&#xff09;\u4fe1\u53f7\u3002<\/li>\n<\/ul>\n<h5>3.1.6 \u7ec8\u6b62 \u2192 \u50f5\u5c38\u6001 \u2192 \u6b7b\u4ea1\u6001<\/h5>\n<li>\u8fdb\u7a0b\u901a\u8fc7\u4ee5\u4e0b 4 \u79cd\u65b9\u5f0f\u7ec8\u6b62&#xff0c;\u5185\u6838\u8c03\u7528 do_exit \u6e05\u7406\u8fdb\u7a0b\u8d44\u6e90&#xff0c;\u4f46\u4fdd\u7559 PCB&#xff0c;\u8fdb\u7a0b\u8fdb\u5165\u50f5\u5c38\u6001&#xff1a;\n<ul>\n<li>\u5728 main \u51fd\u6570\u5185\u6267\u884c return<\/li>\n<li>\u8c03\u7528 exit() \/ Exit() \/ _exit() \u51fd\u6570<\/li>\n<li>\u8fdb\u7a0b\u4e2d\u6700\u540e\u4e00\u4e2a\u7ebf\u7a0b\u6267\u884c pthread_exit()<\/li>\n<li>\u88ab\u4fe1\u53f7&#xff08;\u5982 SIGKILL\u3001SIGTERM&#xff09;\u6740\u6b7b<\/li>\n<\/ul>\n<\/li>\n<li>\u7236\u8fdb\u7a0b\u8c03\u7528 wait \/ waitpid \u51fd\u6570&#xff0c;\u8bfb\u53d6\u50f5\u5c38\u6001\u8fdb\u7a0b\u7684\u9000\u51fa\u72b6\u6001&#xff1b;<\/li>\n<li>\u5185\u6838\u91ca\u653e\u8be5\u8fdb\u7a0b\u7684 PCB \u8d44\u6e90&#xff0c;\u8fdb\u7a0b\u8fdb\u5165\u6b7b\u4ea1\u6001\u3002<\/li>\n<h4>3.2 \u8fdb\u7a0b\u7684\u72b6\u6001\u8f6c\u6362\u56fe<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260122125632-69721e80169f1.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>4. fork\u51fd\u6570<\/h3>\n<h4>4.1 \u4f5c\u7528<\/h4>\n<ul>\n<li>\u7528\u4e8e\u4ea7\u751f\u4e00\u4e2a\u65b0\u7684\u5b50\u8fdb\u7a0b<\/li>\n<\/ul>\n<h4>4.2 \u63a5\u53e3\u89c4\u8303<\/h4>\n<table>\n<tr>\u9879\u76ee\u5185\u5bb9<\/tr>\n<tbody>\n<tr>\n<td align=\"center\">\u529f\u80fd<\/td>\n<td align=\"center\">\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5b50\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u5934\u6587\u4ef6<\/td>\n<td align=\"center\">#include &lt;unistd.h&gt;<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u51fd\u6570\u539f\u578b<\/td>\n<td align=\"center\">pid_t fork(void);<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u8fd4\u56de\u503c<\/td>\n<td align=\"center\">\u6210\u529f&#xff1a;\u7236\u8fdb\u7a0b\u8fd4\u56de\u5b50\u8fdb\u7a0b\u7684 PID&#xff08;\u5927\u4e8e 0 \u7684\u6b63\u6574\u6570&#xff09;&#xff0c;\u5b50\u8fdb\u7a0b\u8fd4\u56de 0\u5931\u8d25&#xff1a;\u8fd4\u56de -1<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u5907\u6ce8<\/td>\n<td align=\"center\">\u51fd\u6570\u6267\u884c\u6210\u529f\u540e&#xff0c;\u4f1a\u5206\u522b\u5728\u7236\u5b50\u4e24\u4e2a\u8fdb\u7a0b\u4e2d\u8fd4\u56de&#xff0c;\u8fd4\u56de\u503c\u4e0d\u540c\u4ee5\u533a\u5206\u8eab\u4efd<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>4.3 \u8c03\u7528\u89e6\u53d1\u6d41\u7a0b<\/h4>\n<ul>\n<li>\u4e3a\u5b50\u8fdb\u7a0b\u5206\u914d\u552f\u4e00\u7684PID&#xff0c;\u5e76\u5c06\u5b50\u8fdb\u7a0b\u7684PPID&#xff08;\u7236\u8fdb\u7a0b ID&#xff09;\u8bbe\u7f6e\u4e3a\u5f53\u524d\u7236\u8fdb\u7a0b\u7684 PID\u3002<\/li>\n<li>\u590d\u5236\u7236\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u63a7\u5236\u5757&#xff08;PCB&#xff09;&#xff0c;\u5305\u542b\u8fdb\u7a0b\u72b6\u6001\u3001\u4f18\u5148\u7ea7\u3001\u6587\u4ef6\u63cf\u8ff0\u7b26\u3001\u4fe1\u53f7\u63a9\u7801\u7b49\u6838\u5fc3\u4fe1\u606f\u3002<\/li>\n<li>\u57fa\u4e8e\u5199\u65f6\u590d\u5236\u673a\u5236&#xff0c;\u5efa\u7acb\u7236\u5b50\u8fdb\u7a0b\u7684\u5185\u5b58\u6620\u5c04\u5173\u7cfb&#xff08;\u975e\u7acb\u5373\u62f7\u8d1d\u7269\u7406\u5185\u5b58&#xff0c;\u53ea\u6709\u5f53\u5176\u4e2d\u4e00\u65b9\u4fee\u6539\u6570\u636e\u65f6\u624d\u4f1a\u5b9e\u9645\u590d\u5236&#xff0c;\u4ee5\u63d0\u5347\u6548\u7387&#xff09;\u3002<\/li>\n<li>\u5c06\u5b50\u8fdb\u7a0b\u52a0\u5165\u5c31\u7eea\u961f\u5217&#xff0c;\u7b49\u5f85 CPU \u8c03\u5ea6\u6267\u884c\u3002<\/li>\n<\/ul>\n<h4>4.4 \u4e24\u6b21\u8fd4\u56de\u7279\u6027<\/h4>\n<ul>\n<li>\u5728\u7236\u8fdb\u7a0b\u4e2d&#xff0c;\u8fd4\u56de\u5b50\u8fdb\u7a0b\u7684PID&#xff0c;\u7236\u8fdb\u7a0b\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u8fd4\u56de\u503c\u6765\u7ba1\u7406\u5b50\u8fdb\u7a0b\u3002<\/li>\n<li>\u5728\u5b50\u8fdb\u7a0b\u4e2d&#xff0c;\u8fd4\u56de0&#xff0c;\u5b50\u8fdb\u7a0b\u53ef\u4ee5\u901a\u8fc7 getpid() \u83b7\u53d6\u81ea\u8eab PID&#xff0c;\u901a\u8fc7 getppid() \u83b7\u53d6\u7236\u8fdb\u7a0b PID\u3002<\/li>\n<li>\u5982\u4f55fork\u51fd\u6570\u8c03\u7528\u5931\u8d25&#xff0c;\u5219\u8fd4\u56de-1\u3002<\/li>\n<\/ul>\n<h4>4.5 \u7236\u5b50\u8fdb\u7a0b\u7684\u5f02\u540c\u70b9<\/h4>\n<h5>4.5.1 \u5b8c\u5168\u76f8\u540c\u7684\u5c5e\u6027&#xff08;\u5b50\u8fdb\u7a0b\u662f\u7236\u8fdb\u7a0b\u7684 \u201c\u590d\u5236\u54c1\u201d&#xff0c;\u5728\u5b50\u8fdb\u7a0b\u521b\u5efa\u4e4b\u521d\u65f6&#xff09;<\/h5>\n<ul>\n<li>\u5b9e\u9645 UID \u548c GID&#xff0c;\u4ee5\u53ca\u6709\u6548 UID \u548c GID<\/li>\n<li>\u6240\u6709\u73af\u5883\u53d8\u91cf<\/li>\n<li>\u8fdb\u7a0b\u7ec4 ID \u548c\u4f1a\u8bdd ID<\/li>\n<li>\u5f53\u524d\u5de5\u4f5c\u8def\u5f84&#xff08;\u9664\u975e\u7528 chdir() \u4fee\u6539&#xff09;<\/li>\n<li>\u6253\u5f00\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26<\/li>\n<li>\u4fe1\u53f7\u54cd\u5e94\u51fd\u6570<\/li>\n<li>\u6574\u4e2a\u5185\u5b58\u7a7a\u95f4&#xff08;\u6808\u3001\u5806\u3001\u6570\u636e\u6bb5\u3001\u4ee3\u7801\u6bb5\u3001\u6807\u51c6 IO \u7f13\u51b2\u533a\u7b49&#xff09;<\/li>\n<\/ul>\n<h5>4.5.2 \u4e0d\u540c\u7684\u5c5e\u6027<\/h5>\n<ul>\n<li>\u8fdb\u7a0b\u53f7&#xff08;PID&#xff09;&#xff1a;\u7236\u5b50\u8fdb\u7a0b PID \u552f\u4e00&#xff0c;\u662f\u8fdb\u7a0b\u7684 \u201c\u8eab\u4efd\u8bc1\u53f7\u201d\u3002<\/li>\n<li>\u8bb0\u5f55\u9501&#xff1a;\u7236\u8fdb\u7a0b\u5bf9\u6587\u4ef6\u52a0\u7684\u9501&#xff0c;\u5b50\u8fdb\u7a0b\u4e0d\u4f1a\u7ee7\u627f\u3002<\/li>\n<li>\u6302\u8d77\u7684\u4fe1\u53f7&#xff1a;\u7236\u8fdb\u7a0b\u4e2d \u201c\u60ac\u800c\u672a\u51b3\u201d \u7684\u4fe1\u53f7&#xff0c;\u5b50\u8fdb\u7a0b\u4e0d\u4f1a\u7ee7\u627f\u3002<\/li>\n<\/ul>\n<h4>4.6 \u6838\u5fc3\u6ce8\u610f\u4e8b\u9879<\/h4>\n<li>\u5b50\u8fdb\u7a0b\u7684\u6267\u884c\u8d77\u70b9&#xff1a;\u5b50\u8fdb\u7a0b\u4f1a\u4ece fork() \u8fd4\u56de\u503c\u540e\u7684\u4e0b\u4e00\u6761\u903b\u8f91\u8bed\u53e5\u5f00\u59cb\u8fd0\u884c&#xff0c;\u907f\u514d\u4e86\u65e0\u9650\u8c03\u7528 fork() \u4ea7\u751f \u201c\u65e0\u9650\u5b50\u5b59\u201d \u7684\u95ee\u9898\u3002<\/li>\n<li>\u5e76\u53d1\u6267\u884c\u7684\u968f\u673a\u6027&#xff1a;\u7236\u5b50\u8fdb\u7a0b\u662f\u76f8\u4e92\u5e73\u7b49\u7684&#xff0c;\u6267\u884c\u6b21\u5e8f\u662f\u968f\u673a\u7684&#xff08;\u7531\u5185\u6838\u8c03\u5ea6\u7b97\u6cd5\u51b3\u5b9a&#xff09;&#xff0c;\u9664\u975e\u4f7f\u7528\u540c\u6b65\u673a\u5236&#xff08;\u5982\u4fe1\u53f7\u3001\u7ba1\u9053&#xff09;&#xff0c;\u5426\u5219\u65e0\u6cd5\u5224\u65ad\u8c01\u5148\u8fd0\u884c\u3002<\/li>\n<li>\u5185\u5b58\u7a7a\u95f4\u7684\u72ec\u7acb\u6027&#xff1a;\u5b50\u8fdb\u7a0b\u5b8c\u6574\u590d\u5236\u4e86\u7236\u8fdb\u7a0b\u7684\u5185\u5b58\u7a7a\u95f4&#xff0c;\u4e8c\u8005\u7684\u5185\u5b58\u662f\u76f8\u4e92\u72ec\u7acb\u7684&#xff0c;\u4fee\u6539\u5404\u81ea\u7684\u6570\u636e\u4e0d\u4f1a\u5f71\u54cd\u5bf9\u65b9\u3002<\/li>\n<h4>4.7 \u4ee3\u7801\u6f14\u793a<\/h4>\n<h5>4.7.1 \u793a\u4f8b\u4ee3\u7801<\/h5>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;stdio.h&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;unistd.h&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;errno.h&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;stdlib.h&gt;<\/span><\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5168\u5c40\u53d8\u91cf<\/span><br \/>\n<span class=\"token keyword\">int<\/span> g_num2 <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">123<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u9759\u6001\u5168\u5c40\u53d8\u91cf<\/span><br \/>\n<span class=\"token keyword\">static<\/span> <span class=\"token keyword\">int<\/span> num4 <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">100<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">int<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token comment\">\/\/ \u5c40\u90e8\u53d8\u91cf <\/span><br \/>\n    <span class=\"token keyword\">int<\/span> num1 <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u9759\u6001\u5c40\u90e8\u53d8\u91cf <\/span><br \/>\n    <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">int<\/span> num3 <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">111<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u5806\u533a<\/span><br \/>\n    <span class=\"token keyword\">int<\/span><span class=\"token operator\">*<\/span> num5 <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">int<\/span><span class=\"token operator\">*<\/span><span class=\"token punctuation\">)<\/span><span class=\"token function\">malloc<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">4<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token operator\">*<\/span>num5 <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1000<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token class-name\">pid_t<\/span> pid <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">fork<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>pid <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">perror<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;fork fail&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u5b50\u8fdb\u7a0b<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>pid <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        num1<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;num1&#061;%d, &amp;num1 &#061; %p\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span>num1<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>num1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        g_num2<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;g_num2&#061;%d, &amp;g_num2 &#061; %p\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span>g_num2<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>g_num2<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        num3<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;num3&#061;%d, &amp;num3 &#061; %p\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span>num3<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>num3<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        num4<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;num4&#061;%d, &amp;num4 &#061; %p\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span>num4<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>num4<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>num5<span class=\"token punctuation\">)<\/span><span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;*num5&#061;%d, num5 &#061; %p, &amp;num5 &#061; %p\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span><span class=\"token operator\">*<\/span>num5<span class=\"token punctuation\">,<\/span> num5<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>num5<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u6211\u662f\u5b50\u8fdb\u7a0b,pid&#061;%d,ppid&#061;%d\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span><span class=\"token function\">getpid<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><span class=\"token function\">getppid<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u7236\u8fdb\u7a0b<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>pid <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">sleep<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;num1&#061;%d, &amp;num1 &#061; %p\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span>num1<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>num1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;g_num2&#061;%d, &amp;g_num2 &#061; %p\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span>g_num2<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>g_num2<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;num3&#061;%d, &amp;num3 &#061; %p\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span>num3<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>num3<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;num4&#061;%d, &amp;num4 &#061; %p\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span>num4<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>num4<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;*num5&#061;%d, num5 &#061; %p, &amp;num5 &#061; %p\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span><span class=\"token operator\">*<\/span>num5<span class=\"token punctuation\">,<\/span> num5<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>num5<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u6211\u662f\u7236\u8fdb\u7a0b,pid&#061;%d,ppid&#061;%d\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span><span class=\"token function\">getpid<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><span class=\"token function\">getppid<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token keyword\">while<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><\/p>\n<p>    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h5>4.7.2 \u8fd0\u884c\u7ed3\u679c<\/h5>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260122125632-69721e807361a.jpg\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h5>4.7.3 \u7ed3\u8bba<\/h5>\n<ul>\n<li>\u5b50\u8fdb\u7a0b\u521b\u5efa\u65f6&#xff0c;\u4f1a\u5b8c\u6574\u62f7\u8d1d\u7236\u8fdb\u7a0b\u7684\u6808\u6570\u636e\u3001\u5806\u6570\u636e\u3001\u5168\u5c40\u6570\u636e\u3001\u9759\u6001\u6570\u636e\u53ca\u4ee3\u7801\u6bb5&#xff1b;<\/li>\n<li>\u7236\u5b50\u8fdb\u7a0b\u7684\u5185\u5b58\u7a7a\u95f4\u76f8\u4e92\u72ec\u7acb&#xff0c;\u4fee\u6539\u5404\u81ea\u6570\u636e\u4e0d\u4f1a\u5f71\u54cd\u5bf9\u65b9&#xff1b;<\/li>\n<li>\u7236\u5b50\u8fdb\u7a0b\u4e2d\u53d8\u91cf\u7684\u865a\u62df\u5185\u5b58\u5730\u5740\u53ef\u4ee5\u76f8\u540c&#xff0c;\u4f46\u7269\u7406\u5185\u5b58\u5730\u5740\u4e0d\u540c&#xff1b;<\/li>\n<li>\u865a\u62df\u5185\u5b58\u4e0e\u7269\u7406\u5185\u5b58\u7684\u6620\u5c04\u89c4\u5219&#xff1a;\n<li>\u6bcf\u4e2a\u8fdb\u7a0b\u62e5\u6709\u72ec\u7acb\u7684\u865a\u62df\u5185\u5b58\u7a7a\u95f4&#xff0c;\u4ee3\u7801\u4e2d\u8bbf\u95ee\u7684\u53d8\u91cf\u5730\u5740\u5747\u4e3a\u865a\u62df\u5730\u5740&#xff0c;\u800c\u975e\u7269\u7406\u5185\u5b58&#xff1b;<\/li>\n<li>\u5199\u65f6\u590d\u5236\u673a\u5236&#xff1a;\u5b50\u8fdb\u7a0b\u521b\u5efa\u540e&#xff0c;\u53d8\u91cf\u5728\u672a\u88ab\u4fee\u6539\u65f6&#xff08;\u672a\u8fdb\u884c\u5199\u64cd\u4f5c&#xff09;&#xff0c;\u901a\u5e38\u7236\u5b50\u8fdb\u7a0b\u5171\u4eab\u4e00\u4efd\u7269\u7406\u5185\u5b58\u7684\u6620\u5c04\u8868&#xff0c;\u8fd9\u4e2a\u65f6\u5019&#xff0c;\u7236\u5b50\u8fdb\u7a0b\u4e2d\u53d8\u91cf\u5bf9\u5e94\u7684\u5b9e\u9645\u7269\u7406\u5185\u5b58\u662f\u76f8\u540c\u7684&#xff1b;\u5982\u679c\u5176\u4e2d\u4e00\u65b9\u9700\u8981\u6539\u53d8\u6570\u636e&#xff08;\u8fdb\u884c\u5199\u64cd\u4f5c&#xff09;&#xff0c;\u8fd9\u4e2a\u65f6\u5019\u64cd\u4f5c\u7cfb\u7edf\u624d\u4f1a\u771f\u6b63\u7684\u6539\u53d8\u7269\u7406\u5185\u5b58&#xff0c;\u4f46\u662f\u5176\u865a\u62df\u5185\u5b58\u5730\u5740\u4f9d\u65e7\u662f\u76f8\u540c\u7684\u3002<\/li>\n<li>\u4e3a\u4fdd\u8bc1\u7236\u5b50\u8fdb\u7a0b\u4ee3\u7801\u6267\u884c\u903b\u8f91\u4e00\u81f4&#xff0c;\u4e8c\u8005\u7684\u865a\u62df\u5185\u5b58\u5730\u5740\u8bbe\u8ba1\u4e3a\u76f8\u540c\u3002<\/li>\n<\/li>\n<\/ul>\n<h4>4.8 fork\u548cvfork\u7684\u533a\u522b<\/h4>\n<table>\n<tr>\u5bf9\u6bd4\u7ef4\u5ea6fork \u51fd\u6570vfork \u51fd\u6570<\/tr>\n<tbody>\n<tr>\n<td align=\"center\">\u5185\u5b58\u5206\u914d\u673a\u5236<\/td>\n<td align=\"center\">\u5199\u65f6\u590d\u5236&#xff1a;\u7236\u5b50\u8fdb\u7a0b\u5171\u4eab\u4ee3\u7801\u6bb5&#xff0c;\u6570\u636e\u6bb5 \/ \u5806\u6808\u7b49\u4ec5\u5728\u4fee\u6539\u65f6\u62f7\u8d1d&#xff0c;\u521d\u59cb\u5171\u4eab\u7269\u7406\u5185\u5b58<\/td>\n<td align=\"center\">\u5b8c\u5168\u5171\u4eab\u5730\u5740\u7a7a\u95f4&#xff1a;\u7236\u5b50\u8fdb\u7a0b\u5171\u7528\u4e00\u5957\u6570\u636e\u6bb5\u548c\u5806\u6808&#xff0c;\u65e0\u5199\u65f6\u590d\u5236&#xff0c;\u5b50\u8fdb\u7a0b\u4fee\u6539\u6570\u636e\u76f4\u63a5\u5f71\u54cd\u7236\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u6267\u884c\u987a\u5e8f<\/td>\n<td align=\"center\">\u7236\u5b50\u8fdb\u7a0b\u6267\u884c\u6b21\u5e8f\u968f\u673a&#xff0c;\u7531\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u8c03\u5ea6\u7b97\u6cd5\u51b3\u5b9a<\/td>\n<td align=\"center\">\u5f3a\u5236\u5b50\u8fdb\u7a0b\u4f18\u5148\u6267\u884c&#xff0c;\u7236\u8fdb\u7a0b\u88ab\u963b\u585e&#xff0c;\u76f4\u5230\u5b50\u8fdb\u7a0b\u8c03\u7528 exec \u51fd\u6570\u7c07\u6216 _exit \u9000\u51fa<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u8bbe\u8ba1\u76ee\u7684<\/td>\n<td align=\"center\">\u9002\u7528\u4e8e\u5b50\u8fdb\u7a0b\u72ec\u7acb\u6267\u884c\u7236\u8fdb\u7a0b\u4ee3\u7801&#xff0c;\u6216\u540e\u7eed\u6267\u884c\u4efb\u610f\u64cd\u4f5c<\/td>\n<td align=\"center\">\u4e13\u4e3a\u5b50\u8fdb\u7a0b\u521b\u5efa\u540e\u7acb\u5373\u8c03\u7528 exec \u8bbe\u8ba1&#xff0c;\u51cf\u5c11\u5185\u5b58\u590d\u5236\u5f00\u9500&#xff0c;\u63d0\u5347\u6267\u884c\u6548\u7387<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u5b89\u5168\u6027<\/td>\n<td align=\"center\">\u9ad8&#xff1a;\u7236\u5b50\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u76f8\u4e92\u9694\u79bb&#xff0c;\u6570\u636e\u4fee\u6539\u4e92\u4e0d\u5f71\u54cd<\/td>\n<td align=\"center\">\u4f4e&#xff1a;\u5b50\u8fdb\u7a0b\u4fee\u6539\u6570\u636e\u4f1a\u8986\u76d6\u7236\u8fdb\u7a0b\u6570\u636e&#xff1b;\u82e5\u5b50\u8fdb\u7a0b\u672a\u53ca\u65f6\u8c03\u7528 exec\/_exit&#xff0c;\u6613\u5f15\u53d1\u7a0b\u5e8f\u5f02\u5e38<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u8fd4\u56de\u503c\u89c4\u5219<\/td>\n<td align=\"center\">\u6210\u529f&#xff1a;\u7236\u8fdb\u7a0b\u8fd4\u56de\u5b50\u8fdb\u7a0b PID&#xff0c;\u5b50\u8fdb\u7a0b\u8fd4\u56de 0&#xff1b;\u5931\u8d25&#xff1a;\u8fd4\u56de -1<\/td>\n<td align=\"center\">\u4e0e fork \u5b8c\u5168\u4e00\u81f4<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u5b50\u8fdb\u7a0b\u9000\u51fa\u8981\u6c42<\/td>\n<td align=\"center\">\u53ef\u8c03\u7528 exit() \u6216 _exit() \u9000\u51fa<\/td>\n<td align=\"center\">\u5fc5\u987b\u8c03\u7528 _exit() \u9000\u51fa&#xff0c;\u7981\u6b62\u8c03\u7528 exit()&#xff08;\u5426\u5219\u4f1a\u5237\u65b0\u7236\u8fdb\u7a0b IO \u7f13\u51b2\u533a&#xff0c;\u5bfc\u81f4\u6570\u636e\u6df7\u4e71&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>5. exec\u51fd\u6570\u7c07<\/h3>\n<h4>5.1 \u63a5\u53e3\u89c4\u8303<\/h4>\n<p>\u529f\u80fd&#xff1a;\u5728\u8fdb\u7a0b\u4e2d\u52a0\u8f7d\u65b0\u7684\u7a0b\u5e8f\u6587\u4ef6\u6216\u8005\u811a\u672c&#xff0c;\u8986\u76d6\u539f\u6709\u4ee3\u7801&#xff0c;\u91cd\u65b0\u8fd0\u884c<\/p>\n<table>\n<tr>\u9879\u76ee\u8be6\u60c5<\/tr>\n<tbody>\n<tr>\n<td>\u5934\u6587\u4ef6<\/td>\n<td>#include &lt;unistd.h&gt;<\/td>\n<\/tr>\n<tr>\n<td>\u539f\u578b<\/td>\n<td>int execl(const char *path, const char *arg, &#8230;); int execv(const char *path, char *const argv[]); int execle(const char *path, const char *arg, &#8230;, char *const envp[]); int execlp(const char *file, const char *arg, &#8230;); int execvp(const char *file, char *const argv[]); int execvpe(const char *file, char *const argv[], char *const envp[]);<\/td>\n<\/tr>\n<tr>\n<td>\u53c2\u6570<\/td>\n<td>path&#xff1a;\u5373\u5c06\u88ab\u52a0\u8f7d\u6267\u884c\u7684 ELF \u6587\u4ef6\u6216\u811a\u672c\u7684\u8def\u5f84file&#xff1a;\u5373\u5c06\u88ab\u52a0\u8f7d\u6267\u884c\u7684 ELF \u6587\u4ef6\u6216\u811a\u672c\u7684\u540d\u5b57arg&#xff1a;\u4ee5\u5217\u8868\u65b9\u5f0f\u7f57\u5217\u7684 ELF \u6587\u4ef6\u6216\u811a\u672c\u7684\u53c2\u6570argv&#xff1a;\u4ee5\u6570\u7ec4\u65b9\u5f0f\u7ec4\u7ec7\u7684 ELF \u6587\u4ef6\u6216\u811a\u672c\u7684\u53c2\u6570envp&#xff1a;\u7528\u6237\u81ea\u5b9a\u4e49\u7684\u73af\u5883\u53d8\u91cf\u6570\u7ec4<\/td>\n<\/tr>\n<tr>\n<td>\u8fd4\u56de\u503c<\/td>\n<td>\u6210\u529f&#xff1a;\u4e0d\u8fd4\u56de\u5931\u8d25&#xff1a;-1<\/td>\n<\/tr>\n<tr>\n<td>\u5907\u6ce8<\/td>\n<td>1&#xff0c;\u51fd\u6570\u540d\u5b57\u5e26\u5b57\u6bcd l \u610f\u5473\u7740\u5176\u53c2\u6570\u4ee5\u5217\u8868&#xff08;list&#xff09;\u7684\u65b9\u5f0f\u63d0\u4f9b\u30022&#xff0c;\u51fd\u6570\u540d\u5b57\u5e26\u5b57\u6bcd v \u610f\u5473\u7740\u5176\u53c2\u6570\u4ee5\u77e2\u91cf&#xff08;vector&#xff09;\u6570\u7ec4\u7684\u65b9\u5f0f\u63d0\u4f9b\u30023&#xff0c;\u51fd\u6570\u540d\u5b57\u5e26\u5b57\u6bcd p \u610f\u5473\u7740\u4f1a\u5229\u7528\u73af\u5883\u53d8\u91cf PATH \u6765\u627e\u5bfb\u6307\u5b9a\u7684\u6267\u884c\u6587\u4ef6\u30024&#xff0c;\u51fd\u6570\u540d\u5b57\u5e26\u5b57\u6bcd e \u610f\u5473\u7740\u7528\u6237\u63d0\u4f9b\u81ea\u5b9a\u4e49\u7684\u73af\u5883\u53d8\u91cf\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>5.2 \u53c2\u6570\u683c\u5f0f\u8981\u6c42<\/h4>\n<p>\u88ab\u52a0\u8f7d\u7684\u6587\u4ef6\u7684\u53c2\u6570\u5217\u8868\u5fc5\u987b\u4ee5\u81ea\u8eab\u540d\u5b57\u4e3a\u5f00\u59cb&#xff0c;\u4ee5 NULL \u4e3a\u7ed3\u5c3e\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;\u52a0\u8f7d\u5f53\u524d\u76ee\u5f55\u4e0b a.out \u5e76\u4f20\u53c2 &#034;abcd&#034;&#xff1a;<\/p>\n<p><span class=\"token function\">execl<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;.\/a.out&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;a.out&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;abcd&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u6216\u7528\u6570\u7ec4\u65b9\u5f0f&#xff1a;<\/p>\n<p><span class=\"token keyword\">const<\/span> <span class=\"token keyword\">char<\/span> <span class=\"token operator\">*<\/span>argv<span class=\"token punctuation\">[<\/span><span class=\"token number\">3<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token string\">&#034;a.out&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;abcd&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">execv<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;.\/a.out&#034;<\/span><span class=\"token punctuation\">,<\/span> argv<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h4>5.3 \u6267\u884c\u540e\u884c\u4e3a<\/h4>\n<p>exec \u51fd\u6570\u65cf\u6267\u884c\u6210\u529f\u540e&#xff0c;\u539f\u6709\u7a0b\u5e8f\u4ee3\u7801\u4f1a\u88ab\u65b0\u6587\u4ef6 \/ \u811a\u672c\u5b8c\u5168\u8986\u76d6&#xff0c;\u540e\u7eed\u4ee3\u7801\u4e0d\u4f1a\u6267\u884c&#xff0c;\u4e14\u51fd\u6570\u4e0d\u4f1a\u8fd4\u56de\u3002<\/p>\n<p>\u53ea\u6709\u5728\u6267\u884c\u5931\u8d25\u65f6&#xff0c;\u624d\u4f1a\u8fd4\u56de -1&#xff0c;\u7ee7\u7eed\u6267\u884c\u540e\u7eed\u4ee3\u7801\u3002<\/p>\n<h3>6. exit\u548c_exit\u533a\u522b<\/h3>\n<h4>6.1 exit\u6267\u884c\u6d41\u7a0b<\/h4>\n<ul>\n<li>1\u3001\u8c03\u7528atexit\u6ce8\u518c\u9000\u51fa\u5904\u7406\u51fd\u6570\u3002<\/li>\n<li>2\u3001\u5237\u65b0\u5e76\u5173\u95ed\u6240\u6709\u6253\u5f00\u7684\u6807\u51c6IO\u6d41\u3002<\/li>\n<li>3\u3001\u5220\u9664\u521b\u5efa\u7684\u4e34\u65f6\u6587\u4ef6&#xff08;tmpfile\u51fd\u6570&#xff09;\u3002<\/li>\n<li>4\u3001\u8c03\u7528exit\u8fdb\u5165\u5185\u6838\u6001,\u8fdb\u7a0b\u7ec8\u6b62,\u540c\u65f6\u5c06status&#xff08;\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa\u503c&#xff09;\u4f20\u9012\u7ed9\u7236\u8fdb\u7a0b\u3002<\/li>\n<\/ul>\n<h4>6.2 _exit\u6267\u884c\u6d41\u7a0b:<\/h4>\n<ul>\n<li>1\u3001\u76f4\u63a5\u89e6\u53d1\u5185\u6838\u6001\u7684\u7cfb\u7edf\u8c03\u7528&#xff0c;\u8df3\u8fc7\u6240\u6709\u7528\u6237\u6001\u4e0b\u7684\u6e05\u7406\u6b65\u9aa4\u3002<\/li>\n<li>2\u3001\u5185\u6838\u8d1f\u8d23\u5173\u95ed\u8fdb\u7a0b\u6240\u6709\u6253\u5f00\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\u3001\u91ca\u653e\u5185\u5b58\u8d44\u6e90\u7b49\u3002<\/li>\n<li>3\u3001\u5411\u7236\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7&#xff0c;\u4f20\u9012status\u503c\u3002<\/li>\n<\/ul>\n<h4>6.3 \u51fd\u6570exit\u548c_exit\u7684\u63a5\u53e3\u89c4\u8303<\/h4>\n<table>\n<tr>\u7c7b\u522b_exit() \u51fd\u6570exit() \u51fd\u6570<\/tr>\n<tbody>\n<tr>\n<td align=\"center\">\u6838\u5fc3\u529f\u80fd<\/td>\n<td align=\"center\">\u9000\u51fa\u672c\u8fdb\u7a0b<\/td>\n<td align=\"center\">\u9000\u51fa\u672c\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u5934\u6587\u4ef6<\/td>\n<td align=\"center\">#include &lt;unistd.h&gt;<\/td>\n<td align=\"center\">#include &lt;stdlib.h&gt;<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u51fd\u6570\u539f\u578b<\/td>\n<td align=\"center\">void _exit(int status);<\/td>\n<td align=\"center\">void exit(int status);<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u53c2\u6570<\/td>\n<td align=\"center\">status&#xff1a;\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa\u503c<\/td>\n<td align=\"center\">status&#xff1a;\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa\u503c<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u8fd4\u56de\u503c<\/td>\n<td align=\"center\">\u4e0d\u8fd4\u56de<\/td>\n<td align=\"center\">\u4e0d\u8fd4\u56de<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u5907\u6ce81<\/td>\n<td align=\"center\">\u5b50\u8fdb\u7a0b\u6b63\u5e38\u9000\u51fa&#xff0c;status \u4e00\u822c\u4e3a 0&#xff1b;<\/td>\n<td align=\"center\">\u5b50\u8fdb\u7a0b\u6b63\u5e38\u9000\u51fa&#xff0c;status \u4e00\u822c\u4e3a 0&#xff1b;<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u5907\u6ce82<\/td>\n<td align=\"center\">\u5b50\u8fdb\u7a0b\u5f02\u5e38\u9000\u51fa&#xff0c;status \u4e00\u822c\u4e3a\u975e 0&#xff1b;<\/td>\n<td align=\"center\">\u5b50\u8fdb\u7a0b\u5f02\u5e38\u9000\u51fa&#xff0c;status \u4e00\u822c\u4e3a\u975e 0&#xff1b;<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u5907\u6ce83<\/td>\n<td align=\"center\">\u76f4\u63a5\u9000\u51fa&#xff0c;\u4e0d\u51b2\u6d17\u6807\u51c6 IO \u6b8b\u7559\u6570\u636e\u5230\u5185\u6838&#xff0c;\u4e5f\u4e0d\u6267\u884c \u201c\u9000\u51fa\u5904\u7406\u51fd\u6570\u201d<\/td>\n<td align=\"center\">\u9000\u51fa\u65f6\u81ea\u52a8\u51b2\u6d17&#xff08;flush&#xff09;\u6807\u51c6 IO \u4e2d\u6b8b\u7559\u7684\u6570\u636e\u5230\u5185\u6838&#xff1b;\u82e5\u8fdb\u7a0b\u6ce8\u518c\u4e86 \u201c\u9000\u51fa\u5904\u7406\u51fd\u6570\u201d&#xff0c;\u4f1a\u81ea\u52a8\u6267\u884c\u8fd9\u4e9b\u51fd\u6570\u540e\u518d\u9000\u51fa<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>7. wait\u548cwaitpid\u533a\u522b<\/h3>\n<h4>7.1 \u533a\u522b<\/h4>\n<table>\n<tr>waitwaitpid<\/tr>\n<tbody>\n<tr>\n<td align=\"center\">\u7b49\u5f85\u4efb\u610f\u4e00\u4e2a\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa&#xff0c;\u4e0d\u53ef\u6307\u5b9a\u3002<\/td>\n<td align=\"center\">\u53ef\u4ee5\u83b7\u53d6\u6307\u5b9a\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa\u72b6\u6001\u3002<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u5f3a\u5236\u963b\u585e&#xff0c;\u76f4\u5230\u6709\u5b50\u8fdb\u7a0b\u9000\u51fa\u624d\u8fd4\u56de\u3002<\/td>\n<td align=\"center\">\u53ef\u4ee5\u901a\u8fc7\u7b2c\u4e09\u4e2a\u5f62\u53c2\u6765\u8bbe\u7f6e\u975e\u963b\u585e\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>7.2 \u51fd\u6570wait\u548cwaitpid\u7684\u63a5\u53e3\u89c4\u8303<\/h4>\n<p>\u529f\u80fd&#xff1a;\u7b49\u5f85\u5b50\u8fdb\u7a0b\u9000\u51fa&#xff0c;\u83b7\u53d6\u5176\u9000\u51fa\u72b6\u6001&#xff1b;\u53ef\u5c06\u5b50\u8fdb\u7a0b\u72b6\u6001\u5207\u6362\u4e3a EXIT_DEAD&#xff0c;\u4ee5\u4fbf\u7cfb\u7edf\u91ca\u653e\u8d44\u6e90<\/p>\n<table>\n<tr>\u9879\u76ee\u8be6\u60c5<\/tr>\n<tbody>\n<tr>\n<td>\u5934\u6587\u4ef6<\/td>\n<td>#include &lt;sys\/wait.h&gt;<\/td>\n<\/tr>\n<tr>\n<td>\u539f\u578b<\/td>\n<td>pid_t wait(int *stat_loc);&#096;&#096;pid_t waitpid(pid_t pid, int *stat_loc, int options);<\/td>\n<\/tr>\n<tr>\n<td>\u53c2\u6570pid&#xff1a;<\/td>\n<td>\u2460\u5c0f\u4e8e &#8211; 1&#xff1a;\u7b49\u5f85\u7ec4 ID \u7684\u7edd\u5bf9\u503c\u4e3a pid \u7684\u8fdb\u7a0b\u7ec4\u4e2d\u7684\u4efb\u4e00\u5b50\u8fdb\u7a0b \u2461-1&#xff1a;\u7b49\u5f85\u4efb\u4e00\u5b50\u8fdb\u7a0b \u24620&#xff1a;\u7b49\u5f85\u8c03\u7528\u8005\u6240\u5728\u8fdb\u7a0b\u7ec4\u4e2d\u7684\u4efb\u4e00\u5b50\u8fdb\u7a0b \u2463\u5927\u4e8e 0&#xff1a;\u7b49\u5f85\u8fdb\u7a0b\u7ec4 ID \u4e3a pid \u7684\u5b50\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>\u53c2\u6570stat_loc&#xff1a;<\/td>\n<td>\u5b50\u8fdb\u7a0b\u9000\u51fa\u72b6\u6001<\/td>\n<\/tr>\n<tr>\n<td>\u53c2\u6570option&#xff1a;<\/td>\n<td>WCONTINUED&#xff1a;\u62a5\u544a\u4efb\u4e00\u4ece\u6682\u505c\u6001\u51fa\u6765\u4e14\u4ece\u672a\u62a5\u544a\u8fc7\u7684\u5b50\u8fdb\u7a0b\u7684\u72b6\u6001 WNOHANG&#xff1a;\u975e\u963b\u585e\u7b49\u5f85 WUNTRACED&#xff1a;\u62a5\u544a\u4efb\u4e00\u5f53\u524d\u5904\u4e8e\u6682\u505c\u6001\u4e14\u4ece\u672a\u62a5\u544a\u8fc7\u7684\u5b50\u8fdb\u7a0b\u7684\u72b6\u6001<\/td>\n<\/tr>\n<tr>\n<td>\u8fd4\u56de\u503cwait()&#xff1a;<\/td>\n<td>\u6210\u529f&#xff1a;\u9000\u51fa\u7684\u5b50\u8fdb\u7a0bPID \u5931\u8d25&#xff1a;-1<\/td>\n<\/tr>\n<tr>\n<td>\u8fd4\u56de\u503cwaitpid()&#xff1a;<\/td>\n<td>\u6210\u529f&#xff1a;\u72b6\u6001\u53d1\u751f\u6539\u53d8\u7684\u5b50\u8fdb\u7a0b PID&#xff08;\u5982\u679c WNOHANG \u8bbe\u7f6e&#xff0c;\u4e14\u7531 pid \u6307\u5b9a\u7684\u8fdb\u7a0b\u5b58\u5728\u4f46\u72b6\u6001\u672a\u53d1\u751f\u6539\u53d8&#xff0c;\u5219\u8fd4\u56de 0&#xff09; \u5931\u8d25&#xff1a;-1<\/td>\n<\/tr>\n<tr>\n<td>\u5907\u6ce8<\/td>\n<td>\u5982\u679c\u4e0d\u9700\u8981\u83b7\u53d6\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa\u72b6\u6001&#xff0c;stat_loc \u53ef\u4ee5\u8bbe\u7f6e\u4e3a NULL<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>7.3 \u5b50\u8fdb\u7a0b\u9000\u51fa\u72b6\u6001\u89e3\u6790\u5b8f<\/h4>\n<p>\u4e0b\u8868\u4e2d\u7684\u5b8f\u7528\u4e8e\u89e3\u6790\u901a\u8fc7 wait()\/waitpid() \u83b7\u53d6\u5230\u7684\u5b50\u8fdb\u7a0b\u9000\u51fa\u72b6\u6001&#xff1a;<\/p>\n<table>\n<tr>\u5b8f\u542b\u4e49<\/tr>\n<tbody>\n<tr>\n<td>WIFEXITED(status)<\/td>\n<td>\u5982\u679c\u5b50\u8fdb\u7a0b\u6b63\u5e38\u9000\u51fa&#xff0c;\u5219\u8be5\u5b8f\u4e3a\u771f\u3002<\/td>\n<\/tr>\n<tr>\n<td>WEXITSTATUS(status)<\/td>\n<td>\u5982\u679c\u5b50\u8fdb\u7a0b\u6b63\u5e38\u9000\u51fa&#xff0c;\u5219\u8be5\u5b8f\u5c06\u83b7\u53d6\u5b50\u8fdb\u7a0b\u7684\u9000\u51fa\u503c\u3002<\/td>\n<\/tr>\n<tr>\n<td>WIFSIGNALED(status)<\/td>\n<td>\u5982\u679c\u5b50\u8fdb\u7a0b\u88ab\u4fe1\u53f7\u6740\u6b7b&#xff0c;\u5219\u8be5\u5b8f\u4e3a\u771f\u3002<\/td>\n<\/tr>\n<tr>\n<td>WTERMSIG(status)<\/td>\n<td>\u5982\u679c\u5b50\u8fdb\u7a0b\u88ab\u4fe1\u53f7\u6740\u6b7b&#xff0c;\u5219\u8be5\u5b8f\u5c06\u83b7\u53d6\u5bfc\u81f4\u4ed6\u6b7b\u4ea1\u7684\u4fe1\u53f7\u503c\u3002<\/td>\n<\/tr>\n<tr>\n<td>WCOREDUMP(status)<\/td>\n<td>\u5982\u679c\u5b50\u8fdb\u7a0b\u88ab\u4fe1\u53f7\u6740\u6b7b\u4e14\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6&#xff08;core dump&#xff09;&#xff0c;\u5219\u8be5\u5b8f\u4e3a\u771f\u3002&#xff08;\u6ce8&#xff1a;\u8be5\u9009\u9879\u5728\u67d0\u4e9b Unix \u7cfb\u7edf\u4e2d\u65e0\u6548&#xff0c;\u6bd4\u5982 AIX\u3001sunOS&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>WIFSTOPPED(status)<\/td>\n<td>\u5982\u679c\u5b50\u8fdb\u7a0b\u7684\u88ab\u4fe1\u53f7\u6682\u505c&#xff0c;\u4e14 option \u4e2d WUNTRACED \u5df2\u7ecf\u88ab\u8bbe\u7f6e\u65f6&#xff0c;\u5219\u8be5\u5b8f\u4e3a\u771f\u3002<\/td>\n<\/tr>\n<tr>\n<td>WSTOPSIG(status)<\/td>\n<td>\u5982\u679c WIFSTOPPED(status) \u4e3a\u771f&#xff0c;\u5219\u8be5\u5b8f\u5c06\u83b7\u53d6\u5bfc\u81f4\u5b50\u8fdb\u7a0b\u6682\u505c\u7684\u4fe1\u53f7\u503c\u3002<\/td>\n<\/tr>\n<tr>\n<td>WIFCONTINUED(status)<\/td>\n<td>\u5982\u679c\u5b50\u8fdb\u7a0b\u88ab\u4fe1\u53f7 SIGCONT \u91cd\u65b0\u7f6e\u4e3a\u5c31\u7eea\u6001&#xff0c;\u8be5\u5b8f\u4e3a\u771f\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>7.4 \u91cd\u70b9<\/h4>\n<li>\n<p>\u9000\u51fa\u72b6\u6001 vs \u9000\u51fa\u503c<\/p>\n<ul>\n<li>\u9000\u51fa\u72b6\u6001\u662f\u4e00\u4e2a\u5305\u542b\u66f4\u591a\u4fe1\u606f\u7684\u6574\u6570\u503c&#xff0c;\u800c\u9000\u51fa\u503c\u53ea\u662f\u5b50\u8fdb\u7a0b\u901a\u8fc7 exit()\/return \u8fd4\u56de\u7684\u5177\u4f53\u6570\u503c\u3002<\/li>\n<li>\u8981\u60f3\u62ff\u5230\u9000\u51fa\u503c&#xff0c;\u5fc5\u987b\u5148\u7528 WIFEXITED() \u5224\u65ad\u5b50\u8fdb\u7a0b\u662f\u5426\u6b63\u5e38\u9000\u51fa&#xff0c;\u518d\u7528 WEXITSTATUS() \u63d0\u53d6\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6<\/p>\n<p>WCOREDUMP() \u5b8f\u7528\u4e8e\u5224\u65ad\u5b50\u8fdb\u7a0b\u662f\u5426\u5728\u88ab\u4fe1\u53f7\u6740\u6b7b\u65f6\u751f\u6210\u4e86 core dump \u6587\u4ef6&#xff0c;\u4f46\u5b83\u4e0d\u662f POSIX \u6807\u51c6&#xff0c;\u5728 AIX\u3001sunOS \u7b49\u7cfb\u7edf\u4e2d\u65e0\u6548\u3002<\/p>\n<\/li>\n<li>\n<p>\u975e\u963b\u585e\u7b49\u5f85<\/p>\n<p>waitpid() \u7684 WNOHANG \u9009\u9879\u53ef\u4ee5\u8ba9\u51fd\u6570\u7acb\u5373\u8fd4\u56de&#xff0c;\u907f\u514d\u7236\u8fdb\u7a0b\u88ab\u963b\u585e&#xff0c;\u9002\u5408\u9700\u8981\u540c\u65f6\u5904\u7406\u5176\u4ed6\u4efb\u52a1\u7684\u573a\u666f\u3002<\/p>\n<\/li>\n<h3>8. \u8fdb\u7a0b\u7ec4\u3001\u5bf9\u8bdd\u671f\u3001\u7ec8\u7aef<\/h3>\n<h4>8.1 \u8fdb\u7a0b\u7ec4<\/h4>\n<ul>\n<li>1\u3001\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u5171\u4eab\u8fdb\u7a0b\u7ec4ID&#xff08;PGID&#xff09;\u7684\u8fdb\u7a0b\u7ec4\u6210\u7684\u96c6\u5408<\/li>\n<li>2\u3001\u521b\u5efa\u8fdb\u7a0b\u7ec4\u7684\u8fdb\u7a0b\u5176PID &#061; PGID&#xff0c;\u5373\u4f7f\u7ec4\u957f\u8fdb\u7a0b\u7ec8\u6b62&#xff0c;\u8fdb\u7a0b\u7ec4\u4f9d\u7136\u5b58\u5728&#xff0c;\u76f4\u5230\u7ec4\u5185\u6240\u6709\u8fdb\u7a0b\u5168\u90e8\u7ed3\u675f\u3002<\/li>\n<li>3\u3001\u4e00\u4e2a\u8fdb\u7a0b\u53ea\u80fd\u5c5e\u4e8e\u4e00\u4e2a\u8fdb\u7a0b\u7ec4\u3002<\/li>\n<\/ul>\n<h4>8.2 \u5bf9\u8bdd\u671f&#xff08;\u4f1a\u8bdd\u671f&#xff09;<\/h4>\n<ul>\n<li>1\u3001\u4e00\u4e2a\u6216\u591a\u4e2a\u8fdb\u7a0b\u7ec4\u7684\u96c6\u5408&#xff0c;\u4f1a\u8bdd\u7531\u9996\u8fdb\u7a0b\u521b\u5efa&#xff0c;\u4f1a\u8bdd\u5185\u6240\u6709\u8fdb\u7a0b\u5171\u4eab\u4e00\u4e2a\u63a7\u5236\u7ec8\u7aef\u3002<\/li>\n<li>2\u3001\u521b\u5efa\u4f1a\u8bdd\u7684\u8fdb\u7a0b&#xff0c;\u5176PID &#061; \u4f1a\u8bddID&#xff08;SID&#xff09;&#xff0c;\u8be5\u8fdb\u7a0b\u4e0d\u80fd\u662f\u5176\u4ed6\u8fdb\u7a0b\u7ec4\u7684\u7ec4\u957f\u3002<\/li>\n<li>3\u3001\u4e00\u4e2a\u4f1a\u8bdd\u5305\u542b\u591a\u4e2a\u8fdb\u7a0b\u7ec4&#xff0c;\u8fdb\u7a0b\u7ec4\u53c8\u5206\u4e3a\u524d\u53f0\u8fdb\u7a0b\u7ec4\u548c\u540e\u53f0\u8fdb\u7a0b\u7ec4\u3002\n<ul>\n<li>\u2460&#xff1a;\u524d\u53f0\u8fdb\u7a0b\u7ec4\u4e0e\u63a7\u5236\u7ec8\u7aef\u5173\u8fde&#xff0c;\u80fd\u591f\u63a5\u6536\u7ec8\u7aef\u8f93\u5165\u548c\u4fe1\u53f7\u3002<\/li>\n<li>\u2461&#xff1a;\u540e\u53f0\u8fdb\u7a0b\u7ec4\u4e0d\u4e0e\u63a7\u5236\u7ec8\u7aef\u76f4\u63a5\u4ea4\u4e92&#xff0c;\u901a\u5e38\u4e0d\u53d7\u7ec8\u7aef\u4fe1\u53f7\u5f71\u54cd\u3002<\/li>\n<\/ul>\n<\/li>\n<li>4\u3001\u53ea\u6709\u975e\u8fdb\u7a0b\u7ec4\u7ec4\u957f\u7684\u8fdb\u7a0b&#xff08;\u7ec4\u5458\u8fdb\u7a0b&#xff09;\u624d\u80fd\u521b\u5efa\u65b0\u4f1a\u8bdd&#xff0c;\u5982\u679c\u521b\u5efa\u4f1a\u8bdd\u7684\u8fdb\u7a0b\u662f\u7ec4\u957f\u5219\u521b\u5efa\u5931\u8d25\u3002<\/li>\n<li>5\u3001\u4e00\u4e2a\u4f1a\u8bdd\u6700\u591a\u53ea\u80fd\u7ed1\u5b9a\u4e00\u4e2a\u63a7\u5236\u7ec8\u7aef&#xff0c;\u5b83\u4fe9\u662f\u4e00\u5bf9\u4e00\u7684\u5173\u7cfb\u3002<\/li>\n<\/ul>\n<h4>8.3 \u7ec8\u7aef<\/h4>\n<ul>\n<li>1\u3001\u5728Linux\u4e2d\u7684\u7ec8\u7aef\u5176\u5b9e\u5c31\u662f\u4e00\u4e2a\u5b57\u7b26\u8bbe\u5907\u6587\u4ef6&#xff0c;\u4f5c\u4e3a\u8fdb\u7a0b\u4e0e\u7528\u6237\u4ea4\u4e92\u7684\u63a5\u53e3&#xff0c;\u5206\u4e3a\u63a7\u5236\u7ec8\u7aef\u548c\u975e\u63a7\u5236\u7ec8\u7aef\u3002<\/li>\n<li>2\u3001\u4e00\u4e2a\u4f1a\u8bdd\u6700\u591a\u5173\u8054\u4e00\u4e2a\u63a7\u5236\u7ec8\u7aef&#xff0c;\u7531\u4f1a\u8bdd\u9996\u8fdb\u7a0b\u6253\u5f00\u3002<\/li>\n<li>3\u3001\u63a7\u5236\u7ec8\u7aef\u7684\u8fdb\u7a0b\u7ec4ID\u6307\u5411\u5f53\u524d\u524d\u53f0\u8fdb\u7a0b\u7ec4&#xff0c;\u7ec8\u7aef\u8f93\u5165\u7684\u4fe1\u53f7\u4f1a\u53d1\u9001\u7ed9\u524d\u53f0\u8fdb\u7a0b\u7ec4\u3002<\/li>\n<li>4\u3001\u5f53\u5173\u95ed\u63a7\u5236\u7ec8\u7aef\u65f6&#xff0c;\u5185\u6838\u4f1a\u5411\u524d\u53f0\u8fdb\u7a0b\u7ec4\u53d1\u9001\u4fe1\u53f7&#xff08;SIGHUP&#xff09;\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u8fdb\u7a0b\u57fa\u7840<br \/>\n1. \u7a0b\u5e8f\u4e0e\u8fdb\u7a0b<br \/>\n1.1 \u7a0b\u5e8f<br \/>\n1.1.1 \u7a0b\u5e8f\u7684\u6838\u5fc3\u5b9a\u4e49<br \/>\n\u7a0b\u5e8f\u662f\u5b58\u50a8\u5728\u786c\u76d8\u4e0a\u7684\u9759\u6001\u6307\u4ee4\u96c6\u5408\u548c\u6570\u636e\u96c6\u5408&#xff0c;\u662f\u5b8c\u6210\u7279\u5b9a\u4efb\u52a1\u7684\u4ee3\u7801\u6587\u4ef6&#xff1b;\u7a0b\u5e8f\u4ec5\u5360\u7528\u78c1\u76d8\u8d44\u6e90&#xff0c;\u4e0d\u5360\u7528 CPU\u3001\u5185\u5b58\u3001\u8fdb\u7a0b ID&#xff08;PID&#xff09;\u7b49\u7cfb\u7edf\u8fd0\u884c\u8d44\u6e90&#xff1b;\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u683c\u5f0f\u5bf9\u6bd4&#xff1a;<br \/>\n\u64cd\u4f5c\u7cfb\u7edf \/ \u5e73\u53f0\u5178\u578b\u53ef\u6267\u884c\u7a0b\u5e8f\u683c\u5f0f\u8bf4\u660eWindows.exe&#xff08;\u53ef\u6267\u884c\u6587\u4ef6&#xff09;\u53cc\u51fb\u53ef\u76f4\u63a5\u8fd0\u884c<\/p>\n","protected":false},"author":2,"featured_media":64132,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6767,174,58],"topic":[],"class_list":["post-64134","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-6767","tag-c","tag-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8fdb\u7a0b\u4e0e\u7ebf\u7a0b\uff1a\u8fdb\u7a0b\u57fa\u7840 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/64134.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8fdb\u7a0b\u4e0e\u7ebf\u7a0b\uff1a\u8fdb\u7a0b\u57fa\u7840 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u8fdb\u7a0b\u57fa\u7840 1. \u7a0b\u5e8f\u4e0e\u8fdb\u7a0b 1.1 \u7a0b\u5e8f 1.1.1 \u7a0b\u5e8f\u7684\u6838\u5fc3\u5b9a\u4e49 \u7a0b\u5e8f\u662f\u5b58\u50a8\u5728\u786c\u76d8\u4e0a\u7684\u9759\u6001\u6307\u4ee4\u96c6\u5408\u548c\u6570\u636e\u96c6\u5408&#xff0c;\u662f\u5b8c\u6210\u7279\u5b9a\u4efb\u52a1\u7684\u4ee3\u7801\u6587\u4ef6&#xff1b;\u7a0b\u5e8f\u4ec5\u5360\u7528\u78c1\u76d8\u8d44\u6e90&#xff0c;\u4e0d\u5360\u7528 CPU\u3001\u5185\u5b58\u3001\u8fdb\u7a0b ID&#xff08;PID&#xff09;\u7b49\u7cfb\u7edf\u8fd0\u884c\u8d44\u6e90&#xff1b;\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u683c\u5f0f\u5bf9\u6bd4&#xff1a; \u64cd\u4f5c\u7cfb\u7edf \/ \u5e73\u53f0\u5178\u578b\u53ef\u6267\u884c\u7a0b\u5e8f\u683c\u5f0f\u8bf4\u660eWindows.exe&#xff08;\u53ef\u6267\u884c\u6587\u4ef6&#xff09;\u53cc\u51fb\u53ef\u76f4\u63a5\u8fd0\u884c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/64134.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-22T12:56:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260122125632-69721e80169f1.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/64134.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/64134.html\",\"name\":\"\u8fdb\u7a0b\u4e0e\u7ebf\u7a0b\uff1a\u8fdb\u7a0b\u57fa\u7840 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-22T12:56:33+00:00\",\"dateModified\":\"2026-01-22T12:56:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/64134.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/64134.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/64134.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8fdb\u7a0b\u4e0e\u7ebf\u7a0b\uff1a\u8fdb\u7a0b\u57fa\u7840\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u8fdb\u7a0b\u4e0e\u7ebf\u7a0b\uff1a\u8fdb\u7a0b\u57fa\u7840 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/64134.html","og_locale":"zh_CN","og_type":"article","og_title":"\u8fdb\u7a0b\u4e0e\u7ebf\u7a0b\uff1a\u8fdb\u7a0b\u57fa\u7840 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u8fdb\u7a0b\u57fa\u7840 1. \u7a0b\u5e8f\u4e0e\u8fdb\u7a0b 1.1 \u7a0b\u5e8f 1.1.1 \u7a0b\u5e8f\u7684\u6838\u5fc3\u5b9a\u4e49 \u7a0b\u5e8f\u662f\u5b58\u50a8\u5728\u786c\u76d8\u4e0a\u7684\u9759\u6001\u6307\u4ee4\u96c6\u5408\u548c\u6570\u636e\u96c6\u5408&#xff0c;\u662f\u5b8c\u6210\u7279\u5b9a\u4efb\u52a1\u7684\u4ee3\u7801\u6587\u4ef6&#xff1b;\u7a0b\u5e8f\u4ec5\u5360\u7528\u78c1\u76d8\u8d44\u6e90&#xff0c;\u4e0d\u5360\u7528 CPU\u3001\u5185\u5b58\u3001\u8fdb\u7a0b ID&#xff08;PID&#xff09;\u7b49\u7cfb\u7edf\u8fd0\u884c\u8d44\u6e90&#xff1b;\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u683c\u5f0f\u5bf9\u6bd4&#xff1a; \u64cd\u4f5c\u7cfb\u7edf \/ \u5e73\u53f0\u5178\u578b\u53ef\u6267\u884c\u7a0b\u5e8f\u683c\u5f0f\u8bf4\u660eWindows.exe&#xff08;\u53ef\u6267\u884c\u6587\u4ef6&#xff09;\u53cc\u51fb\u53ef\u76f4\u63a5\u8fd0\u884c","og_url":"https:\/\/www.wsisp.com\/helps\/64134.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-22T12:56:33+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260122125632-69721e80169f1.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/64134.html","url":"https:\/\/www.wsisp.com\/helps\/64134.html","name":"\u8fdb\u7a0b\u4e0e\u7ebf\u7a0b\uff1a\u8fdb\u7a0b\u57fa\u7840 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-22T12:56:33+00:00","dateModified":"2026-01-22T12:56:33+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/64134.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/64134.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/64134.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u8fdb\u7a0b\u4e0e\u7ebf\u7a0b\uff1a\u8fdb\u7a0b\u57fa\u7840"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/64134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=64134"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/64134\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/64132"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=64134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=64134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=64134"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=64134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}