Lines Matching refs:num_open
42 #define NUM_OPEN (FD_SETSIZE + 10)
43 #define NUM_NEEDED (NUM_OPEN + SAFETY_MARGIN)
54 static struct rlimit num_open;
68 for(num_open.rlim_cur = 0;
69 num_open.rlim_cur < num_open.rlim_max;
70 num_open.rlim_cur++)
71 if(fd[num_open.rlim_cur] > 0)
72 close(fd[num_open.rlim_cur]);
151 fprintf(stderr, "test518 NUM_OPEN : %d\n", NUM_OPEN);
231 num_open.rlim_cur = NUM_NEEDED;
237 (rl.rlim_cur <= num_open.rlim_cur)) {
239 snprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_cur);
261 num_open.rlim_max = sizeof(*memchunk) * (size_t)nitems;
262 snprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max);
285 num_open.rlim_max = NUM_OPEN;
289 if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*fd)) {
290 snprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_max);
301 snprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max);
304 fd = malloc(sizeof(*fd) * (size_t)(num_open.rlim_max));
316 for(num_open.rlim_cur = 0;
317 num_open.rlim_cur < num_open.rlim_max;
318 num_open.rlim_cur++)
319 fd[num_open.rlim_cur] = -1;
321 snprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max);
339 for(num_open.rlim_cur = 1;
340 num_open.rlim_cur < num_open.rlim_max;
341 num_open.rlim_cur++) {
343 fd[num_open.rlim_cur] = dup(fd[0]);
345 if(fd[num_open.rlim_cur] < 0) {
347 fd[num_open.rlim_cur] = -1;
349 snprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_cur);
353 snprintf(strbuff1, sizeof(strbuff), fmt, num_open.rlim_cur);
358 num_open.rlim_max = NUM_NEEDED;
360 snprintf(strbuff2, sizeof(strbuff2), fmt, num_open.rlim_max);
361 snprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_cur);
367 for(num_open.rlim_cur = 0;
368 fd[num_open.rlim_cur] >= 0;
369 num_open.rlim_cur++)
370 close(fd[num_open.rlim_cur]);
380 snprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max);
398 num_open.rlim_cur = FD_SETSIZE - SAFETY_MARGIN;
399 if(num_open.rlim_max > num_open.rlim_cur) {
409 num_open.rlim_cur = FD_SETSIZE - SAFETY_MARGIN;
411 rl.rlim_cur < num_open.rlim_max;
414 ((unsigned int)fd[rl.rlim_cur] > num_open.rlim_cur)) {
437 snprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_max);