--- projects/pjob/pjob.c 2006/01/25 20:05:52 1.5 +++ projects/pjob/pjob.c 2006/01/30 21:46:59 1.6 @@ -27,6 +27,7 @@ #include #include #include +#include #define DEFNUMTHREAD 10 #define DEFTIMEOUT 60 @@ -331,6 +332,8 @@ int main(int argc, char **argv){ GError *pp_err = NULL, *err = NULL; gint x; + struct rlimit rlp; + GOptionContext *optcontext; optcontext = g_option_context_new(" - parallel job executer"); @@ -360,6 +363,14 @@ int main(int argc, char **argv){ }else{ g_printerr("Threading not supported\n"); } + + /* Up the number of FD's to the "hard" limit. + * This is mainly to get around the very small default + * solaris has, or 256 + */ + getrlimit(RLIMIT_NOFILE, &rlp); + rlp.rlim_cur = rlp.rlim_max; + setrlimit(RLIMIT_NOFILE, &rlp); if(verbose) g_printerr("Creating a threadpool %d in size\n", numthreads); procpool = g_thread_pool_new(process_child, NULL, numthreads, FALSE, &pp_err);