27 |
|
#include <poll.h> |
28 |
|
#include <sys/types.h> |
29 |
|
#include <sys/wait.h> |
30 |
+ |
#include <sys/resource.h> |
31 |
|
|
32 |
|
#define DEFNUMTHREAD 10 |
33 |
|
#define DEFTIMEOUT 60 |
332 |
|
GError *pp_err = NULL, *err = NULL; |
333 |
|
gint x; |
334 |
|
|
335 |
+ |
struct rlimit rlp; |
336 |
+ |
|
337 |
|
GOptionContext *optcontext; |
338 |
|
|
339 |
|
optcontext = g_option_context_new(" - parallel job executer"); |
363 |
|
}else{ |
364 |
|
g_printerr("Threading not supported\n"); |
365 |
|
} |
366 |
+ |
|
367 |
+ |
/* Up the number of FD's to the "hard" limit. |
368 |
+ |
* This is mainly to get around the very small default |
369 |
+ |
* solaris has, or 256 |
370 |
+ |
*/ |
371 |
+ |
getrlimit(RLIMIT_NOFILE, &rlp); |
372 |
+ |
rlp.rlim_cur = rlp.rlim_max; |
373 |
+ |
setrlimit(RLIMIT_NOFILE, &rlp); |
374 |
|
|
375 |
|
if(verbose) g_printerr("Creating a threadpool %d in size\n", numthreads); |
376 |
|
procpool = g_thread_pool_new(process_child, NULL, numthreads, FALSE, &pp_err); |