title: On Linux - set maximum open files to unlimited. Possible?
body: <p>Is it possible to set the maximum number of open files to some "infinite" value or must it be a number?</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>I'm using RHEL 5 if it's important.</p>
  
  <p><strong>Update:</strong> 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?</p>
  
  <hr>
  
  <p>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.</p>