Krishna Yenduri wrote:
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);
       }

You risk breaking applications that call getrlimit before
your library and assume the number isn't going to change
because they haven't changed it.   If they're using that
for something like the max fd number they pass to select(),
and because of your change they get fd's outside the range
they expect and are select()ing on, this could really cause
problems.

--
        -Alan Coopersmith-           [EMAIL PROTECTED]
         Sun Microsystems, Inc. - X Window System Engineering
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to