Lines Matching refs:num_open
52 static struct rlimit num_open; variable
66 for(num_open.rlim_cur = 0; in close_file_descriptors()
67 num_open.rlim_cur < num_open.rlim_max; in close_file_descriptors()
68 num_open.rlim_cur++) in close_file_descriptors()
69 if(fd[num_open.rlim_cur] > 0) in close_file_descriptors()
70 close(fd[num_open.rlim_cur]); in close_file_descriptors()
229 num_open.rlim_cur = NUM_NEEDED; in rlimit()
235 (rl.rlim_cur <= num_open.rlim_cur)) { in rlimit()
237 msnprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_cur); in rlimit()
259 num_open.rlim_max = sizeof(*memchunk) * (size_t)nitems; in rlimit()
260 msnprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max); in rlimit()
283 num_open.rlim_max = NUM_OPEN; in rlimit()
287 if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*fd)) { in rlimit()
288 msnprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_max); in rlimit()
299 msnprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max); in rlimit()
302 fd = malloc(sizeof(*fd) * (size_t)(num_open.rlim_max)); in rlimit()
314 for(num_open.rlim_cur = 0; in rlimit()
315 num_open.rlim_cur < num_open.rlim_max; in rlimit()
316 num_open.rlim_cur++) in rlimit()
317 fd[num_open.rlim_cur] = -1; in rlimit()
319 msnprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max); in rlimit()
337 for(num_open.rlim_cur = 1; in rlimit()
338 num_open.rlim_cur < num_open.rlim_max; in rlimit()
339 num_open.rlim_cur++) { in rlimit()
341 fd[num_open.rlim_cur] = dup(fd[0]); in rlimit()
343 if(fd[num_open.rlim_cur] < 0) { in rlimit()
345 fd[num_open.rlim_cur] = -1; in rlimit()
347 msnprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_cur); in rlimit()
351 msnprintf(strbuff1, sizeof(strbuff), fmt, num_open.rlim_cur); in rlimit()
356 num_open.rlim_max = NUM_NEEDED; in rlimit()
358 msnprintf(strbuff2, sizeof(strbuff2), fmt, num_open.rlim_max); in rlimit()
359 msnprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_cur); in rlimit()
365 for(num_open.rlim_cur = 0; in rlimit()
366 fd[num_open.rlim_cur] >= 0; in rlimit()
367 num_open.rlim_cur++) in rlimit()
368 close(fd[num_open.rlim_cur]); in rlimit()
378 msnprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max); in rlimit()
396 num_open.rlim_cur = FD_SETSIZE - SAFETY_MARGIN; in rlimit()
397 if(num_open.rlim_max > num_open.rlim_cur) { in rlimit()
407 num_open.rlim_cur = FD_SETSIZE - SAFETY_MARGIN; in rlimit()
409 rl.rlim_cur < num_open.rlim_max; in rlimit()
412 ((unsigned int)fd[rl.rlim_cur] > num_open.rlim_cur)) { in rlimit()
435 msnprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_max); in rlimit()