Hi all,
Is it safe to call setrlimit(RLIMIT_NOFILE, ..) from a library?
The code does
if (getrlimit(RLIMIT_NOFILE, &rl) == 0) {
rl.rlim_cur = rl.rlim_max;
(void) setrlimit(RLIMIT_NOFILE, &rl);
}
The library needs some file descriptors for its internal use
and increasing the soft limit on file descriptors up to the hard limit
will make it unlikely that an application using the library runs out
of file descriptors for its own use. This seems safe to do to me
as we are only increasing the limit.
But, I am not sure if this is kosher since there does not seem to be
any use of setrlimit(2) in ON libraries excepting in
libdtrace (lib/libdtrace/common/dt_open.c).
Thanks,
-Krishna
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code