{"id":2141,"date":"2010-12-12T12:09:22","date_gmt":"2010-12-12T04:09:22","guid":{"rendered":"http:\/\/edsionte.com\/techblog\/?p=2141"},"modified":"2010-12-15T16:23:38","modified_gmt":"2010-12-15T08:23:38","slug":"fork%e7%b3%bb%e7%bb%9f%e8%b0%83%e7%94%a8%e5%88%86%e6%9e%903-copy_process","status":"publish","type":"post","link":"http:\/\/edsionte.com\/techblog\/archives\/2141","title":{"rendered":"fork\u7cfb\u7edf\u8c03\u7528\u5206\u6790(3)\u2013copy_process()"},"content":{"rendered":"<h4>copy_process()\u5206\u6790<\/h4>\n<p>\u901a\u8fc7\u4e0a\u9762\u7684\u5206\u6790\u6211\u4eec\u5f97\u77e5do_fork()\u4e3b\u8981\u5b8c\u6210\u4ee5\u4e0b\u7684\u5de5\u4f5c\uff1a\u4e3a\u5b50\u8fdb\u7a0b\u5b9a\u4e49\u4e86\u4e00\u4e2a\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u5e76\u7533\u8bf7pid\uff1b\u8c03\u7528copy_process()\u590d\u5236\u5b50\u8fdb\u7a0b\uff1b\u518d\u901a\u8fc7clone_flags\u6807\u5fd7\u505a\u4e00\u4e9b\u590d\u5236\u540e\u7684\u8f85\u52a9\u5de5\u4f5c\u3002copy_process()\u51fd\u6570\u4e3b\u8981\u7528\u6765\u521b\u5efa\u5b50\u8fdb\u7a0b\u7684\u63cf\u8ff0\u7b26\u4ee5\u53ca\u4e0e\u5b50\u8fdb\u7a0b\u76f8\u5173\u6570\u636e\u7ed3\u6784\u3002\u8fd9\u4e2a\u51fd\u6570\u5185\u90e8\u5b9e\u73b0\u8f83\u4e3a\u590d\u6742\uff0c\u5728\u77ed\u65f6\u95f4\u5185\uff0c\u5bf9\u4e8e\u5185\u90e8\u8be6\u7ec6\u4ee3\u7801\u539f\u7406\u548c\u5b9e\u73b0\u5e76\u4e0d\u80fd\u5168\u90e8\u7406\u89e3\u3002\u56e0\u6b64\uff0c\u63a5\u4e0b\u6765\u7684\u5206\u6790\u4fa7\u91cd\u4e8ecopy_process()\u7684\u6267\u884c\u6d41\u7a0b\u3002<\/p>\n<p>1\uff0e \u5b9a\u4e49\u8fd4\u56de\u503c\u53d8\u91cf\u548c\u65b0\u7684\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u3002<\/p>\n<pre class=\"brush:c\">\r\n        int retval;\r\n        struct task_struct *p = NULL;<\/pre>\n<p>2\uff0e \u5bf9clone_flags\u6240\u4f20\u9012\u7684\u6807\u5fd7\u7ec4\u5408\u8fdb\u884c\u5408\u6cd5\u6027\u68c0\u67e5\u3002\u5f53\u51fa\u73b0\u4ee5\u4e0b\u4e09\u79cd\u60c5\u51b5\u65f6\uff0c\u8fd4\u56de\u51fa\u9519\u4ee3\u53f7\uff1a<\/p>\n<p>(1). CLONE_NEWNS\u548cCLONE_FS\u540c\u65f6\u88ab\u8bbe\u7f6e\u3002<\/p>\n<p>\u524d\u8005\u6807\u5fd7\u8868\u793a\u5b50\u8fdb\u7a0b\u9700\u8981\u81ea\u5df1\u7684\u547d\u540d\u7a7a\u95f4\uff0c\u800c\u540e\u8005\u6807\u5fd7\u5219\u4ee3\u8868\u5b50\u8fdb\u7a0b\u5171\u4eab\u7236\u8fdb\u7a0b\u7684\u6839\u76ee\u5f55\u548c\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\uff0c\u4e24\u8005\u4e0d\u53ef\u517c\u5bb9\u3002<br \/>\n\u4f20\u7edf\u7684Unix\u7cfb\u7edf\u4e2d\uff0c\u6574\u4e2a\u7cfb\u7edf\u53ea\u6709\u4e00\u4e2a\u5df2\u7ecf\u5b89\u88c5\u7684\u6587\u4ef6\u7cfb\u7edf\u6811\u3002\u6bcf\u4e2a\u8fdb\u7a0b\u4ece\u7cfb\u7edf\u7684\u6839\u6587\u4ef6\u7cfb\u7edf\u5f00\u59cb\uff0c\u901a\u8fc7\u5408\u6cd5\u7684\u8def\u5f84\u53ef\u4ee5\u8bbf\u95ee\u4efb\u4f55\u6587\u4ef6\u3002\u57282.6\u7248\u672c\u4e2d\u7684\u5185\u6838\u4e2d\uff0c\u6bcf\u4e2a\u8fdb\u7a0b\u90fd\u53ef\u4ee5\u62e5\u6709\u5c5e\u4e8e\u81ea\u5df1\u7684\u5df2\u5b89\u88c5\u6587\u4ef6\u7cfb\u7edf\u6811\uff0c\u4e5f\u88ab\u79f0\u4e3a\u547d\u540d\u7a7a\u95f4\u3002\u901a\u5e38\u5927\u591a\u6570\u8fdb\u7a0b\u90fd\u5171\u4eabinit\u8fdb\u7a0b\u6240\u4f7f\u7528\u7684\u5df2\u5b89\u88c5\u6587\u4ef6\u7cfb\u7edf\u6811\uff0c\u53ea\u6709\u5728clone_flags\u4e2d\u8bbe\u7f6e\u4e86CLONE_NEWNS\u6807\u5fd7\u65f6\uff0c\u624d\u4f1a\u4e3a\u6b64\u65b0\u8fdb\u7a0b\u5f00\u8f9f\u4e00\u4e2a\u65b0\u7684\u547d\u540d\u7a7a\u95f4\u3002<\/p>\n<p>(2). CLONE_THREAD\u88ab\u8bbe\u7f6e\uff0c\u4f46CLONE_SIGHAND\u672a\u88ab\u8bbe\u7f6e\u3002<\/p>\n<p>\u5982\u679c\u5b50\u8fdb\u7a0b\u548c\u7236\u8fdb\u7a0b\u5c5e\u4e8e\u540c\u4e00\u4e2a\u7ebf\u7a0b\u7ec4\uff08CLONE_THREAD\u88ab\u8bbe\u7f6e\uff09\uff0c\u90a3\u4e48\u5b50\u8fdb\u7a0b\u5fc5\u987b\u5171\u4eab\u7236\u8fdb\u7a0b\u7684\u4fe1\u53f7\uff08CLONE_SIGHAND\u88ab\u8bbe\u7f6e\uff09\u3002<\/p>\n<p>(3). CLONE_SIGHAND\u88ab\u8bbe\u7f6e\uff0c\u4f46CLONE_VM\u672a\u88ab\u8bbe\u7f6e\u3002<\/p>\n<p>\u5982\u679c\u5b50\u8fdb\u7a0b\u5171\u4eab\u7236\u8fdb\u7a0b\u7684\u4fe1\u53f7\uff0c\u90a3\u4e48\u5fc5\u987b\u540c\u65f6\u5171\u4eab\u7236\u8fdb\u7a0b\u7684\u5185\u5b58\u63cf\u8ff0\u7b26\u548c\u6240\u6709\u7684\u9875\u8868\uff08CLONE_VM\u88ab\u8bbe\u7f6e\uff09\u3002<\/p>\n<p>3\uff0e \u901a\u8fc7\u8c03\u7528security_task_create()\u548c\u540e\u9762\u7684security_task_alloc()\u6267\u884c\u6240\u6709\u9644\u52a0\u7684\u5b89\u5168\u6027\u68c0\u67e5\u3002<\/p>\n<p>4\uff0e \u901a\u8fc7dup_task_struct()\u4e3a\u5b50\u8fdb\u7a0b\u5206\u914d\u4e00\u4e2a\u5185\u6838\u6808\u3001thread_info\u7ed3\u6784\u548ctask_struct\u7ed3\u6784\u3002<\/p>\n<pre class=\"brush:c\">\r\np = dup_task_struct(current);\r\n<\/pre>\n<p>\u6ce8\u610f\uff0c\u8fd9\u91cc\u5c06\u5f53\u524d\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u6307\u9488\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u5230\u6b64\u51fd\u6570\u4e2d\u3002\u8be5\u51fd\u6570\u5185\u90e8\u7684\u5177\u4f53\u8fc7\u7a0b\u5982\u4e0b\uff1a<\/p>\n<p>\u9996\u5148\uff0c\u8be5\u51fd\u6570\u5206\u522b\u5b9a\u4e49\u4e86\u6307\u5411task_struct\u548cthread_inof\u7ed3\u6784\u4f53\u7684\u6307\u9488\u3002<\/p>\n<pre class=\"brush:c\">static struct task_struct *dup_task_struct(struct task_struct *orig)\r\n{\r\n\tstruct task_struct *tsk;\r\n\tstruct thread_info *ti;<\/pre>\n<p>\u63a5\u7740\uff0c\u4e3a\u6b63\u5f0f\u7684\u5206\u914d\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u505a\u4e00\u4e9b\u51c6\u5907\u5de5\u4f5c\u3002\u4e3b\u8981\u662f\u5c06\u4e00\u4e9b\u5fc5\u8981\u7684\u5bc4\u5b58\u5668\u7684\u503c\u4fdd\u5b58\u5230\u7236\u8fdb\u7a0b\u7684thread_info\u7ed3\u6784\u4e2d\u3002\u8fd9\u4e9b\u503c\u4f1a\u5728\u7a0d\u540e\u88ab\u590d\u5236\u5230\u5b50\u8fdb\u7a0b\u7684thread_info\u7ed3\u6784\u4e2d\u3002<\/p>\n<pre class=\"brush:c\">\tprepare_to_copy(orig);<\/pre>\n<p>\u6267\u884calloc_task_struct\u5b8f\uff0c\u8be5\u5b8f\u8d1f\u8d23\u4e3a\u5b50\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u5206\u914d\u7a7a\u95f4\uff0c\u5c06\u8be5\u7247\u5185\u5b58\u7684\u9996\u5730\u5740\u8d4b\u503c\u7ed9tsk\uff1b\u968f\u540e\u68c0\u67e5\u8fd9\u7247\u5185\u5b58\u662f\u5426\u5206\u914d\u6b63\u786e\u3002<\/p>\n<pre class=\"brush:c\">\ttsk = alloc_task_struct();\r\n\tif (!tsk)\r\n\t\treturn NULL;<\/pre>\n<p>\u6267\u884calloc_thread_info\u5b8f\uff0c\u4e3a\u5b50\u8fdb\u7a0b\u83b7\u53d6\u4e00\u5757\u7a7a\u95f2\u7684\u5185\u5b58\u533a\uff0c\u7528\u6765\u5b58\u653e\u5b50\u8fdb\u7a0b\u7684\u5185\u6838\u6808\u548cthread_info\u7ed3\u6784\uff0c\u5e76\u5c06\u6b64\u4f1a\u5185\u5b58\u533a\u7684\u9996\u5730\u5740\u8d4b\u503c\u7ed9ti\u53d8\u91cf\uff1b\u968f\u540e\u68c0\u67e5\u662f\u5426\u5206\u914d\u6b63\u786e\u3002<\/p>\n<pre class=\"brush:c\">\tti = alloc_thread_info(tsk);\r\n\tif (!ti) {\r\n\t\tfree_task_struct(tsk);\r\n\t\treturn NULL;\r\n\t}<\/pre>\n<p>\u4e0a\u9762\u5df2\u7ecf\u8bf4\u660e\u8fc7orig\u662f\u6307\u5411\u5f53\u524d\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u7684\u6307\u9488\u3002\u56e0\u6b64\uff0c\u5148\u5c06\u5f53\u524d\u8fdb\u7a0b\u7684thread_info\u7ed3\u6784\u4e2d\u7684\u5185\u5bb9\u590d\u5236\u5230ti\u53d8\u91cf\uff1b\u518d\u5c06\u5f53\u524d\u8fdb\u7a0btask_struct\u7ed3\u6784\u4e2d\u7684\u5185\u5bb9\u590d\u5236\u5230tsk\u53d8\u91cf\uff1b\u8ba9\u5b50\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u4e2d\u7684thread_info\u5b57\u6bb5\u6307\u5411ti\u53d8\u91cf\uff1b\u6700\u540e\u8ba9\u5b50\u8fdb\u7a0bthread_info\u7ed3\u6784\u4e2d\u7684task\u5b57\u6bb5\u6307\u5411tsk\u53d8\u91cf\u3002<\/p>\n<pre class=\"brush:c\">\t*ti = *orig-&gt;thread_info;\r\n\t*tsk = *orig;\r\n\ttsk-&gt;thread_info = ti;\r\n\tti-&gt;task = tsk;<\/pre>\n<p>\u5c06\u5b50\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u7684\u4f7f\u7528\u8ba1\u6570\u5668\u8bbe\u7f6e\u4e3a2\uff0c\u8868\u793a\u8be5\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u6b63\u5728\u88ab\u4f7f\u7528\u5e76\u4e14\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\u3002<\/p>\n<pre class=\"brush:c\">\tatomic_set(&amp;tsk-&gt;usage,2);<\/pre>\n<p>\u6700\u540e\u8fd4\u56de\u6307\u5411\u521a\u521a\u521b\u5efa\u7684\u5b50\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u5185\u5b58\u533a\u7684\u6307\u9488\u3002<\/p>\n<pre class=\"brush:c\">        return tsk;\r\n}<\/pre>\n<p>\u901a\u8fc7\u4e0a\u8ff0\u4ee3\u7801\u53ef\u4ee5\u770b\u5230\uff0c\u5f53\u8fd9\u4e2a\u51fd\u6570\u6210\u529f\u64cd\u4f5c\u4e4b\u540e\uff0c\u5b50\u8fdb\u7a0b\u548c\u7236\u8fdb\u7a0b\u7684\u63cf\u8ff0\u7b26\u4e2d\u7684\u5185\u5bb9\u662f\u5b8c\u5168\u76f8\u540c\u7684\u3002\u5728\u7a0d\u540e\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u5c06\u4f1a\u770b\u5230\u5b50\u8fdb\u7a0b\u9010\u6b65\u4e0e\u7236\u8fdb\u7a0b\u533a\u5206\u5f00\u6765\u3002<\/p>\n<p>5\uff0e \u66f4\u65b0\u5f53\u524d\u7528\u6237\u7684user_struct\u7ed3\u6784\u3002\u5f53\u524d\u8fdb\u7a0b\u7684\u7528\u6237\u5982\u679c\u6ca1\u6709root\u6743\u9650\uff0c\u5e76\u4e14\u6240\u62e5\u6709\u7684\u8fdb\u7a0b\u6570\u5927\u4e8e\u6240\u89c4\u5b9a\u7684\u8fdb\u7a0b\u6570\u65f6\uff0c\u5c31\u8fd4\u56de\u9519\u8bef\u4ee3\u7801\u3002<\/p>\n<p>\u63a5\u7740\u5bf9\u8be5user_struct\u7ed3\u6784\u7684\u5f15\u7528\u8ba1\u6570\u52a01\uff1b\u5bf9\u8be5\u7528\u6237\u6240\u62e5\u6709\u7684\u8fdb\u7a0b\u603b\u6570\u91cf\u52a01\u3002<\/p>\n<pre class=\"brush:c\">        atomic_inc(&amp;p-&gt;user-&gt;__count);\r\n           atomic_inc(&amp;p-&gt;user-&gt;processes);<\/pre>\n<p>6\uff0e \u68c0\u6d4b\u7cfb\u7edf\u4e2d\u8fdb\u7a0b\u7684\u603b\u6570\u91cf\u662f\u5426\u8d85\u8fc7\u4e86max_threads\u6240\u89c4\u5b9a\u7684\u8fdb\u7a0b\u6700\u5927\u6570\u3002<\/p>\n<pre class=\"brush:c\">         if (nr_threads &gt;= max_threads)\r\n                 goto bad_fork_cleanup_count;<\/pre>\n<p>7\uff0e \u5c06\u4ecedo_fork()\u4f20\u9012\u6765\u7684\u7684clone_flags\u548cpid\u5206\u522b\u8d4b\u503c\u7ed9\u5b50\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u4e2d\u7684\u5bf9\u5e94\u5b57\u6bb5\u3002<\/p>\n<pre class=\"brush:c\">         copy_flags(clone_flags, p);\r\n             p-&gt;pid = pid;<\/pre>\n<p>8\uff0e \u9010\u6b65\u521d\u59cb\u5316\u5b50\u8fdb\u7a0b\u63cf\u8ff0\u7b26\u4e2d\u5b57\u6bb5\uff0c\u4f7f\u5f97\u5b50\u8fdb\u7a0b\u548c\u7236\u8fdb\u7a0b\u9010\u6e10\u533a\u522b\u51fa\u6765\u3002\u8fd9\u90e8\u5206\u5de5\u4f5c\u5305\u542b\u521d\u59cb\u5316\u53cc\u8054\u8868\u3001\u4e92\u65a5\u9501\u548c\u63cf\u8ff0\u8fdb\u7a0b\u5c5e\u6027\u7684\u5b57\u6bb5\u7b49\u3002\u5b83\u5728copy_process\u51fd\u6570\u4e2d\u5360\u636e\u4e86\u76f8\u5f53\u957f\u7684\u4e00\u6bb5\u7684\u4ee3\u7801\uff0c\u4e0d\u8fc7\u8003\u8651\u5230task_struct\u7ed3\u6784\u672c\u8eab\u7684\u590d\u6742\u6027\uff0c\u4e5f\u5c31\u4e0d\u8db3\u4e3a\u5947\u4e86\u3002<\/p>\n<p>9\uff0e \u6839\u636eclone_flags\u7684\u5177\u4f53\u53d6\u503c\uff0c\u901a\u8fc7\u8bf8\u5982copy_semundo()\u548ccopy_files()\u7b49\u8fd9\u6837\u7684\u51fd\u6570\u6765\u4e3a\u5b50\u8fdb\u7a0b\u62f7\u8d1d\u6216\u5171\u4eab\u7236\u8fdb\u7a0b\u7684\u67d0\u4e9b\u6570\u636e\u7ed3\u6784\u3002<\/p>\n<p>10\uff0e \u901a\u8fc7copy_threads()\u51fd\u6570\u66f4\u65b0\u5b50\u8fdb\u7a0b\u7684\u5185\u6838\u6808\u548c\u5bc4\u5b58\u5668\u4e2d\u7684\u503c\u3002\u5728\u4e4b\u524d\u7684dup_task_struct()\u4e2d\u53ea\u662f\u4e3a\u5b50\u8fdb\u7a0b\u521b\u5efa\u4e00\u4e2a\u5185\u6838\u6808\uff0c\u81f3\u6b64\u624d\u662f\u771f\u6b63\u7684\u8d4b\u4e88\u5b83\u6709\u610f\u4e49\u7684\u503c\u3002<\/p>\n<p>\u5f53\u7236\u8fdb\u7a0b\u53d1\u51faclone\u7cfb\u7edf\u8c03\u7528\u65f6\uff0c\u5185\u6838\u4f1a\u5c06\u90a3\u4e2a\u65f6\u5019CPU\u4e2d\u5bc4\u5b58\u5668\u7684\u503c\u4fdd\u5b58\u5728\u7236\u8fdb\u7a0b\u7684\u5185\u6838\u6808\u4e2d\u3002\u8fd9\u91cc\u5c31\u662f\u4f7f\u7528\u7236\u8fdb\u7a0b\u5185\u6838\u6808\u4e2d\u7684\u503c\u6765\u66f4\u65b0\u5b50\u8fdb\u7a0b\u5bc4\u5b58\u5668\u4e2d\u7684\u503c\u3002\u7279\u522b\u7684\uff0c\u5185\u6838\u5c06\u5b50\u8fdb\u7a0beax\u5bc4\u5b58\u5668\u4e2d\u7684\u503c\u5f3a\u5236\u8d4b\u503c\u4e3a0\uff0c\u8fd9\u4e5f\u5c31\u662f\u4e3a\u4ec0\u4e48\u4f7f\u7528fork()\u65f6\u5b50\u8fdb\u7a0b\u8fd4\u56de\u503c\u662f0\u3002\u800c\u5728do_fork\u51fd\u6570\u4e2d\u5219\u8fd4\u56de\u7684\u662f\u5b50\u8fdb\u7a0b\u7684pid\uff0c\u8fd9\u4e00\u70b9\u5728\u4e0a\u8ff0\u5185\u5bb9\u4e2d\u6211\u4eec\u5df2\u7ecf\u6709\u6240\u5206\u6790\u3002\u53e6\u5916\uff0c\u5b50\u8fdb\u7a0b\u7684\u5bf9\u5e94\u7684thread_info\u7ed3\u6784\u4e2d\u7684esp\u5b57\u6bb5\u4f1a\u88ab\u521d\u59cb\u5316\u4e3a\u5b50\u8fdb\u7a0b\u5185\u6838\u6808\u7684\u57fa\u5740\u3002<\/p>\n<p>11\uff0e \u8c03\u7528sched_fork\u51fd\u6570\uff0c\u4f7f\u5f97\u5b50\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u72b6\u6001\u4e3aTASK_RUNNING\u3002\u5e76\u7981\u6b62\u5185\u6838\u62a2\u5360\u3002\u5e76\u4e14\uff0c\u4e3a\u4e86\u4e0d\u5bf9\u5176\u4ed6\u8fdb\u7a0b\u7684\u8c03\u5ea6\u4ea7\u751f\u5f71\u54cd\uff0c\u6b64\u65f6\u5b50\u8fdb\u7a0b\u5171\u4eab\u7236\u8fdb\u7a0b\u7684\u65f6\u95f4\u7247\u3002<\/p>\n<p>12\uff0e \u6839\u636eclone_flags\u7684\u503c\u7ee7\u7eed\u66f4\u65b0\u5b50\u8fdb\u7a0b\u7684\u67d0\u4e9b\u5c5e\u6027\u3002<\/p>\n<p>13\uff0e \u5c06 nr_threads\u52a0\u4e00\uff0c\u8868\u660e\u65b0\u8fdb\u7a0b\u5df2\u7ecf\u88ab\u52a0\u5165\u5230\u8fdb\u7a0b\u96c6\u5408\u4e2d\u3002\u5c06total_forks\u52a0\u4e00\uff0c\u4ee5\u8bb0\u5f55\u88ab\u521b\u5efa\u8fdb\u7a0b\u6570\u91cf\u3002<\/p>\n<pre class=\"brush:c\">        nr_threads++;\r\n           total_forks++;<\/pre>\n<p>14\uff0e \u5982\u679c\u4e0a\u8ff0\u8fc7\u7a0b\u4e2d\u67d0\u4e00\u6b65\u51fa\u73b0\u4e86\u9519\u8bef\uff0c\u5219\u901a\u8fc7goto\u8bed\u53e5\u8df3\u5230\u76f8\u5e94\u7684\u9519\u8bef\u4ee3\u7801\u5904\uff1b\u5982\u679c\u6210\u529f\u6267\u884c\u5b8c\u6bd5\uff0c\u5219\u8fd4\u56de\u5b50\u8fdb\u7a0b\u7684\u63cf\u8ff0\u7b26p\u3002<\/p>\n<p>\u81f3\u6b64\uff0ccopy_proces()\u7684\u5927\u81f4\u6267\u884c\u8fc7\u7a0b\u5206\u6790\u5b8c\u6bd5\u3002<\/p>\n<p>do_fork()\u6267\u884c\u5b8c\u6bd5\u540e\uff0c\u867d\u7136\u5b50\u8fdb\u7a0b\u5904\u4e8e\u53ef\u8fd0\u884c\u72b6\u6001\uff0c\u4f46\u662f\u5b83\u5e76\u6ca1\u6709\u7acb\u523b\u8fd0\u884c\u3002\u81f3\u4e8e\u5b50\u8fdb\u7a0b\u5408\u9002\u6267\u884c\u8fd9\u5b8c\u5168\u53d6\u51b3\u4e8e\u8c03\u5ea6\u7a0b\u5e8f\uff0c\u4e5f\u5c31\u662fschedule()\uff0c\u672c\u6587\u5e76\u4e0d\u6d89\u53ca\u6d89\u53ca\u6b64\u51fd\u6570\u7684\u5206\u6790\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>copy_process()\u5206\u6790 \u901a\u8fc7\u4e0a\u9762\u7684\u5206\u6790\u6211\u4eec\u5f97\u77e5do_fork()\u4e3b\u8981\u5b8c\u6210\u4ee5\u4e0b\u7684\u5de5\u4f5c\uff1a\u4e3a\u5b50\u8fdb\u7a0b\u5b9a\u4e49\u4e86\u4e00 [&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,161],"class_list":["post-2141","post","type-post","status-publish","format-standard","hentry","category-linux","tag-fork","tag-161"],"views":13878,"_links":{"self":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/2141","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=2141"}],"version-history":[{"count":0,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/posts\/2141\/revisions"}],"wp:attachment":[{"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/media?parent=2141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/categories?post=2141"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/edsionte.com\/techblog\/wp-json\/wp\/v2\/tags?post=2141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}