Is it possible to set the maximum number of open files to some "infinite" value or must it be a number?
I had a requirement to set the descriptor limit for a daemon user to be "unlimited" and I'm trying to determine if that's possible or how to do it. I've seen some mailing lists refer to a "max" value that can be used (as in: "myuser hard nofile max", but so far the man pages and references I've consulted don't back that up.
If I can't use 'max' or similar, I'd like to know how to determine what the max number of files is (theoretically) so I have some basis for whatever number I pick. I don't want to use 100000000 or something if there's a more reasonable way to get an upper bound.
I'm using RHEL 5 if it's important.
Update: I'm an idiot when it comes to writing questions. Ideally I'd like to do this in the limits.conf file (which is where "max" would come from). Does that change any answers?
Thanks for the comments. This is for a JBOSS instance and not a daemon I'm writing so I don't know if setrlimit() is useful to me. However, Jefromi - I do like the definition of Infinity :) I saw a post that suggests a file descriptor is "two shorts and a pointer" so I should be able to calculate the approximate upper bound.