NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/44722



On Sun, Sep 18, 2011 at 2:45 PM, Alan Barrett <apb%cequrux.com@localhost> wrote:

>  On Sat, 17 Sep 2011, Abhinav Upadhyay wrote:
>  > Not only ls(1) but probably a number of other programs are not behaving
>  > correclty under low file descriptor limit.
>  > For example:
>  >
>  > $ man ls
>  > .: 4: Invalid argument
>
>  I can't replicate that.  I get the following results, with everything
>  either working or giving a reasonable error:
I also see man(1) working properly if I use the above script. But I
did something like this:

$ ulimit -n 5
$ man ls
.: 4: Invalid argument
Fair enough. I didn't perform a thorough enough check like you did,
most probably my environment had to do something with the weird
results I got.

>  > It was even more weird to see that ls(1) and man(1) exited with proper
>  > error messages if I tried to do something like this:
>  >
>  > $ . ls #supply name of any executable file
>  > .: Cannot execute ELF binary /bin/ls
>  >
>  > $ ls
>  > ls: .: Too many open files
>  >
>  Those error messages seem reasonable to me.

My point with the above example was that, if you have a low file
descriptor limit, then ls(1) lists all the sub-directories, but if you
execute the above set of commands sequentially, ls(1) does give a sane
message and exits. Probably man(1) is irrelevant here. I mixed it up.

--
Abhinav


Home | Main Index | Thread Index | Old Index