{"id":909,"date":"2010-01-26T01:00:00","date_gmt":"2010-01-25T16:00:00","guid":{"rendered":"https:\/\/ecoop.net\/memo\/2010-01-26-1.html"},"modified":"2017-02-20T11:05:31","modified_gmt":"2017-02-20T02:05:31","slug":"2010-01-26-1","status":"publish","type":"post","link":"https:\/\/www.ecoop.net\/memo\/archives\/2010-01-26-1.html","title":{"rendered":"\u30b3\u30de\u30f3\u30c9\u5f15\u6570\u306e\u6587\u5b57\u6570\u5236\u9650 &#8211; Argument list too long"},"content":{"rendered":"<p>UNIX\u7cfbOS\u3067\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u306e\u6700\u5927\u306e\u9577\u3055\u306f execve(2) \u306e\u5236\u9650\u306b\u4f9d\u5b58\u3059\u308b\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5b9f\u884c\u5f15\u6570\u306e\u5236\u9650\u306b\u3064\u3044\u3066\u306f\u3001\u9577\u3055\u306e\u5236\u9650\u306f OS \u306b\u3088\u3063\u3066\u7570\u306a\u308a\u3001FreeBSD \u3067\u306f 64KB\u3001Linux \u306e\u3042\u308b\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3067\u306f 128KB\u3001SunOS4\u301cSolaris \u306f 1MB\u3001HP-UX 10.20 \u307e\u3067\u306f 20KB (\u30d1\u30c3\u30c1\u3092\u5f53\u3066\u308c\u3070 2MB)\u3001HP-UX 11.x \u4ee5\u964d\u306f 2MB \u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u5024\u306f\u4f1d\u7d71\u7684\u306b ARG_MAX \u3068\u3044\u3046\u30de\u30af\u30ed\u5b9a\u6570\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u4f7f\u3063\u3066\u3044\u308b UNIX, Linux, Mac OS X \u306e ARG_MAX \u3092\u8abf\u3079\u305f\u3044\u5834\u5408\u306f \/usr\/include \u3092 ARG_MAX \u3067 grep \u3059\u308b\u304b\u3001getconf \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">% getconf ARG_MAX<\/pre>\n<p>\u7d50\u679c\uff1a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">65536<\/pre>\n<p>\u3068\u3059\u308b\u3053\u3068\u3067\u8abf\u3079\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>FreeBSD \u306a\u3089 sysctl \u3067<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n% sysctl -A kern.argmax\n<\/pre>\n<p>\u7d50\u679c\uff1a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nkern.argmax: 65536\n<\/pre>\n<p>\u3068\u3057\u3066\u3082\u3044\u3044\u3067\u3059\u3002<br \/>\n\u306a\u304a\u3001ARG_MAX \u306f 4096 \u4ee5\u4e0a\u3067\u3042\u308b\u3079\u304d\u3001\u3068 POSIX \u306b\u306f\u898f\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>2017\u5e74\uff12\u6708\u73fe\u5728\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u6700\u5927\u6587\u5b57\u6570\u306e\u53c2\u8003\u5024\u304c\u77e5\u308a\u305f\u304f\u3066\u3001<br \/>\n\u624b\u5143\u306e\u30de\u30b7\u30f3\u3044\u304f\u3064\u304b\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>CentOS release 6.8 (Final \/ \u3055\u304f\u3089\u306eVPS) \u2026 2621440\u6587\u5b57<\/p>\n<\/li>\n<li>\n<p>Scientific Linux release 6.2 (Carbon \/ \u3055\u304f\u3089\u306eVPS) \u2026 2621440\u6587\u5b57<\/p>\n<\/li>\n<li>\n<p>Mac OS X Sierra (Macbook Pro 2015) \u2026 262144\u6587\u5b57<\/p>\n<\/li>\n<li>\n<p>Debian(Jessie \/ \u3055\u304f\u3089\u306e\u30af\u30e9\u30a6\u30c9) \u2026 2097152\u6587\u5b57<\/p>\n<\/li>\n<\/ul>\n<p>\u6700\u4f4e\u3067\u3082\uff12\uff10\u4e07\u6587\u5b57\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u3042\u307e\u308a\u6c17\u306b\u3059\u308b\u6a5f\u4f1a\u306f\u306a\u3055\u305d\u3046\u3067\u3059\u304c\u3001<br \/>\n\u3082\u3057\u5927\u91cf\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u6271\u3046\u5834\u5408\u306a\u3069\u306bArgument list too long\u30a8\u30e9\u30fc\u304c\u3067\u305f\u3068\u304d\u306f\u3001<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b xargs \u306a\u3069\u3092\u4f7f\u3046\u3068ARG_MAX\u306e\u5236\u9650\u3092\u56de\u907f\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ngrep foo \/path\/to\/too-many-files\/*\n<\/pre>\n<p>\u305f\u3068\u3048\u3070\u3053\u306e\u3088\u3046\u306b\u3001\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3057\u307e\u3046\u5834\u5408\u3001<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\necho \/path\/to\/too-many-files\/* | \uff58args grep foo\n<\/pre>\n<p>\u306e\u3088\u3046\u306b echo \u3068 xargs\u3000\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u30a8\u30e9\u30fc\u306a\u304f\u52d5\u4f5c\u3057\u307e\u3059\u3002<\/p>\n<p>\u306a\u305c\u3053\u308c\u306a\u3089\u30a8\u30e9\u30fc\u306b\u306a\u3089\u306a\u3044\u304b\u3068\u3044\u3046\u3068\u3001echo\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u306a\u304f\u30b7\u30a7\u30eb\u306e\u5185\u90e8\u30b3\u30de\u30f3\u30c9\u306a\u306e\u3067\u6587\u5b57\u6570\u5236\u9650(ARG_MAX\u306e\u5236\u9650)\u3092\u53d7\u3051\u306a\u3044\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001xargs\u306fARG_MAX\u306e\u5024\u3092\u628a\u63e1\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u5f15\u6570\u304cARG_MAX\u3092\u8d85\u3048\u305d\u3046\u306b\u306a\u308b\u3068\u3001\u81ea\u52d5\u7684\u306b\u8907\u6570\u56de\u306b\u5206\u5272\u3057\u3066\u5b9f\u884c\u3057\u3066\u304f\u308c\u308b\u305f\u3081\u3001ARG_MAX\u306e\u554f\u984c\u3092\u56de\u907f\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UNIX\u7cfbOS\u3067\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u306e\u6700\u5927\u306e\u9577\u3055\u306f execve(2) \u306e\u5236\u9650\u306b\u4f9d\u5b58\u3059\u308b\u305d\u3046\u3067\u3059\u3002 \u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5b9f\u884c\u5f15\u6570\u306e\u5236\u9650\u306b\u3064\u3044\u3066\u306f\u3001\u9577\u3055\u306e\u5236\u9650\u306f OS \u306b\u3088\u3063\u3066\u7570\u306a\u308a\u3001FreeBSD \u3067\u306f 64KB\u3001Linux \u306e\u3042\u308b &hellip; <a href=\"https:\/\/www.ecoop.net\/memo\/archives\/2010-01-26-1.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u30b3\u30de\u30f3\u30c9\u5f15\u6570\u306e\u6587\u5b57\u6570\u5236\u9650 &#8211; Argument list too long<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101,135],"tags":[20],"class_list":["post-909","post","type-post","status-publish","format-standard","hentry","category-mac-2","category-server","tag-linux"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/comments?post=909"}],"version-history":[{"count":1,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/909\/revisions"}],"predecessor-version":[{"id":1205,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/909\/revisions\/1205"}],"wp:attachment":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/media?parent=909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/categories?post=909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/tags?post=909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}