<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-6955042.post-114949530475640375</id><published>2006-06-05T01:10:00.000-07:00</published><updated>2006-06-05T01:15:04.760-07:00</updated><title type='text'>Arg list too long on IRIX systems</title><content type='html'>A common problem: you are running a script or program on your IRIX machine, that automatically generates the command line call for another script or program - but the call fails with the following error message:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;bad interpreter: Arg list too long&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ok, the cause is clear - the generated call exceeds the system's max args limit. Luckily, this can be fixed very easily on IRIX systems - as also explained at &lt;a href="http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?cmd=getdoc&amp;coll=0650&amp;db=man&amp;fname=2%20intro"&gt;SGI Techpubs library&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;First, lets have a look whats the actual limit. This can be examined using sysconf:&lt;br /&gt;&lt;br /&gt;shell&gt; &lt;span style="font-weight:bold;"&gt;sysconf | grep ARG_MAX&lt;/span&gt;&lt;br /&gt;ARG_MAX   &lt;span style="font-weight:bold;"&gt;20480&lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Well, the actual (IRIX default) limit is about 20k for the max command line lenght, which is definitly not very much. Now we check whats the allowed maximum for the actual kernel. We open /var/sysgen/mtune/kernel with any ascii viewer and search for the definition of ncargs or we just use grep like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;grep ncargs /var/sysgen/mtune/kernel&lt;/span&gt;&lt;br /&gt;* ncargs is max # bytes of arguments passed during an exec(2)&lt;br /&gt;ncargs                  20480           5120            262144&lt;br /&gt;&lt;br /&gt;There we can see that the legal range for ncargs is from 5120 to &lt;span style="font-weight:bold;"&gt;262144&lt;/span&gt;, which seems to be the right value for us. IRIXs systune cat set this value during runtime:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;systune -b ncargs 262144&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After this (without logout, reboot or something else), the new value is active:&lt;br /&gt;&lt;br /&gt;shell&gt; &lt;span style="font-weight:bold;"&gt;sysconf | grep ARG_MAX&lt;/span&gt;&lt;br /&gt;ARG_MAX                          262144&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;Now our script should have plenty argument space to operate ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6955042-114949530475640375?l=unixadminsdiary.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixadminsdiary.blogspot.com/feeds/114949530475640375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6955042&amp;postID=114949530475640375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6955042/posts/default/114949530475640375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6955042/posts/default/114949530475640375'/><link rel='alternate' type='text/html' href='http://unixadminsdiary.blogspot.com/2006/06/arg-list-too-long-on-irix-systems.html' title='Arg list too long on IRIX systems'/><author><name>Blue.Balloon</name><uri>http://www.blogger.com/profile/13243598108616566239</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15453865500798053582'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry>