{"id":2131,"date":"2010-12-09T15:57:47","date_gmt":"2010-12-09T07:57:47","guid":{"rendered":"http:\/\/edsionte.com\/techblog\/?p=2131"},"modified":"2010-12-15T16:23:48","modified_gmt":"2010-12-15T08:23:48","slug":"fork%e7%b3%bb%e7%bb%9f%e8%b0%83%e7%94%a8%e5%88%86%e6%9e%902-do_fork","status":"publish","type":"post","link":"http:\/\/edsionte.com\/techblog\/archives\/2131","title":{"rendered":"fork\u7cfb\u7edf\u8c03\u7528\u5206\u6790(2)-do_fork()"},"content":{"rendered":"<h4>do_fork()\u5206\u6790<\/h4>\n<p>\u4ece\u4e0a\u6587\u53ef\u5f97\u77e5\uff0c fork\u3001vfork\u548cclone\u4e09\u4e2a\u7cfb\u7edf\u8c03\u7528\u6240\u5bf9\u5e94\u7684\u7cfb\u7edf\u8c03\u7528\u670d\u52a1\u4f8b\u7a0b\u5747\u8c03\u7528\u4e86do_fork()\u3002\u53ea\u4e0d\u8fc7\u5728\u8c03\u7528\u65f6\u6240\u4f20\u9012\u7684\u53c2\u6570\u6709\u6240\u4e0d\u540c\uff0c\u800c\u53c2\u6570\u7684\u4e0d\u540c\u6b63\u597d\u5bfc\u81f4\u4e86\u5b50\u8fdb\u7a0b\u4e0e\u7236\u8fdb\u7a0b\u4e4b\u95f4\u5bf9\u8d44\u6e90\u7684\u5171\u4eab\u7a0b\u5ea6\u4e0d\u540c\u3002\u56e0\u6b64\uff0c\u5206\u6790do_fork()\u6210\u4e3a\u6211\u4eec\u7684\u9996\u8981\u4efb\u52a1\u3002<\/p>\n<p>\u5728\u8fdb\u5165do_fork\u51fd\u6570\u8fdb\u884c\u5206\u6790\u4e4b\u524d\uff0c\u5f88\u6709\u5fc5\u8981\u4e86\u89e3\u4e00\u4e0b\u5b83\u7684\u53c2\u6570\u3002<\/p>\n<p><strong>clone_flags<\/strong>\uff1a\u8be5\u6807\u5fd7\u4f4d\u76844\u4e2a\u5b57\u8282\u5206\u4e3a\u4e24\u90e8\u5206\u3002\u6700\u4f4e\u7684\u4e00\u4e2a\u5b57\u8282\u4e3a\u5b50\u8fdb\u7a0b\u7ed3\u675f\u65f6\u53d1\u9001\u7ed9\u7236\u8fdb\u7a0b\u7684\u4fe1\u53f7\u4ee3\u7801\uff0c\u901a\u5e38\u4e3aSIGCHLD\uff1b\u5269\u4f59\u7684\u4e09\u4e2a\u5b57\u8282\u5219\u662f\u5404\u79cdclone\u6807\u5fd7\u7684\u7ec4\u5408\uff08\u672c\u6587\u6240\u6d89\u53ca\u7684\u6807\u5fd7\u542b\u4e49\u8be6\u89c1\u4e0b\u8868\uff09\uff0c\u4e5f\u5c31\u662f\u82e5\u5e72\u4e2a\u6807\u5fd7\u4e4b\u95f4\u7684\u6216\u8fd0\u7b97\u3002\u901a\u8fc7clone\u6807\u5fd7\u53ef\u4ee5\u6709\u9009\u62e9\u7684\u5bf9\u7236\u8fdb\u7a0b\u7684\u8d44\u6e90\u8fdb\u884c\u590d\u5236\uff1b\u672c\u6587\u6240\u6d89\u53ca\u5230\u7684clone\u6807\u5fd7\u8be6\u89c1\u4e0b\u8868\u3002<\/p>\n<p><a rel=\"attachment wp-att-2189\" href=\"http:\/\/edsionte.com\/techblog\/archives\/2131\/3-2\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2189\" title=\"3\" src=\"http:\/\/edsionte.com\/techblog\/wordpress\/wp-content\/uploads\/2010\/12\/3.jpg\" alt=\"\" width=\"566\" height=\"404\" srcset=\"http:\/\/edsionte.com\/techblog\/wordpress\/wp-content\/uploads\/2010\/12\/3.jpg 566w, http:\/\/edsionte.com\/techblog\/wordpress\/wp-content\/uploads\/2010\/12\/3-300x214.jpg 300w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><\/a><\/p>\n<p><strong>statck_start<\/strong>\uff1a\u5b50\u8fdb\u7a0b\u7528\u6237\u6001\u5806\u6808\u7684\u5730\u5740\uff1b<\/p>\n<p><strong>regs<\/strong>\uff1a\u6307\u5411pt_regs\u7ed3\u6784\u4f53\u7684\u6307\u9488\u3002\u5f53\u7cfb\u7edf\u53d1\u751f\u7cfb\u7edf\u8c03\u7528\uff0c\u5373\u7528\u6237\u8fdb\u7a0b\u4ece\u7528\u6237\u6001\u5207\u6362\u5230\u5185\u6838\u6001\u65f6\uff0c\u8be5\u7ed3\u6784\u4f53\u4fdd\u5b58\u901a\u7528\u5bc4\u5b58\u5668\u4e2d\u7684\u503c\uff0c\u5e76\u88ab\u5b58\u653e\u4e8e\u5185\u6838\u6001\u7684\u5806\u6808\u4e2d\uff1b<\/p>\n<p><strong>stack_size<\/strong>\uff1a\u672a\u88ab\u4f7f\u7528\uff0c\u901a\u5e38\u88ab\u8d4b\u503c\u4e3a0\uff1b<\/p>\n<p><strong>parent_tidptr<\/strong>\uff1a\u7236\u8fdb\u7a0b\u5728\u7528\u6237\u6001\u4e0bpid\u7684\u5730\u5740\uff0c\u8be5\u53c2\u6570\u5728CLONE_PARENT_SETTID\u6807\u5fd7\u88ab\u8bbe\u5b9a\u65f6\u6709\u610f\u4e49\uff1b<\/p>\n<p><strong>child_tidptr<\/strong>\uff1a\u5b50\u8fdb\u7a0b\u5728\u7528\u6237\u592a\u4e0bpid\u7684\u5730\u5740\uff0c\u8be5\u53c2\u6570\u5728CLONE_CHILD_SETTID\u6807\u5fd7\u88ab\u8bbe\u5b9a\u65f6\u6709\u610f\u4e49\uff1b<\/p>\n<p>do_fork\u51fd\u6570\u7684\u4e3b\u8981\u4f5c\u7528\u5c31\u662f\u590d\u5236\u539f\u6765\u7684\u8fdb\u7a0b\u6210\u4e3a\u53e6\u4e00\u4e2a\u65b0\u7684\u8fdb\u7a0b\uff0c\u5b83\u5b8c\u6210\u4e86\u6574\u4e2a\u8fdb\u7a0b\u521b\u5efa\u4e2d\u7684\u5927\u90e8\u5206\u5de5\u4f5c\u3002<\/p>\n<p>1\uff0e \u5728\u4e00\u5f00\u59cb\uff0c\u8be5\u51fd\u6570\u5b9a\u4e49\u4e86\u4e00\u4e2atask_struct\u7c7b\u578b\u7684\u6307\u9488p\uff0c\u7528\u6765\u63a5\u6536\u5373\u5c06\u4e3a\u65b0\u8fdb\u7a0b\uff08\u5b50\u8fdb\u7a0b\uff09\u6240\u5206\u914d\u7684\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u3002\u7d27\u63a5\u7740\u4f7f\u7528alloc_pidmap\u51fd\u6570\u4e3a\u8fd9\u4e2a\u65b0\u8fdb\u7a0b\u5206\u914d\u4e00\u4e2apid\u3002\u7531\u4e8e\u7cfb\u7edf\u5185\u7684pid\u662f\u5faa\u73af\u4f7f\u7528\u7684\uff0c\u6240\u4ee5\u91c7\u7528\u4f4d\u56fe\u65b9\u5f0f\u6765\u7ba1\u7406\u3002\u7b80\u5355\u7684\u8bf4\uff0c\u5c31\u662f\u7528\u6bcf\u4e00\u4f4d\uff08bit\uff09\u6765\u6807\u793a\u8be5\u4f4d\u6240\u5bf9\u5e94\u7684pid\u662f\u5426\u88ab\u4f7f\u7528\u3002\u5206\u914d\u5b8c\u6bd5\u540e\uff0c\u5224\u65adpid\u662f\u5426\u5206\u914d\u6210\u529f\u3002<\/p>\n<pre class=\"brush:c\">long do_fork(unsigned long clone_flags,\r\n\t      unsigned long stack_start,\r\n\t      struct pt_regs *regs,\r\n\t      unsigned long stack_size,\r\n\t      int __user *parent_tidptr,\r\n\t      int __user *child_tidptr)\r\n{\r\n\tstruct task_struct *p;\r\n\tint trace = 0;\r\n\tlong pid = alloc_pidmap();\r\n\r\n\tif (pid &lt; 0)\r\n\t\treturn -EAGAIN;<\/pre>\n<p>2\uff0e \u63a5\u4e0b\u6765\u68c0\u67e5\u5f53\u524d\u8fdb\u7a0b\uff08\u7236\u8fdb\u7a0b\uff09\u7684ptrace\u5b57\u6bb5\u3002ptrace\u662f\u7528\u6765\u6807\u793a\u4e00\u4e2a\u8fdb\u7a0b\u662f\u5426\u88ab\u53e6\u5916\u4e00\u4e2a\u8fdb\u7a0b\u6240\u8ddf\u8e2a\u3002\u6240\u8c13\u8ddf\u8e2a\uff0c\u6700\u5e38\u89c1\u7684\u4f8b\u5b50\u5c31\u662f\u5904\u4e8e\u8c03\u8bd5\u72b6\u6001\u4e0b\u7684\u8fdb\u7a0b\u88abdebugger\u8fdb\u7a0b\u6240\u8ddf\u8e2a\u3002\u7236\u8fdb\u7a0b\u7684ptrace\u5b57\u6bb5\u975e0\u65f6\u8bf4\u660edebugger\u7a0b\u5e8f\u6b63\u5728\u8ddf\u8e2a\u7236\u8fdb\u7a0b\uff0c\u90a3\u4e48\u63a5\u4e0b\u6765\u901a\u8fc7fork_traceflag\u51fd\u6570\u6765\u68c0\u6d4b\u5b50\u8fdb\u7a0b\u662f\u5426\u4e5f\u8981\u88ab\u8ddf\u8e2a\u3002\u5982\u679ctrace\u4e3a1\uff0c\u90a3\u4e48\u5c31\u5c06\u8ddf\u8e2a\u6807\u5fd7CLONE_PTRACE\u52a0\u5165\u6807\u5fd7\u53d8\u91cfclone_flags\u4e2d\u3002<\/p>\n<p>\u901a\u5e38\u4e0a\u8ff0\u7684\u8ddf\u8e2a\u60c5\u51b5\u662f\u5f88\u5c11\u53d1\u751f\u7684\uff0c\u56e0\u6b64\u5728\u5224\u65ad\u7236\u8fdb\u7a0b\u7684ptrace\u5b57\u6bb5\u65f6\u4f7f\u7528\u4e86unlikely\u4fee\u9970\u7b26\u3002\u4f7f\u7528\u8be5\u4fee\u9970\u7b26\u7684\u5224\u65ad\u8bed\u53e5\u6267\u884c\u7ed3\u679c\u4e0e\u666e\u901a\u5224\u65ad\u8bed\u53e5\u76f8\u540c\uff0c\u53ea\u4e0d\u8fc7\u5728\u6267\u884c\u6548\u7387\u4e0a\u6709\u6240\u4e0d\u540c\u3002\u6b63\u5982\u8be5\u5355\u8bcd\u7684\u542b\u4e49\u6240\u8868\u793a\u7684\u90a3\u6837\uff0ccurrent-&gt;ptrace\u5f88\u5c11\u4e3a\u975e0\u3002\u56e0\u6b64\uff0c\u7f16\u8bd1\u5668\u5c3d\u91cf\u4e0d\u4f1a\u628aif\u5185\u7684\u8bed\u53e5\u4e0e\u5f53\u524d\u8bed\u53e5\u4e4b\u524d\u7684\u4ee3\u7801\u7f16\u8bd1\u5728\u4e00\u8d77\uff0c\u4ee5\u589e\u52a0cache\u7684\u547d\u4e2d\u7387\u3002\u4e0e\u6b64\u76f8\u53cd\uff0clikely\u4fee\u9970\u7b26\u5219\u8868\u793a\u6240\u4fee\u9970\u7684\u4ee3\u7801\u5f88\u53ef\u80fd\u53d1\u751f\u3002<\/p>\n<pre class=\"brush:c\">\tif (unlikely(current-&gt;ptrace)) {\r\n\t\ttrace = fork_traceflag (clone_flags);\r\n\t\tif (trace)\r\n\t\t\tclone_flags |= CLONE_PTRACE;\r\n\t}<\/pre>\n<p>3\uff0e \u63a5\u4e0b\u6765\u7684\u8fd9\u6761\u8bed\u53e5\u8981\u505a\u7684\u662f\u6574\u4e2a\u521b\u5efa\u8fc7\u7a0b\u4e2d\u6700\u6838\u5fc3\u7684\u5de5\u4f5c\uff1a\u901a\u8fc7copy_process()\u521b\u5efa\u5b50\u8fdb\u7a0b\u7684\u63cf\u8ff0\u7b26\uff0c\u5e76\u521b\u5efa\u5b50\u8fdb\u7a0b\u6267\u884c\u65f6\u6240\u9700\u7684\u5176\u4ed6\u6570\u636e\u7ed3\u6784\uff0c\u6700\u7ec8\u5219\u4f1a\u8fd4\u56de\u8fd9\u4e2a\u521b\u5efa\u597d\u7684\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u3002\u8be5\u51fd\u6570\u4e2d\u7684\u53c2\u6570\u610f\u4e49\u4e0edo_fork\u51fd\u6570\u76f8\u540c\uff0c\u6b64\u51fd\u6570\u7684\u8be6\u7ec6\u6267\u884c\u8fc7\u7a0b\u5728\u672c\u6587\u7684\u4e0b\u4e00\u8282\u6709\u8be6\u7ec6\u8bf4\u660e\u3002<\/p>\n<pre class=\"brush:c\">\tp = copy_process(clone_flags, stack_start, regs, stack_size, parent_tidptr, child_tidptr, pid);<\/pre>\n<p>4\uff0e \u5982\u679ccopy_process\u51fd\u6570\u6267\u884c\u6210\u529f\uff0c\u90a3\u4e48\u5c06\u7ee7\u7eed\u4e0b\u9762\u7684\u4ee3\u7801\u3002<br \/>\n\u9996\u5148\u5b9a\u4e49\u4e86\u4e00\u4e2a\u5b8c\u6210\u91cfvfork\uff0c\u5982\u679cclone_flags\u5305\u542bCLONE_VFORK\u6807\u5fd7\uff0c\u90a3\u4e48\u5c06\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u4e2d\u7684vfork_done\u5b57\u6bb5\u6307\u5411\u8fd9\u4e2a\u5b8c\u6210\u91cf\uff0c\u4e4b\u540e\u518d\u5bf9vfork\u5b8c\u6210\u91cf\u8fdb\u884c\u521d\u59cb\u5316\u3002<\/p>\n<p>\u5b8c\u6210\u91cf\u7684\u4f5c\u7528\u662f\uff0c\u76f4\u5230\u4efb\u52a1A\u53d1\u51fa\u4fe1\u53f7\u901a\u77e5\u4efb\u52a1B\u53d1\u751f\u4e86\u67d0\u4e2a\u7279\u5b9a\u4e8b\u4ef6\u65f6\uff0c\u4efb\u52a1B\u624d\u4f1a\u5f00\u59cb\u6267\u884c\uff1b\u5426\u5219\u4efb\u52a1B\u4e00\u76f4\u7b49\u5f85\u3002\u6211\u4eec\u77e5\u9053\uff0c\u5982\u679c\u4f7f\u7528vfork\u7cfb\u7edf\u8c03\u7528\u6765\u521b\u5efa\u5b50\u8fdb\u7a0b\uff0c\u90a3\u4e48\u5fc5\u7136\u662f\u5b50\u8fdb\u7a0b\u5148\u6267\u884c\u3002\u7a76\u5176\u539f\u56e0\u5c31\u662f\u6b64\u5904vfork\u5b8c\u6210\u91cf\u6240\u8d77\u5230\u7684\u4f5c\u7528\uff1a\u5f53\u5b50\u8fdb\u7a0b\u8c03\u7528exec\u51fd\u6570\u6216\u9000\u51fa\u65f6\u5c31\u5411\u7236\u8fdb\u7a0b\u53d1\u51fa\u4fe1\u53f7\u3002\u6b64\u65f6\uff0c\u7236\u8fdb\u7a0b\u624d\u4f1a\u88ab\u5524\u9192\uff1b\u5426\u5219\u4e00\u76f4\u7b49\u5f85\u3002\u6b64\u5904\u7684\u4ee3\u7801\u53ea\u662f\u5bf9\u5b8c\u6210\u91cf\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u5177\u4f53\u7684\u963b\u585e\u8bed\u53e5\u5219\u5728\u540e\u9762\u7684\u4ee3\u7801\u4e2d\u6709\u6240\u4f53\u73b0\u3002<\/p>\n<pre class=\"brush:c\">\tif (!IS_ERR(p)) {\r\n\t\tstruct completion vfork;\r\n\r\n\t\tif (clone_flags &amp; CLONE_VFORK) {\r\n\t\t\tp-&gt;vfork_done = &amp;vfork;\r\n\t\t\tinit_completion(&amp;vfork);\r\n\t\t}<\/pre>\n<p>5\uff0e \u5982\u679c\u5b50\u8fdb\u7a0b\u88ab\u8ddf\u8e2a\u6216\u8005\u8bbe\u7f6e\u4e86CLONE_STOPPED\u6807\u5fd7\uff0c\u90a3\u4e48\u901a\u8fc7sigaddset\u51fd\u6570\u4e3a\u5b50\u8fdb\u7a0b\u589e\u52a0\u6302\u8d77\u4fe1\u53f7\u3002signal\u5bf9\u5e94\u4e00\u4e2aunsigned long\u7c7b\u578b\u7684\u53d8\u91cf\uff0c\u8be5\u53d8\u91cf\u7684\u6bcf\u4e2a\u4f4d\u5206\u522b\u5bf9\u5e94\u4e00\u79cd\u4fe1\u53f7\u3002\u5177\u4f53\u7684\u64cd\u4f5c\u662f\uff0c\u5c06SIGSTOP\u4fe1\u53f7\u6240\u5bf9\u5e94\u7684\u90a3\u4e00\u4f4d\u7f6e1\u3002<\/p>\n<pre class=\"brush:c\">\t\tif ((p-&gt;ptrace &amp; PT_PTRACED) || (clone_flags &amp; CLONE_STOPPED)) {\r\n\t\t\tsigaddset(&amp;p-&gt;pending.signal, SIGSTOP);\r\n\t\t\tset_tsk_thread_flag(p, TIF_SIGPENDING);\r\n\t\t}<\/pre>\n<p>6\uff0e \u5982\u679c\u5b50\u8fdb\u7a0b\u5e76\u672a\u8bbe\u7f6eCLONE_STOPPED\u6807\u5fd7\uff0c\u90a3\u4e48\u901a\u8fc7wake_up_new_task\u51fd\u6570\u4f7f\u5f97\u7236\u5b50\u8fdb\u7a0b\u4e4b\u4e00\u4f18\u5148\u8fd0\u884c\uff1b\u5426\u5219\uff0c\u5c06\u5b50\u8fdb\u7a0b\u7684\u72b6\u6001\u8bbe\u7f6e\u4e3aTASK_STOPPED\u3002<\/p>\n<pre class=\"brush:c\">\t\tif (!(clone_flags &amp; CLONE_STOPPED))\r\n\t\t\twake_up_new_task(p, clone_flags);\r\n\t\telse\r\n\t\t\tp-&gt;state = TASK_STOPPED;<\/pre>\n<p>7\uff0e \u5982\u679c\u7236\u8fdb\u7a0b\u88ab\u8ddf\u8e2a\uff0c\u5219\u5c06\u5b50\u8fdb\u7a0b\u7684pid\u8d4b\u503c\u7ed9\u7236\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u7684pstrace_message\u5b57\u6bb5\u3002\u518d\u901a\u8fc7ptrace_notify\u51fd\u6570\u4f7f\u5f97\u5f53\u524d\u8fdb\u7a0b\u5b9a\u5236\uff0c\u5e76\u5411\u7236\u8fdb\u7a0b\u7684\u7236\u8fdb\u7a0b\u53d1\u9001SIGCHLD\u4fe1\u53f7\u3002<\/p>\n<pre class=\"brush:c\">\t\tif (unlikely (trace)) {\r\n\t\t\tcurrent-&gt;ptrace_message = pid;\r\n\t\t\tptrace_notify ((trace &lt;&lt; 8) | SIGTRAP);\r\n\t\t}<\/pre>\n<p>8\uff0e \u5982\u679cCLONE_VFORK\u6807\u5fd7\u88ab\u8bbe\u7f6e\uff0c\u5219\u901a\u8fc7wait\u64cd\u4f5c\u5c06\u7236\u8fdb\u7a0b\u963b\u585e\uff0c\u76f4\u81f3\u5b50\u8fdb\u7a0b\u8c03\u7528exec\u51fd\u6570\u6216\u8005\u9000\u51fa\u3002<\/p>\n<pre class=\"brush:c\">if (clone_flags &amp; CLONE_VFORK) {\r\n\t\t\twait_for_completion(&amp;vfork);\r\n\t\t\tif (unlikely (current-&gt;ptrace &amp; PT_TRACE_VFORK_DONE))\r\n\t\t\t\tptrace_notify ((PTRACE_EVENT_VFORK_DONE &lt;&lt; 8) | SIGTRAP);\r\n\t\t}<\/pre>\n<p>9\uff0e \u5982\u679ccopy_process()\u5728\u6267\u884c\u7684\u65f6\u5019\u53d1\u751f\u9519\u8bef\uff0c\u5219\u5148\u91ca\u653e\u5df2\u5206\u914d\u7684pid\uff1b\u518d\u6839\u636ePTR_ERR()\u7684\u8fd4\u56de\u503c\u5f97\u5230\u9519\u8bef\u4ee3\u7801\uff0c\u4fdd\u5b58\u4e8epid\u4e2d\u3002<\/p>\n<pre class=\"brush:c\">} else {\r\n\t\tfree_pidmap(pid);\r\n\t\tpid = PTR_ERR(p);\r\n\t}<\/pre>\n<p>10\uff0e \u8fd4\u56depid\u3002\u8fd9\u4e5f\u5c31\u662f\u4e3a\u4ec0\u4e48\u4f7f\u7528fork\u7cfb\u7edf\u8c03\u7528\u65f6\u7236\u8fdb\u7a0b\u4f1a\u8fd4\u56de\u5b50\u8fdb\u7a0bpid\u7684\u539f\u56e0\u3002\u81f3\u4e8e\u4e3a\u4ec0\u4e48\u5b50\u8fdb\u7a0b\u4f1a\u8fd4\u56de0\u5219\u5728copy_process()\u4e2d\u6709\u6240\u4f53\u73b0\u3002<\/p>\n<p>\u4ee5\u4e0a\u4fbf\u662fdo_fork\u51fd\u6570\u7684\u5927\u81f4\u6267\u884c\u8fc7\u7a0b\u3002\u81f3\u4e8e\u5b50\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u5982\u4f55\u521b\u5efa\uff0c\u5c31\u5f97\u5206\u6790copy_process\u51fd\u6570\u4e86\u3002\u8fd9\u662f\u4e0b\u7bc7\u6587\u7ae0\u8981\u5b8c\u6210\u7684\u5de5\u4f5c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>do_fork()\u5206\u6790 \u4ece\u4e0a\u6587\u53ef\u5f97\u77e5\uff0c fork\u3001vfork\u548cclone\u4e09\u4e2a\u7cfb\u7edf\u8c03\u7528\u6240\u5bf9\u5e94\u7684\u7cfb\u7edf\u8c03\u7528\u670d\u52a1\u4f8b\u7a0b\u5747 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[110],"tags":[180,181,161],"class_list":["post-2131","post","type-post","status-publish","format-standard","hentry","category-linux","tag-fork","tag-181","tag-161"],"views":23635,"_links":{"self":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/2131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/comments?post=2131"}],"version-history":[{"count":0,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/2131\/revisions"}],"wp:attachment":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/media?parent=2131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/categories?post=2131"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/tags?post=2131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}