On Thu, Oct 23, 2008 at 12:46 PM, Peter Miller <[EMAIL PROTECTED]> wrote: > On Wed, 2008-10-22 at 17:27 -0700, Scott Finneran wrote: >> Is there a way to obtain the limit for ENFILE? >> >> I'm pretty sure that it corresponds to /proc/sys/fs/file-max. Could be >> wrong but I vaguely recall this being valid for slowlaris too. > > Catch 22, in that you need to open a file to discover the limit, but > exceeding the limit on the number of open files is the reason I want to > discover it, so I can put it in an error message (written on an > already-open file).
You could of course determine this at the start of the program.. but that sucks many reasons, if not just because it could change during the course of the program. Although you could just open it, and steal and fd from the system so that you can report on it anyway. (Assumes you have something like libinit() that the user must call first.) Is the file-descriptor, plus time to open at program start time worth the extra value it provides in debugging/error reporting later? Compile time option maybe? Cheers, Benno > > Regards > Peter Miller <[EMAIL PROTECTED]> > /\/\* http://miller.emu.id.au/pmiller/ > > PGP public key ID: 1024D/D0EDB64D > fingerprint = AD0A C5DF C426 4F03 5D53 2BDB 18D8 A4E2 D0ED B64D > See http://www.keyserver.net or any PGP keyserver for public key. > > "Walking on water and developing software from a specification are easy > if both are frozen." -- Edward V. Berard > > _______________________________________________ > coders mailing list > coders@slug.org.au > http://lists.slug.org.au/listinfo/coders > > _______________________________________________ coders mailing list coders@slug.org.au http://lists.slug.org.au/listinfo/coders