• Home
  • Raw
  • Download

Lines Matching refs:num_open

53 static struct rlimit num_open;  variable
67 for(num_open.rlim_cur = 0; in close_file_descriptors()
68 num_open.rlim_cur < num_open.rlim_max; in close_file_descriptors()
69 num_open.rlim_cur++) in close_file_descriptors()
70 if(fd[num_open.rlim_cur] > 0) in close_file_descriptors()
71 close(fd[num_open.rlim_cur]); in close_file_descriptors()
233 num_open.rlim_max = sizeof(*memchunk) * nitems;
234 msnprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max);
263 num_open.rlim_max = rl.rlim_cur - SAFETY_MARGIN;
271 num_open.rlim_max = nitems;
276 if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*fd)) {
277 msnprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_max);
289 msnprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max);
291 fd = malloc(sizeof(*fd) * (size_t)(num_open.rlim_max));
294 num_open.rlim_max /= 2;
296 } while(num_open.rlim_max && !fd);
308 for(num_open.rlim_cur = 0;
309 num_open.rlim_cur < num_open.rlim_max;
310 num_open.rlim_cur++)
311 fd[num_open.rlim_cur] = -1;
313 msnprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max);
331 for(num_open.rlim_cur = 1;
332 num_open.rlim_cur < num_open.rlim_max;
333 num_open.rlim_cur++) {
335 fd[num_open.rlim_cur] = dup(fd[0]);
337 if(fd[num_open.rlim_cur] < 0) {
339 fd[num_open.rlim_cur] = -1;
341 msnprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_cur);
345 msnprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_cur);
350 num_open.rlim_max = num_open.rlim_cur - SAFETY_MARGIN;
352 num_open.rlim_cur -= num_open.rlim_max;
353 msnprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_cur);
358 for(num_open.rlim_cur = num_open.rlim_max;
359 fd[num_open.rlim_cur] >= 0;
360 num_open.rlim_cur++) {
361 close(fd[num_open.rlim_cur]);
362 fd[num_open.rlim_cur] = -1;
365 msnprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max);
370 tmpfd = realloc(fd, sizeof(*fd) * (size_t)(num_open.rlim_max));
382 msnprintf(strbuff, sizeof(strbuff), fmt, num_open.rlim_max);
400 num_open.rlim_cur = FD_SETSIZE - SAFETY_MARGIN;
401 if(num_open.rlim_max > num_open.rlim_cur) {
411 num_open.rlim_cur = FD_SETSIZE - SAFETY_MARGIN;
413 rl.rlim_cur < num_open.rlim_max;
416 ((unsigned int)fd[rl.rlim_cur] > num_open.rlim_cur)) {
439 msnprintf(strbuff1, sizeof(strbuff1), fmt, num_open.rlim_max);