The Unarchiver (1000)

694 Name: trip2me : 2009-12-29 13:22 ID:gXNOgUcX [Del]

>>693

OK, I got it.. : )

How about you use setrlimit(2)?

I modified in main.m of The Unarchiver.

Modify it for your adequate use, please.

static int setOpenmax(rlim_t limit)
{
struct rlimit rl;
int status;

rl.rlim_max = RLIM_INFINITY;
rl.rlim_cur = ( limit < RLIM_INFINITY) ? limit : RLIM_INFINITY ;
if ((status = setrlimit(RLIMIT_NOFILE, &rl)) == -1) {
if (getrlimit(RLIMIT_NOFILE, &rl) == -1)
NSLog(@"getrlimit: NOFILE");
rl.rlim_cur = rl.rlim_max;
if (setrlimit(RLIMIT_NOFILE, &rl) == -1)
NSLog(@"setrlimit: NOFILE");
}
return status;
}

int main(int argc,const char **argv)
{
rlim_t limit = ( OPEN_MAX < RLIM_INFINITY) ? OPEN_MAX : RLIM_INFINITY;
if (setOpenmax( limit ) == -1)
NSLog(@"Failed to change OPEN_MAX");

...continues...

This thread has been closed. You cannot post in this thread any longer.