{"id":269676,"date":"2023-04-17T20:17:36","date_gmt":"2023-04-17T12:17:36","guid":{"rendered":"https:\/\/lrxjmw.cn\/tmlncysylyzy.html"},"modified":"2023-04-17T20:17:36","modified_gmt":"2023-04-17T12:17:36","slug":"tmlncysylyzy","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/tmlncysylyzy.html","title":{"rendered":"\u63a2\u79d8Linux\u5185\u5b58\u6620\u5c04\uff1a\u539f\u7406\u4e0e\u6ce8\u610f\u4e8b\u9879\uff0c\u7b49\u4f60\u6765\u4e86\u89e3\uff01"},"content":{"rendered":"

Linux<\/a>\u5185\u5b58\u6620\u5c04\u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u8ba9\u4f60\u7684\u7a0b\u5e8f\u98de\u8d77\u6765\uff01\u4f46\u662f\uff0c\u5982\u679c\u4e0d\u4e86\u89e3\u8fd9\u4e2a\u5de5\u5177\u7684\u539f\u7406\u548c\u4f7f\u7528\u65b9\u6cd5\uff0c\u5c31\u5f88\u5bb9\u6613\u5728\u4f7f\u7528\u65f6\u9047\u5230\u5404\u79cd\u95ee\u9898\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u6df1\u5165\u63a2\u8ba8Linux\u5185\u5b58\u6620\u5c04\u7684\u539f\u7406\u3001\u4f18\u52bf\u3001\u5e94\u7528\u573a\u666f\u548c\u6ce8\u610f\u4e8b\u9879\u7b49\u65b9\u9762\u3002<\/p>\n

\u4e00\u3001\u4ec0\u4e48\u662fLinux\u5185\u5b58\u6620\u5c04\uff1f<\/b><\/p>\n

Linux\u5185\u5b58\u6620\u5c04\u662f\u4e00\u79cd\u5c06\u6587\u4ef6\u6216\u8bbe\u5907\u6620\u5c04\u5230\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u7684\u65b9\u6cd5\u3002\u5b83\u901a\u8fc7\u5c06\u6587\u4ef6\u6216\u8bbe\u5907\u76f4\u63a5\u6620\u5c04\u5230\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u4e2d\uff0c\u4f7f\u5f97\u8fdb\u7a0b\u53ef\u4ee5\u50cf\u8bbf\u95ee\u5185\u5b58\u4e00\u6837\u8bbf\u95ee\u6587\u4ef6\u6216\u8bbe\u5907\uff0c\u4ece\u800c\u6781\u5927\u5730\u63d0\u9ad8\u4e86\u6570\u636e\u8bfb\u5199\u6548\u7387\u3002<\/p>\n

\u4e8c\u3001Linux\u5185\u5b58\u6620\u5c04\u7684\u4f18\u52bf<\/b><\/p>\n

linux 32\u4f4d\u7cfb\u7edf\u652f\u6301\u591a\u5927\u5185\u5b58_linux \u7528\u6237\u7a7a\u95f4\u5185\u5b58\u7533\u8bf7_linux \u5185\u5b58\u6620\u5c04<\/p>\n

1.\u9ad8\u6548\u6027\uff1a\u5c06\u6587\u4ef6\u6216\u8bbe\u5907\u76f4\u63a5\u6620\u5c04\u5230\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u4e2d\uff0c\u65e0\u9700\u8fdb\u884c\u4f20\u7edf\u7684\u8bfb\u5199\u64cd\u4f5c\uff0c\u56e0\u6b64\u6548\u7387\u975e\u5e38\u9ad8\u3002<\/p>\n

2.\u7075\u6d3b\u6027\uff1a\u53ef\u4ee5\u5bf9\u4efb\u610f\u5927\u5c0f\u7684\u6587\u4ef6\u6216\u8bbe\u5907\u8fdb\u884c\u5185\u5b58\u6620\u5c04\u64cd\u4f5c\u3002<\/p>\n

3.\u5b89\u5168\u6027\uff1a\u5bf9\u5185\u5b58\u533a\u57df\u8fdb\u884c\u4fdd\u62a4\u65f6linux \u5185\u5b58\u6620\u5c04<\/strong>\uff0c\u53ef\u4ee5\u4f7f\u7528mprotect()\u51fd\u6570\u8bbe\u7f6e\u9875\u5c5e\u6027\u8fdb\u884c\u4fdd\u62a4\u3002<\/p>\n

4.\u6613\u7528\u6027\uff1a\u901a\u8fc7\u7b80\u5355\u7684API\u8c03\u7528\u5373\u53ef\u5b9e\u73b0\u5185\u5b58\u6620\u5c04\u64cd\u4f5c\u3002<\/p>\n

linux \u7528\u6237\u7a7a\u95f4\u5185\u5b58\u7533\u8bf7_linux \u5185\u5b58\u6620\u5c04_linux 32\u4f4d\u7cfb\u7edf\u652f\u6301\u591a\u5927\u5185\u5b58<\/p>\n

\u4e09\u3001\u5982\u4f55\u4f7f\u7528Linux\u5185\u5b58\u6620\u5c04\uff1f<\/b><\/p>\n

\u5728Linux\u4e2dlinux \u5185\u6838\uff0c\u53ef\u4ee5\u4f7f\u7528mmap()\u51fd\u6570\u5c06\u6587\u4ef6\u6216\u8bbe\u5907\u6620\u5c04\u5230\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u4e2d\u3002mmap()\u51fd\u6570\u7684\u539f\u578b\u5982\u4e0b\uff1a<\/p>\n

\n

c\nvoid *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);\n<\/pre>\n<\/p>\n

\u5176\u4e2d\uff0caddr\u8868\u793a\u6620\u5c04\u533a\u57df\u7684\u9996\u5730\u5740\uff1blength\u8868\u793a\u6620\u5c04\u533a\u57df\u7684\u957f\u5ea6\uff1bprot\u8868\u793a\u6620\u5c04\u533a\u57df\u7684\u4fdd\u62a4\u5c5e\u6027\uff1bflags\u8868\u793a\u6620\u5c04\u533a\u57df\u7684\u6807\u5fd7\uff1bfd\u8868\u793a\u8981\u6620\u5c04\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\uff1boffset\u8868\u793a\u8981\u6620\u5c04\u7684\u6587\u4ef6\u504f\u79fb\u91cf\u3002<\/p>\n

linux \u5185\u5b58\u6620\u5c04_linux 32\u4f4d\u7cfb\u7edf\u652f\u6301\u591a\u5927\u5185\u5b58_linux \u7528\u6237\u7a7a\u95f4\u5185\u5b58\u7533\u8bf7<\/p>\n

\u56db\u3001Linux\u5185\u5b58\u6620\u5c04\u7684\u5e94\u7528\u573a\u666f<\/b><\/p>\n

1.\u9ad8\u901f\u7f13\u5b58\uff1a\u53ef\u4ee5\u5c06\u78c1\u76d8\u4e0a\u7684\u6570\u636e\u6620\u5c04\u5230\u5185\u5b58\u4e2d\uff0c\u4ee5\u63d0\u9ad8\u8bfb\u5199\u901f\u5ea6\u3002<\/p>\n

2.\u6587\u4ef6\u5171\u4eab\uff1a\u591a\u4e2a\u8fdb\u7a0b\u53ef\u4ee5\u901a\u8fc7\u5185\u5b58\u6620\u5c04\u5171\u4eab\u540c\u4e00\u4e2a\u6587\u4ef6linux \u5185\u5b58\u6620\u5c04<\/strong>\uff0c\u4ece\u800c\u5b9e\u73b0\u6570\u636e\u5171\u4eab\u3002<\/p>\n

3.\u7f51\u7edc\u7f16\u7a0b\uff1a\u53ef\u4ee5\u5c06\u7f51\u7edc\u6570\u636e\u76f4\u63a5\u6620\u5c04\u5230\u5185\u5b58\u4e2d\u8fdb\u884c\u5904\u7406\uff0c\u4ece\u800c\u63d0\u9ad8\u7f51\u7edc\u6570\u636e\u5904\u7406\u6548\u7387\u3002<\/p>\n

4.\u6570\u636e\u5e93\u7ba1\u7406\uff1a\u53ef\u4ee5\u5c06\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u76f4\u63a5\u6620\u5c04\u5230\u5185\u5b58\u4e2d\u8fdb\u884c\u5904\u7406\uff0c\u4ece\u800c\u63d0\u9ad8\u6570\u636e\u5e93\u64cd\u4f5c\u6548\u7387\u3002<\/p>\n

\u4e94\u3001Linux\u5185\u5b58\u6620\u5c04\u7684\u6ce8\u610f\u4e8b\u9879<\/b><\/p>\n

1.\u5185\u5b58\u7a7a\u95f4\u6709\u9650\uff1a\u5728\u4f7f\u7528\u5185\u5b58\u6620\u5c04\u65f6\u9700\u8981\u6ce8\u610f\u5185\u5b58\u7a7a\u95f4\u7684\u9650\u5236\uff0c\u907f\u514d\u51fa\u73b0OOM\uff08Out of Memory\uff09\u9519\u8bef\u3002<\/p>\n

2.\u5185\u5b58\u4fdd\u62a4\uff1a\u5728\u4f7f\u7528\u5185\u5b58\u6620\u5c04\u65f6\u9700\u8981\u6ce8\u610f\u5bf9\u5185\u5b58\u533a\u57df\u8fdb\u884c\u4fdd\u62a4\uff0c\u907f\u514d\u51fa\u73b0\u975e\u6cd5\u8bbf\u95ee\u6216\u4fee\u6539\u3002<\/p>\n

3.\u6587\u4ef6\u5927\u5c0f\u9650\u5236\uff1a\u5728\u4f7f\u7528\u5185\u5b58\u6620\u5c04\u65f6\u9700\u8981\u6ce8\u610f\u6587\u4ef6\u5927\u5c0f\u7684\u9650\u5236\uff0c\u907f\u514d\u51fa\u73b0\u6587\u4ef6\u8fc7\u5927\u5bfc\u81f4\u65e0\u6cd5\u6620\u5c04\u7684\u95ee\u9898\u3002<\/p>\n

4.\u5171\u4eab\u5185\u5b58\uff1a\u5728\u4f7f\u7528\u5171\u4eab\u5185\u5b58\u65f6\u9700\u8981\u6ce8\u610f\u591a\u8fdb\u7a0b\u4e4b\u95f4\u7684\u540c\u6b65\u95ee\u9898linux\u547d\u4ee4\u884c\uff0c\u907f\u514d\u51fa\u73b0\u6570\u636e\u9519\u4e71\u6216\u4e22\u5931\u7684\u95ee\u9898\u3002<\/p>\n

\u516d\u3001\u7ed3\u8bba<\/b><\/p>\n

Linux\u5185\u5b58\u6620\u5c04\u662f\u4e00\u79cd\u975e\u5e38\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u6781\u5927\u5730\u63d0\u9ad8\u6570\u636e\u8bfb\u5199\u6548\u7387\u3002\u4f46\u662f\uff0c\u5728\u4f7f\u7528\u65f6\u9700\u8981\u6ce8\u610f\u4e00\u4e9b\u7ec6\u8282\u548c\u6ce8\u610f\u4e8b\u9879\uff0c\u907f\u514d\u51fa\u73b0\u5404\u79cd\u95ee\u9898\u3002\u5e0c\u671b\u672c\u6587\u80fd\u591f\u5bf9\u5927\u5bb6\u4e86\u89e3Linux\u5185\u5b58\u6620\u5c04\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u6df1\u5165\u63a2\u8ba8Linux\u5185\u5b58\u6620\u5c04\u7684\u539f\u7406\u3001\u4f18\u52bf\u3001\u5e94\u7528\u573a\u666f\u548c\u6ce8\u610f\u4e8b\u9879\u7b49\u65b9\u9762\u3002Linux\u5185\u5b58\u6620\u5c04\u662f\u4e00\u79cd\u5c06\u6587\u4ef6\u6216\u8bbe\u5907\u6620\u5c04\u5230\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u7684\u65b9\u6cd5\u3002\u6613\u7528\u6027\uff1a\u901a\u8fc7\u7b80\u5355\u7684API\u8c03\u7528\u5373\u53ef\u5b9e\u73b0\u5185\u5b58\u6620\u5c04\u64cd\u4f5c\u3002\u4e94\u3001Linux\u5185\u5b58\u6620\u5c04\u7684\u6ce8\u610f\u4e8b\u9879\u5185\u5b58\u4fdd\u62a4\uff1a\u5728\u4f7f\u7528\u5185\u5b58\u6620\u5c04\u65f6\u9700\u8981\u6ce8\u610f\u5bf9\u5185\u5b58\u533a\u57df\u8fdb\u884c\u4fdd\u62a4\uff0c\u907f\u514d\u51fa\u73b0\u975e\u6cd5\u8bbf\u95ee\u6216\u4fee\u6539\u3002\u6587\u4ef6\u5927\u5c0f\u9650\u5236\uff1a\u5728\u4f7f\u7528\u5185\u5b58\u6620\u5c04\u65f6\u9700\u8981\u6ce8\u610f\u6587\u4ef6\u5927\u5c0f\u7684\u9650\u5236\uff0c\u907f\u514d\u51fa\u73b0\u6587\u4ef6\u8fc7\u5927\u5bfc\u81f4\u65e0\u6cd5\u6620\u5c04\u7684\u95ee\u9898\u3002<\/p>\n","protected":false},"author":1,"featured_media":269677,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-269676","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/269676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=269676"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/269676\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/269677"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=269676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=269676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=269676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}