AIX: Argument list too long (quick tip)

If you happen to be on an AIX 5.x host using Gentoo Prefix. Then you might see something like this eventually:

/bin/sh[3]: /home/jolexa/portage/aix-5.3/bin/chmod: arg list too long

This is caused by build systems that use wildcards or even ebuilds that have no issues on a normal GNU/Linux system. To work around this, you need to change the ARG/ENV list size in 4K byte blocks. The default value in AIX 5.x is 6. This is way too small. You will either need root access or kindly ask your system administrator to change this value. To change it, you have two options: use smitty (a curses sys-admin tool on AIX) or do root# chdev -l sys0 -a ncargs=40 on the command line

If you use smitty, you are looking for this:

root# smitty
=> System Environments
    => Change / Show Characteristics of Operating System
         ARG/ENV list size in 4K byte blocks                [40]

40 seems to be a good number. It would be hard to guess the smallest number possible. This is not a problem in AIX 6.1, because the default seems to be ’256′

4 Comments

  1. ckruse says:

    Do you know about xargs(1)?

    • Jeremy Olexa says:

      Of course, xargs, find, etc. Unless you want to change/patch every build system, that is not practical. This is happening while building. If it was just happening on the command line while I was doing ls * or soemthing, THEN xargs/find is practical. cmon now, you think I wouldn’t know about that?

  2. Lee says:

    Any way to see what the current value is without smitty?

    Cheers

  3. Lee says:

    oops should’ve googled first —
    /usr/sbin/lsattr -EH -l sys0 | grep ncargs

Leave a Reply