Lines Matching refs:new_fd
441 int new_fd;
444 if ((new_fd = fcntl(fd, F_DUPFD, 3)) == -1) {
448 if (new_fd < 3) {
449 close(new_fd);
453 return new_fd;
458 new_fd = dup(fd);
459 if (new_fd == -1)
463 new_fd = make_nonstd_fd_internals(new_fd, limit - 1);
465 return new_fd;
482 int new_fd = make_nonstd_fd_internals(fd, RECURSION_LIMIT);
483 if (new_fd == -1) {
499 if ((flags = fcntl(new_fd, F_GETFL)) == -1) {
500 close(new_fd);
505 if (fcntl(new_fd, F_SETFL, flags) == -1) {
506 close(new_fd);
514 result = flags = fcntl(new_fd, F_GETFD, 0);
517 result = fcntl( new_fd, F_SETFD, flags );
520 close(new_fd);
524 return new_fd;