{"id":91025,"date":"2026-08-06T16:00:39","date_gmt":"2026-08-06T08:00:39","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/91025.html"},"modified":"2026-08-06T16:00:39","modified_gmt":"2026-08-06T08:00:39","slug":"linux-%e7%b3%bb%e7%bb%9f%e7%bc%96%e7%a8%8b%e6%a0%b8%e5%bf%83%e7%9f%a5%e8%af%86%e7%82%b9%e6%80%bb%e7%bb%93%ef%bc%9a%e4%bb%8e%e5%ba%93%e5%88%b0%e8%bf%9b%e7%a8%8b%e7%9a%84%e5%ba%95%e5%b1%82%e5%ae%9e","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/91025.html","title":{"rendered":"Linux \u7cfb\u7edf\u7f16\u7a0b\u6838\u5fc3\u77e5\u8bc6\u70b9\u603b\u7ed3\uff1a\u4ece\u5e93\u5230\u8fdb\u7a0b\u7684\u5e95\u5c42\u5b9e\u8df5"},"content":{"rendered":"<p>\u4f5c\u4e3a\u4e00\u540d\u540e\u7aef\u5f00\u53d1\u5b66\u4e60\u8005&#xff0c;\u6700\u8fd1\u5728\u7cfb\u7edf\u68b3\u7406 Linux \u7cfb\u7edf\u7f16\u7a0b\u7684\u6838\u5fc3\u77e5\u8bc6\u70b9&#xff0c;\u4ece\u52a8\u6001\u5e93\u7684\u7f16\u8bd1\u5230\u8fdb\u7a0b\u7684\u521b\u5efa\u4e0e\u7ba1\u7406&#xff0c;\u6bcf\u4e00\u6b65\u90fd\u85cf\u7740\u64cd\u4f5c\u7cfb\u7edf\u7684\u5e95\u5c42\u8bbe\u8ba1\u601d\u60f3\u3002\u4eca\u5929\u5c31\u628a\u8fd9\u6bb5\u65f6\u95f4\u7684\u5b66\u4e60\u7b14\u8bb0\u6574\u7406\u6210\u4e00\u7bc7\u535a\u5ba2&#xff0c;\u65b9\u4fbf\u81ea\u5df1\u56de\u987e\u4e5f\u5e0c\u671b\u80fd\u5e2e\u5230\u540c\u6837\u5728\u5b66\u4e60\u7684\u670b\u53cb\u3002<\/p>\n<h3>\u4e00\u3001\u52a8\u6001\u5e93\u4e0e\u9759\u6001\u5e93&#xff1a;\u7f16\u8bd1\u4e0e\u94fe\u63a5\u7684\u827a\u672f<\/h3>\n<h4>1. \u5e93\u7684\u57fa\u672c\u6982\u5ff5<\/h4>\n<p>\u5e93\u662f\u9884\u5148\u7f16\u8bd1\u597d\u7684\u65b9\u6cd5&#xff08;\u51fd\u6570&#xff09;\u7684\u96c6\u5408&#xff0c;\u672c\u8d28\u4e0a\u662f.o\u76ee\u6807\u6587\u4ef6\u7684\u6253\u5305&#xff0c;\u65b9\u4fbf\u4ee3\u7801\u590d\u7528\u548c\u6a21\u5757\u5316\u5f00\u53d1\u3002\u5728 Linux \u4e0b\u4e3b\u8981\u5206\u4e3a\u4e24\u79cd&#xff1a;<\/p>\n<ul>\n<li>\u9759\u6001\u5e93&#xff08;.a&#xff09;&#xff1a;\u7f16\u8bd1\u65f6\u5c06\u5e93\u4ee3\u7801\u76f4\u63a5\u5d4c\u5165\u53ef\u6267\u884c\u6587\u4ef6&#xff0c;\u8fd0\u884c\u65f6\u65e0\u9700\u4f9d\u8d56\u5e93\u6587\u4ef6&#xff0c;\u4f46\u4f1a\u5bfc\u81f4\u53ef\u6267\u884c\u6587\u4ef6\u4f53\u79ef\u8f83\u5927\u3002<\/li>\n<li>\u5171\u4eab\u5e93&#xff08;\u52a8\u6001\u5e93&#xff0c;.so&#xff09;&#xff1a;\u7f16\u8bd1\u65f6\u4ec5\u8bb0\u5f55\u5e93\u7684\u5f15\u7528\u4fe1\u606f&#xff0c;\u8fd0\u884c\u65f6\u7531\u7cfb\u7edf\u52a8\u6001\u52a0\u8f7d\u5230\u5185\u5b58&#xff0c;\u591a\u4e2a\u7a0b\u5e8f\u53ef\u5171\u4eab\u540c\u4e00\u4efd\u5e93\u4ee3\u7801&#xff0c;\u4f53\u79ef\u66f4\u5c0f\u3001\u66f4\u65b0\u66f4\u65b9\u4fbf\u3002<\/li>\n<\/ul>\n<h4>2. \u52a8\u6001\u5e93\u7684\u7f16\u8bd1\u4e0e\u4f7f\u7528<\/h4>\n<p>\u4ee5\u4e00\u4e2a\u7b80\u5355\u7684\u6570\u5b66\u8fd0\u7b97\u5e93\u4e3a\u4f8b&#xff0c;\u6211\u4eec\u6709\u4e09\u4e2a\u6e90\u6587\u4ef6&#xff1a;add.c&#xff08;\u52a0\u6cd5\u5b9e\u73b0&#xff09;\u3001max.c&#xff08;\u6700\u5927\u503c\u5b9e\u73b0&#xff09;\u3001main.c&#xff08;\u4e3b\u7a0b\u5e8f&#xff09;\u3002<\/p>\n<p>\u7f16\u8bd1\u751f\u6210\u52a8\u6001\u5e93&#xff1a;<\/p>\n<p>gcc -shared -fPIC -o libmath.so add.c max.c<\/p>\n<ul>\n<li>-fPIC&#xff1a;\u751f\u6210\u4f4d\u7f6e\u65e0\u5173\u4ee3\u7801&#xff08;Position Independent Code&#xff09;&#xff0c;\u786e\u4fdd\u5e93\u80fd\u88ab\u52a0\u8f7d\u5230\u4efb\u610f\u5185\u5b58\u5730\u5740\u3002<\/li>\n<li>-shared&#xff1a;\u6307\u5b9a\u751f\u6210\u5171\u4eab\u5e93\u3002<\/li>\n<li>\u5e93\u547d\u540d\u89c4\u8303&#xff1a;libxxx.so&#xff0c;\u65b9\u4fbf\u7f16\u8bd1\u5668\u901a\u8fc7-lxxx\u81ea\u52a8\u67e5\u627e\u3002<\/li>\n<\/ul>\n<p>\u94fe\u63a5\u4e0e\u8fd0\u884c&#xff1a;<\/p>\n<p># \u7f16\u8bd1\u4e3b\u7a0b\u5e8f\u5e76\u94fe\u63a5\u52a8\u6001\u5e93<br \/>\ngcc -o main main.c -L. -lmath<br \/>\n# \u8fd0\u884c\u65f6\u6307\u5b9a\u5e93\u8def\u5f84&#xff08;\u4e34\u65f6\u6d4b\u8bd5&#xff09;<br \/>\nLD_LIBRARY_PATH&#061;. .\/main<\/p>\n<ul>\n<li>-L.&#xff1a;\u544a\u8bc9\u7f16\u8bd1\u5668\u5728\u5f53\u524d\u76ee\u5f55\u67e5\u627e\u5e93\u6587\u4ef6\u3002<\/li>\n<li>-lmath&#xff1a;\u94fe\u63a5libmath.so\u5e93\u3002<\/li>\n<li>LD_LIBRARY_PATH&#xff1a;\u4e34\u65f6\u8bbe\u7f6e\u52a8\u6001\u5e93\u52a0\u8f7d\u8def\u5f84&#xff0c;\u907f\u514d\u7cfb\u7edf\u9ed8\u8ba4\u8def\u5f84\u627e\u4e0d\u5230\u5e93\u7684\u95ee\u9898\u3002<\/li>\n<\/ul>\n<h4>3. Makefile \u81ea\u52a8\u5316\u6784\u5efa<\/h4>\n<p>\u624b\u52a8\u6572\u7f16\u8bd1\u547d\u4ee4\u592a\u7e41\u7410&#xff0c;\u6211\u4eec\u53ef\u4ee5\u7528 Makefile \u6765\u81ea\u52a8\u5316\u6784\u5efa\u6d41\u7a0b&#xff1a;<\/p>\n<p>all: main<br \/>\nmain: add.c main.c max.c<br \/>\ngcc -o main add.c main.c max.c<br \/>\nclean:<br \/>\nrm -rf *.o main<\/p>\n<ul>\n<li>all&#xff1a;\u9ed8\u8ba4\u76ee\u6807&#xff0c;\u6267\u884cmake\u65f6\u81ea\u52a8\u6784\u5efamain\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/li>\n<li>main&#xff1a;\u4f9d\u8d56\u4e09\u4e2a\u6e90\u6587\u4ef6&#xff0c;\u547d\u4ee4\u884c\u7528gcc\u76f4\u63a5\u7f16\u8bd1\u751f\u6210\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/li>\n<li>clean&#xff1a;\u6e05\u7406\u7f16\u8bd1\u751f\u6210\u7684\u76ee\u6807\u6587\u4ef6\u548c\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<h3>\u4e8c\u3001\u8fdb\u7a0b\u57fa\u7840&#xff1a;\u4ece\u7a0b\u5e8f\u5230\u8fdb\u7a0b\u7684\u8715\u53d8<\/h3>\n<h4>1. \u6838\u5fc3\u6982\u5ff5\u68b3\u7406<\/h4>\n<ul>\n<li>\u7a0b\u5e8f&#xff1a;\u5b58\u50a8\u5728\u78c1\u76d8\u4e0a\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6&#xff0c;\u662f\u9759\u6001\u7684\u4ee3\u7801\u96c6\u5408\u3002<\/li>\n<li>\u8fdb\u7a0b&#xff1a;\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7684\u5b9e\u4f8b&#xff0c;\u662f\u64cd\u4f5c\u7cfb\u7edf\u5206\u914d\u8d44\u6e90\u7684\u57fa\u672c\u5355\u4f4d&#xff0c;\u5305\u542b\u4ee3\u7801\u3001\u6570\u636e\u3001\u5806\u6808\u3001PCB&#xff08;\u8fdb\u7a0b\u63a7\u5236\u5757&#xff09;\u7b49\u3002<\/li>\n<li>PCB&#xff08;\u8fdb\u7a0b\u63a7\u5236\u5757&#xff09;&#xff1a;\u5185\u6838\u4e2d\u63cf\u8ff0\u8fdb\u7a0b\u7684\u6570\u636e\u7ed3\u6784&#xff0c;\u8bb0\u5f55\u8fdb\u7a0b PID\u3001\u72b6\u6001\u3001\u5185\u5b58\u5730\u5740\u3001\u6253\u5f00\u6587\u4ef6\u7b49\u4fe1\u606f&#xff0c;\u662f\u8fdb\u7a0b\u7684 &#034;\u8eab\u4efd\u8bc1&#034;\u3002<\/li>\n<li>PID&#xff1a;\u8fdb\u7a0b\u7684\u552f\u4e00\u6807\u8bc6\u7b26&#xff0c;\u7531\u64cd\u4f5c\u7cfb\u7edf\u5206\u914d\u3002<\/li>\n<\/ul>\n<h4>2. \u8fdb\u7a0b\u521b\u5efa&#xff1a;fork () \u7684\u9b54\u6cd5<\/h4>\n<p>\u5728 Linux \u4e2d&#xff0c;fork()\u662f\u521b\u5efa\u65b0\u8fdb\u7a0b\u7684\u6838\u5fc3\u7cfb\u7edf\u8c03\u7528&#xff0c;\u5b83\u4f1a\u590d\u5236\u5f53\u524d\u8fdb\u7a0b&#xff08;\u7236\u8fdb\u7a0b&#xff09;\u751f\u6210\u4e00\u4e2a\u51e0\u4e4e\u5b8c\u5168\u4e00\u6837\u7684\u5b50\u8fdb\u7a0b\u3002<\/p>\n<p>\u5173\u952e\u7279\u6027&#xff1a;<\/p>\n<ul>\n<li>\u4e00\u6b21\u8c03\u7528&#xff0c;\u4e24\u6b21\u8fd4\u56de&#xff1a;\u5728\u7236\u8fdb\u7a0b\u4e2d\u8fd4\u56de\u5b50\u8fdb\u7a0b PID&#xff0c;\u5728\u5b50\u8fdb\u7a0b\u4e2d\u8fd4\u56de 0&#xff0c;\u5931\u8d25\u8fd4\u56de &#8211; 1\u3002<\/li>\n<li>\u5199\u65f6\u590d\u5236&#xff08;Copy-on-Write&#xff09;&#xff1a;fork \u540e\u7236\u5b50\u8fdb\u7a0b\u5171\u4eab\u540c\u4e00\u4efd\u7269\u7406\u5185\u5b58&#xff0c;\u53ea\u6709\u5f53\u67d0\u4e00\u65b9\u4fee\u6539\u5185\u5b58\u65f6&#xff0c;\u5185\u6838\u624d\u4f1a\u590d\u5236\u5bf9\u5e94\u7684\u9875\u9762&#xff0c;\u6781\u5927\u63d0\u5347\u4e86\u521b\u5efa\u6548\u7387\u3002<\/li>\n<li>\u72ec\u7acb\u6267\u884c\u6d41&#xff1a;\u5b50\u8fdb\u7a0b\u4ecefork()\u8fd4\u56de\u5904\u5f00\u59cb\u6267\u884c&#xff0c;\u800c\u975e\u4ece\u7a0b\u5e8f\u5f00\u5934\u91cd\u65b0\u8fd0\u884c\u3002<\/li>\n<\/ul>\n<p>\u793a\u4f8b\u4ee3\u7801&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;unistd.h&gt;<br \/>\n#include &lt;sys\/wait.h&gt;<\/p>\n<p>int main() {<br \/>\n    pid_t pid &#061; fork();<br \/>\n    if (pid &#061;&#061; -1) {<br \/>\n        perror(&#034;fork failed&#034;);<br \/>\n        return 1;<br \/>\n    } else if (pid &#061;&#061; 0) {<br \/>\n        \/\/ \u5b50\u8fdb\u7a0b\u903b\u8f91<br \/>\n        printf(&#034;\u6211\u662f\u5b50\u8fdb\u7a0b&#xff0c;PID: %d&#xff0c;\u7236\u8fdb\u7a0bPID: %d\\\\n&#034;, getpid(), getppid());<br \/>\n        _exit(0); \/\/ \u5b50\u8fdb\u7a0b\u9000\u51fa&#xff0c;\u907f\u514d\u6e05\u7406\u7236\u8fdb\u7a0b\u8d44\u6e90<br \/>\n    } else {<br \/>\n        \/\/ \u7236\u8fdb\u7a0b\u903b\u8f91<br \/>\n        printf(&#034;\u6211\u662f\u7236\u8fdb\u7a0b&#xff0c;PID: %d&#xff0c;\u5b50\u8fdb\u7a0bPID: %d\\\\n&#034;, getpid(), pid);<br \/>\n        wait(NULL); \/\/ \u7b49\u5f85\u5b50\u8fdb\u7a0b\u7ed3\u675f&#xff0c;\u907f\u514d\u50f5\u5c38\u8fdb\u7a0b<br \/>\n    }<br \/>\n    return 0;<br \/>\n}<\/p>\n<h4>3. \u8fdb\u7a0b\u6811\u4e0e fork () \u8fdb\u9636<\/h4>\n<p>\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u591a\u6b21\u8c03\u7528fork()\u6765\u521b\u5efa\u590d\u6742\u7684\u8fdb\u7a0b\u6811&#xff1a;<\/p>\n<p>\u6848\u4f8b 1&#xff1a;fork()|fork()<\/p>\n<p>fork();<br \/>\nfork();<br \/>\nprintf(&#034;A\\\\n&#034;);<\/p>\n<p>\u6267\u884c\u540e\u4f1a\u6253\u5370 4 \u6b21 &#034;A&#034;&#xff0c;\u56e0\u4e3a\u7b2c\u4e00\u6b21fork()\u4ea7\u751f 2 \u4e2a\u8fdb\u7a0b&#xff0c;\u7b2c\u4e8c\u6b21fork()\u8ba9\u6bcf\u4e2a\u8fdb\u7a0b\u518d\u4ea7\u751f\u4e00\u4e2a\u5b50\u8fdb\u7a0b&#xff0c;\u6700\u7ec8\u5171 4 \u4e2a\u8fdb\u7a0b\u3002<\/p>\n<p>\u6848\u4f8b 2&#xff1a;fork()&amp;&amp;fork()<\/p>\n<p>fork() &amp;&amp; fork();<br \/>\nprintf(&#034;A\\\\n&#034;);<\/p>\n<p>\u6267\u884c\u540e\u4f1a\u6253\u5370 3 \u6b21 &#034;A&#034;&#xff0c;\u56e0\u4e3a\u53ea\u6709\u7236\u8fdb\u7a0b&#xff08;fork()\u8fd4\u56de\u975e 0&#xff09;\u624d\u4f1a\u6267\u884c\u7b2c\u4e8c\u4e2afork()&#xff0c;\u5b50\u8fdb\u7a0b&#xff08;fork()\u8fd4\u56de 0&#xff09;\u4f1a\u77ed\u8def\u8df3\u8fc7\u7b2c\u4e8c\u4e2afork()\u3002<\/p>\n<h4>4. \u50f5\u5c38\u8fdb\u7a0b\u4e0e\u5b64\u513f\u8fdb\u7a0b<\/h4>\n<ul>\n<li>\u50f5\u5c38\u8fdb\u7a0b&#xff08;Zombie&#xff09;&#xff1a;\u5b50\u8fdb\u7a0b\u9000\u51fa\u540e&#xff0c;\u7236\u8fdb\u7a0b\u672a\u8c03\u7528wait()\/waitpid()\u56de\u6536\u5176\u9000\u51fa\u72b6\u6001&#xff0c;\u5bfc\u81f4\u5b50\u8fdb\u7a0b PCB \u6b8b\u7559&#xff0c;\u5360\u7528\u7cfb\u7edf\u8d44\u6e90\u3002<\/li>\n<li>\u5b64\u513f\u8fdb\u7a0b&#xff08;Orphan&#xff09;&#xff1a;\u7236\u8fdb\u7a0b\u5148\u4e8e\u5b50\u8fdb\u7a0b\u9000\u51fa&#xff0c;\u5b50\u8fdb\u7a0b\u88abinit&#xff08;\u6216systemd&#xff09;\u8fdb\u7a0b\u6536\u517b&#xff0c;\u7531\u5176\u8d1f\u8d23\u56de\u6536\u3002<\/li>\n<\/ul>\n<p>\u907f\u514d\u50f5\u5c38\u8fdb\u7a0b&#xff1a;<\/p>\n<li>\u7236\u8fdb\u7a0b\u8c03\u7528wait()\/waitpid()\u4e3b\u52a8\u56de\u6536\u3002<\/li>\n<li>\u6ce8\u518cSIGCHLD\u4fe1\u53f7\u5904\u7406\u51fd\u6570&#xff0c;\u5728\u5b50\u8fdb\u7a0b\u9000\u51fa\u65f6\u81ea\u52a8\u56de\u6536\u3002<\/li>\n<li>\u7236\u8fdb\u7a0b\u5148\u9000\u51fa&#xff0c;\u8ba9\u5b50\u8fdb\u7a0b\u6210\u4e3a\u5b64\u513f\u8fdb\u7a0b\u88abinit\u6536\u517b\u3002<\/li>\n<hr \/>\n<h3>\u4e09\u3001\u5185\u5b58\u7ba1\u7406&#xff1a;\u865a\u62df\u5730\u5740\u4e0e\u7269\u7406\u5730\u5740\u7684\u6620\u5c04<\/h3>\n<h4>1. \u865a\u62df\u5185\u5b58\u4e0e\u5206\u9875<\/h4>\n<p>Linux \u91c7\u7528\u865a\u62df\u5185\u5b58\u673a\u5236&#xff0c;\u6bcf\u4e2a\u8fdb\u7a0b\u90fd\u62e5\u6709\u72ec\u7acb\u7684 4GB&#xff08;32 \u4f4d\u7cfb\u7edf&#xff09;\u865a\u62df\u5730\u5740\u7a7a\u95f4&#xff0c;\u901a\u8fc7\u9875\u8868\u6620\u5c04\u5230\u7269\u7406\u5185\u5b58&#xff1a;<\/p>\n<ul>\n<li>\u9875&#xff08;Page&#xff09;&#xff1a;\u865a\u62df\u5185\u5b58\u548c\u7269\u7406\u5185\u5b58\u7684\u57fa\u672c\u5355\u4f4d&#xff0c;\u901a\u5e38\u4e3a 4KB\u3002<\/li>\n<li>\u9875\u8868&#xff08;Page Table&#xff09;&#xff1a;\u8bb0\u5f55\u865a\u62df\u9875\u5230\u7269\u7406\u9875\u6846\u7684\u6620\u5c04\u5173\u7cfb&#xff0c;\u7531\u5185\u6838\u7ef4\u62a4\u3002<\/li>\n<li>MMU&#xff08;\u5185\u5b58\u7ba1\u7406\u5355\u5143&#xff09;&#xff1a;\u786c\u4ef6\u6a21\u5757&#xff0c;\u8d1f\u8d23\u5c06\u865a\u62df\u5730\u5740\u8f6c\u6362\u4e3a\u7269\u7406\u5730\u5740\u3002<\/li>\n<\/ul>\n<h4>2. \u865a\u62df\u5730\u5740 vs \u7269\u7406\u5730\u5740<\/h4>\n<ul>\n<li>\u865a\u62df\u5730\u5740&#xff1a;\u8fdb\u7a0b\u89c6\u89d2\u770b\u5230\u7684\u5730\u5740&#xff0c;\u6bcf\u4e2a\u8fdb\u7a0b\u72ec\u7acb&#xff0c;\u8303\u56f4\u4ece0x00000000\u52300xFFFFFFFF\u3002<\/li>\n<li>\u7269\u7406\u5730\u5740&#xff1a;\u5b9e\u9645\u5185\u5b58\u786c\u4ef6\u7684\u5730\u5740&#xff0c;\u7531\u5185\u6838\u7edf\u4e00\u7ba1\u7406\u3002<\/li>\n<li>\u4f18\u52bf&#xff1a;\u8fdb\u7a0b\u95f4\u5730\u5740\u7a7a\u95f4\u9694\u79bb&#xff0c;\u907f\u514d\u76f8\u4e92\u5e72\u6270&#xff1b;\u652f\u6301\u5185\u5b58\u6269\u5bb9&#xff08;\u4ea4\u6362\u5230\u78c1\u76d8&#xff09;&#xff0c;\u8ba9\u7a0b\u5e8f\u80fd\u4f7f\u7528\u6bd4\u7269\u7406\u5185\u5b58\u66f4\u5927\u7684\u7a7a\u95f4\u3002<\/li>\n<\/ul>\n<h4>3. \u5199\u65f6\u590d\u5236&#xff08;Copy-on-Write&#xff09;<\/h4>\n<p>\u8fd9\u662f Linux \u4f18\u5316fork()\u6027\u80fd\u7684\u5173\u952e\u6280\u672f&#xff1a;<\/p>\n<ul>\n<li>fork \u540e\u7236\u5b50\u8fdb\u7a0b\u5171\u4eab\u6240\u6709\u7269\u7406\u9875&#xff0c;\u5185\u6838\u5c06\u9875\u9762\u6807\u8bb0\u4e3a &#034;\u53ea\u8bfb&#034;\u3002<\/li>\n<li>\u5f53\u67d0\u8fdb\u7a0b\u5c1d\u8bd5\u4fee\u6539\u9875\u9762\u65f6&#xff0c;\u89e6\u53d1\u7f3a\u9875\u4e2d\u65ad&#xff0c;\u5185\u6838\u590d\u5236\u4e00\u4efd\u65b0\u7684\u7269\u7406\u9875\u7ed9\u8be5\u8fdb\u7a0b&#xff0c;\u5e76\u66f4\u65b0\u9875\u8868\u3002<\/li>\n<li>\u53ea\u6709\u5199\u5165\u64cd\u4f5c\u624d\u4f1a\u89e6\u53d1\u590d\u5236&#xff0c;\u8bfb\u64cd\u4f5c\u5b8c\u5168\u5171\u4eab&#xff0c;\u6781\u5927\u51cf\u5c11\u4e86\u5185\u5b58\u5f00\u9500\u548c\u8fdb\u7a0b\u521b\u5efa\u65f6\u95f4\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u56db\u3001\u6587\u4ef6 I\/O \u4e0e\u7cfb\u7edf\u8c03\u7528<\/h3>\n<h4>1. \u6587\u4ef6\u63cf\u8ff0\u7b26<\/h4>\n<p>Linux \u4e2d\u4e00\u5207\u7686\u6587\u4ef6&#xff0c;\u8fdb\u7a0b\u901a\u8fc7\u6587\u4ef6\u63cf\u8ff0\u7b26&#xff08;File Descriptor&#xff09;\u6765\u8bbf\u95ee\u6587\u4ef6&#xff1a;<\/p>\n<ul>\n<li>\u6807\u51c6\u8f93\u5165&#xff1a;0&#xff08;STDIN_FILENO&#xff09;<\/li>\n<li>\u6807\u51c6\u8f93\u51fa&#xff1a;1&#xff08;STDOUT_FILENO&#xff09;<\/li>\n<li>\u6807\u51c6\u9519\u8bef&#xff1a;2&#xff08;STDERR_FILENO&#xff09;<\/li>\n<li>\u5176\u4ed6\u6587\u4ef6&#xff1a;\u7531open()\u7cfb\u7edf\u8c03\u7528\u5206\u914d&#xff0c;\u4ece 3 \u5f00\u59cb\u9012\u589e\u3002<\/li>\n<\/ul>\n<h4>2. \u6838\u5fc3\u7cfb\u7edf\u8c03\u7528<\/h4>\n<p>c<\/p>\n<p>\u8fd0\u884c<\/p>\n<p>#include &lt;unistd.h&gt;<br \/>\n#include &lt;fcntl.h&gt;<\/p>\n<p>\/\/ \u6253\u5f00\u6587\u4ef6<br \/>\nint open(const char *pathname, int flags, mode_t mode);<br \/>\n\/\/ \u8bfb\u53d6\u6587\u4ef6<br \/>\nssize_t read(int fd, void *buf, size_t count);<br \/>\n\/\/ \u5199\u5165\u6587\u4ef6<br \/>\nssize_t write(int fd, const void *buf, size_t count);<br \/>\n\/\/ \u5173\u95ed\u6587\u4ef6<br \/>\nint close(int fd);<br \/>\n\/\/ \u79fb\u52a8\u6587\u4ef6\u504f\u79fb\u91cf<br \/>\noff_t lseek(int fd, off_t offset, int whence);<\/p>\n<ul>\n<li>fork()\u540e\u5b50\u8fdb\u7a0b\u4f1a\u7ee7\u627f\u7236\u8fdb\u7a0b\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\u8868&#xff0c;\u5171\u4eab\u6587\u4ef6\u504f\u79fb\u91cf\u3002<\/li>\n<li>read()\u8fd4\u56de 0 \u8868\u793a\u5230\u8fbe\u6587\u4ef6\u672b\u5c3e&#xff0c;\u8fd4\u56de &#8211; 1 \u8868\u793a\u51fa\u9519\u3002<\/li>\n<\/ul>\n<h4>3. \u5e93\u51fd\u6570 vs \u7cfb\u7edf\u8c03\u7528<\/h4>\n<ul>\n<li>\u7cfb\u7edf\u8c03\u7528&#xff1a;\u5185\u6838\u63d0\u4f9b\u7684\u5e95\u5c42\u63a5\u53e3&#xff0c;\u76f4\u63a5\u4e0e\u786c\u4ef6\u4ea4\u4e92&#xff0c;\u5982open()\/read()\/write()&#xff0c;\u5f00\u9500\u8f83\u5927\u4f46\u529f\u80fd\u57fa\u7840\u3002<\/li>\n<li>\u5e93\u51fd\u6570&#xff1a;\u5728\u7cfb\u7edf\u8c03\u7528\u57fa\u7840\u4e0a\u5c01\u88c5\u7684\u9ad8\u5c42\u63a5\u53e3&#xff0c;\u5982fopen()\/fread()\/fwrite()&#xff0c;\u81ea\u5e26\u7f13\u51b2\u533a&#xff0c;\u6548\u7387\u66f4\u9ad8\u66f4\u6613\u7528\u3002<\/li>\n<li>\u7f13\u51b2\u533a\u95ee\u9898&#xff1a;\u6807\u51c6\u8f93\u51fa&#xff08;stdout&#xff09;\u9ed8\u8ba4\u662f\u884c\u7f13\u51b2&#xff0c;\u9047\u5230\\\\n\u624d\u4f1a\u5237\u65b0&#xff1b;\u5982\u679c\u9700\u8981\u7acb\u5373\u8f93\u51fa&#xff0c;\u53ef\u8c03\u7528fflush(stdout)\u3002<\/li>\n<\/ul>\n<h3>\u4e94\u3001\u8fdb\u7a0b\u66ff\u6362&#xff1a;exec \u7cfb\u5217\u51fd\u6570<\/h3>\n<p>fork()\u521b\u5efa\u7684\u5b50\u8fdb\u7a0b\u548c\u7236\u8fdb\u7a0b\u51e0\u4e4e\u4e00\u6837&#xff0c;\u82e5\u60f3\u8ba9\u5b50\u8fdb\u7a0b\u6267\u884c\u5168\u65b0\u7684\u7a0b\u5e8f&#xff0c;\u9700\u8981\u4f7f\u7528exec\u7cfb\u5217\u51fd\u6570&#xff1a;<\/p>\n<p>#include &lt;unistd.h&gt;<\/p>\n<p>\/\/ \u5e38\u7528exec\u51fd\u6570<br \/>\nint execl(const char *path, const char *arg, &#8230;);<br \/>\nint execp(const char *file, const char *arg, &#8230;);<br \/>\nint execv(const char *path, char *const argv[]);<br \/>\nint execvp(const char *file, char *const argv[]);<\/p>\n<p>\u6838\u5fc3\u7279\u6027&#xff1a;<\/p>\n<ul>\n<li>exec\u4f1a\u66ff\u6362\u5f53\u524d\u8fdb\u7a0b\u7684\u4ee3\u7801\u6bb5\u3001\u6570\u636e\u6bb5\u3001\u5806\u6808\u6bb5&#xff0c;\u52a0\u8f7d\u65b0\u7a0b\u5e8f&#xff0c;\u4f46 PID \u4fdd\u6301\u4e0d\u53d8\u3002<\/li>\n<li>\u6267\u884c\u6210\u529f\u540e\u4e0d\u4f1a\u8fd4\u56de&#xff0c;\u53ea\u6709\u5931\u8d25\u624d\u4f1a\u8fd4\u56de &#8211; 1\u3002<\/li>\n<li>\u901a\u5e38\u4e0efork()\u914d\u5408\u4f7f\u7528&#xff1a;fork() &#043; exec()\u662f Linux \u521b\u5efa\u65b0\u8fdb\u7a0b\u7684\u6807\u51c6\u8303\u5f0f\u3002<\/li>\n<\/ul>\n<p>\u793a\u4f8b&#xff1a;\u8ba9\u5b50\u8fdb\u7a0b\u6267\u884cls -l\u547d\u4ee4<\/p>\n<p>pid_t pid &#061; fork();<br \/>\nif (pid &#061;&#061; 0) {<br \/>\n    execlp(&#034;ls&#034;, &#034;ls&#034;, &#034;-l&#034;, NULL);<br \/>\n    perror(&#034;execlp failed&#034;); \/\/ \u53ea\u6709exec\u5931\u8d25\u624d\u4f1a\u6267\u884c\u5230\u8fd9\u91cc<br \/>\n    _exit(1);<br \/>\n}<br \/>\nwait(NULL);<\/p>\n<h3>\u516d\u3001\u5c0f\u7ed3<\/h3>\n<p>\u8fd9\u6bb5\u65f6\u95f4\u5b66\u4e0b\u6765&#xff0c;\u611f\u89c9 Linux \u7cfb\u7edf\u7f16\u7a0b\u6838\u5fc3\u5c31\u662f\u7406\u89e3\u7cfb\u7edf\u600e\u4e48\u7ba1\u7406\u8d44\u6e90&#xff1a; \u5e93\u662f\u4ee3\u7801\u590d\u7528&#xff0c;\u8fdb\u7a0b\u662f\u8c03\u5ea6\u5355\u4f4d&#xff0c;\u865a\u62df\u5185\u5b58\u662f\u5b89\u5168\u9694\u79bb&#xff0c;\u6587\u4ef6 I\/O \u662f\u7edf\u4e00\u63a5\u53e3\u3002<\/p>\n<p>\u540e\u7eed\u4f1a\u7ee7\u7eed\u6574\u7406\u7ebf\u7a0b\u3001\u4fe1\u53f7\u3001\u7ba1\u9053\u3001\u5171\u4eab\u5185\u5b58\u8fd9\u4e9b IPC \u5185\u5bb9&#xff0c;\u6b22\u8fce\u4ea4\u6d41\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u4e3a\u4e00\u540d\u540e\u7aef\u5f00\u53d1\u5b66\u4e60\u8005&#xff0c;\u6700\u8fd1\u5728\u7cfb\u7edf\u68b3\u7406 Linux \u7cfb\u7edf\u7f16\u7a0b\u7684\u6838\u5fc3\u77e5\u8bc6\u70b9&#xff0c;\u4ece\u52a8\u6001\u5e93\u7684\u7f16\u8bd1\u5230\u8fdb\u7a0b\u7684\u521b\u5efa\u4e0e\u7ba1\u7406&#xff0c;\u6bcf\u4e00\u6b65\u90fd\u85cf\u7740\u64cd\u4f5c\u7cfb\u7edf\u7684\u5e95\u5c42\u8bbe\u8ba1\u601d\u60f3\u3002\u4eca\u5929\u5c31\u628a\u8fd9\u6bb5\u65f6\u95f4\u7684\u5b66\u4e60\u7b14\u8bb0\u6574\u7406\u6210\u4e00\u7bc7\u535a\u5ba2&#xff0c;\u65b9\u4fbf\u81ea\u5df1\u56de\u987e\u4e5f\u5e0c\u671b\u80fd\u5e2e\u5230\u540c\u6837\u5728\u5b66\u4e60\u7684\u670b\u53cb\u3002\u4e00\u3001\u52a8\u6001\u5e93\u4e0e\u9759\u6001\u5e93&#xff1a;\u7f16\u8bd1\u4e0e\u94fe\u63a5\u7684\u827a\u672f1. \u5e93\u7684\u57fa\u672c\u6982\u5ff5\u5e93\u662f\u9884\u5148\u7f16\u8bd1\u597d\u7684\u65b9\u6cd5&#xff08;\u51fd\u6570&#xff09;\u7684\u96c6\u5408&#xff0c;\u672c\u8d28\u4e0a\u662f.o\u76ee\u6807\u6587\u4ef6\u7684\u6253\u5305&#xff0c;\u65b9\u4fbf\u4ee3\u7801<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[174,58],"topic":[],"class_list":["post-91025","post","type-post","status-publish","format-standard","hentry","category-server","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>Linux \u7cfb\u7edf\u7f16\u7a0b\u6838\u5fc3\u77e5\u8bc6\u70b9\u603b\u7ed3\uff1a\u4ece\u5e93\u5230\u8fdb\u7a0b\u7684\u5e95\u5c42\u5b9e\u8df5 - \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\/91025.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux \u7cfb\u7edf\u7f16\u7a0b\u6838\u5fc3\u77e5\u8bc6\u70b9\u603b\u7ed3\uff1a\u4ece\u5e93\u5230\u8fdb\u7a0b\u7684\u5e95\u5c42\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4f5c\u4e3a\u4e00\u540d\u540e\u7aef\u5f00\u53d1\u5b66\u4e60\u8005&#xff0c;\u6700\u8fd1\u5728\u7cfb\u7edf\u68b3\u7406 Linux \u7cfb\u7edf\u7f16\u7a0b\u7684\u6838\u5fc3\u77e5\u8bc6\u70b9&#xff0c;\u4ece\u52a8\u6001\u5e93\u7684\u7f16\u8bd1\u5230\u8fdb\u7a0b\u7684\u521b\u5efa\u4e0e\u7ba1\u7406&#xff0c;\u6bcf\u4e00\u6b65\u90fd\u85cf\u7740\u64cd\u4f5c\u7cfb\u7edf\u7684\u5e95\u5c42\u8bbe\u8ba1\u601d\u60f3\u3002\u4eca\u5929\u5c31\u628a\u8fd9\u6bb5\u65f6\u95f4\u7684\u5b66\u4e60\u7b14\u8bb0\u6574\u7406\u6210\u4e00\u7bc7\u535a\u5ba2&#xff0c;\u65b9\u4fbf\u81ea\u5df1\u56de\u987e\u4e5f\u5e0c\u671b\u80fd\u5e2e\u5230\u540c\u6837\u5728\u5b66\u4e60\u7684\u670b\u53cb\u3002\u4e00\u3001\u52a8\u6001\u5e93\u4e0e\u9759\u6001\u5e93&#xff1a;\u7f16\u8bd1\u4e0e\u94fe\u63a5\u7684\u827a\u672f1. \u5e93\u7684\u57fa\u672c\u6982\u5ff5\u5e93\u662f\u9884\u5148\u7f16\u8bd1\u597d\u7684\u65b9\u6cd5&#xff08;\u51fd\u6570&#xff09;\u7684\u96c6\u5408&#xff0c;\u672c\u8d28\u4e0a\u662f.o\u76ee\u6807\u6587\u4ef6\u7684\u6253\u5305&#xff0c;\u65b9\u4fbf\u4ee3\u7801\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/91025.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-06T08:00:39+00:00\" \/>\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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/91025.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/91025.html\",\"name\":\"Linux \u7cfb\u7edf\u7f16\u7a0b\u6838\u5fc3\u77e5\u8bc6\u70b9\u603b\u7ed3\uff1a\u4ece\u5e93\u5230\u8fdb\u7a0b\u7684\u5e95\u5c42\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-06T08:00:39+00:00\",\"dateModified\":\"2026-08-06T08:00:39+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/91025.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/91025.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/91025.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux \u7cfb\u7edf\u7f16\u7a0b\u6838\u5fc3\u77e5\u8bc6\u70b9\u603b\u7ed3\uff1a\u4ece\u5e93\u5230\u8fdb\u7a0b\u7684\u5e95\u5c42\u5b9e\u8df5\"}]},{\"@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":"Linux \u7cfb\u7edf\u7f16\u7a0b\u6838\u5fc3\u77e5\u8bc6\u70b9\u603b\u7ed3\uff1a\u4ece\u5e93\u5230\u8fdb\u7a0b\u7684\u5e95\u5c42\u5b9e\u8df5 - \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\/91025.html","og_locale":"zh_CN","og_type":"article","og_title":"Linux \u7cfb\u7edf\u7f16\u7a0b\u6838\u5fc3\u77e5\u8bc6\u70b9\u603b\u7ed3\uff1a\u4ece\u5e93\u5230\u8fdb\u7a0b\u7684\u5e95\u5c42\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4f5c\u4e3a\u4e00\u540d\u540e\u7aef\u5f00\u53d1\u5b66\u4e60\u8005&#xff0c;\u6700\u8fd1\u5728\u7cfb\u7edf\u68b3\u7406 Linux \u7cfb\u7edf\u7f16\u7a0b\u7684\u6838\u5fc3\u77e5\u8bc6\u70b9&#xff0c;\u4ece\u52a8\u6001\u5e93\u7684\u7f16\u8bd1\u5230\u8fdb\u7a0b\u7684\u521b\u5efa\u4e0e\u7ba1\u7406&#xff0c;\u6bcf\u4e00\u6b65\u90fd\u85cf\u7740\u64cd\u4f5c\u7cfb\u7edf\u7684\u5e95\u5c42\u8bbe\u8ba1\u601d\u60f3\u3002\u4eca\u5929\u5c31\u628a\u8fd9\u6bb5\u65f6\u95f4\u7684\u5b66\u4e60\u7b14\u8bb0\u6574\u7406\u6210\u4e00\u7bc7\u535a\u5ba2&#xff0c;\u65b9\u4fbf\u81ea\u5df1\u56de\u987e\u4e5f\u5e0c\u671b\u80fd\u5e2e\u5230\u540c\u6837\u5728\u5b66\u4e60\u7684\u670b\u53cb\u3002\u4e00\u3001\u52a8\u6001\u5e93\u4e0e\u9759\u6001\u5e93&#xff1a;\u7f16\u8bd1\u4e0e\u94fe\u63a5\u7684\u827a\u672f1. \u5e93\u7684\u57fa\u672c\u6982\u5ff5\u5e93\u662f\u9884\u5148\u7f16\u8bd1\u597d\u7684\u65b9\u6cd5&#xff08;\u51fd\u6570&#xff09;\u7684\u96c6\u5408&#xff0c;\u672c\u8d28\u4e0a\u662f.o\u76ee\u6807\u6587\u4ef6\u7684\u6253\u5305&#xff0c;\u65b9\u4fbf\u4ee3\u7801","og_url":"https:\/\/www.wsisp.com\/helps\/91025.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-06T08:00:39+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/91025.html","url":"https:\/\/www.wsisp.com\/helps\/91025.html","name":"Linux \u7cfb\u7edf\u7f16\u7a0b\u6838\u5fc3\u77e5\u8bc6\u70b9\u603b\u7ed3\uff1a\u4ece\u5e93\u5230\u8fdb\u7a0b\u7684\u5e95\u5c42\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-06T08:00:39+00:00","dateModified":"2026-08-06T08:00:39+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/91025.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/91025.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/91025.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Linux \u7cfb\u7edf\u7f16\u7a0b\u6838\u5fc3\u77e5\u8bc6\u70b9\u603b\u7ed3\uff1a\u4ece\u5e93\u5230\u8fdb\u7a0b\u7684\u5e95\u5c42\u5b9e\u8df5"}]},{"@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\/91025","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=91025"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/91025\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=91025"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=91025"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=91025"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=91025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}