Lines Matching defs:fd

603     int fd[2];
621 if (PerlProc_pipe(fd) < 0)
624 IoIFP(rstio) = PerlIO_fdopen(fd[0], "r"PIPE_OPEN_MODE);
625 IoOFP(wstio) = PerlIO_fdopen(fd[1], "w"PIPE_OPEN_MODE);
633 else PerlLIO_close(fd[0]);
635 else PerlLIO_close(fd[1]);
639 fcntl(fd[0],F_SETFD,fd[0] > PL_maxsysfd); /* ensure close-on-exec */
640 fcntl(fd[1],F_SETFD,fd[1] > PL_maxsysfd); /* ensure close-on-exec */
2284 int fd;
2302 fd = PerlSock_socket(domain, type, protocol);
2303 if (fd < 0)
2305 IoIFP(io) = PerlIO_fdopen(fd, "r"SOCKET_OPEN_MODE); /* stdio gets confused about sockets */
2306 IoOFP(io) = PerlIO_fdopen(fd, "w"SOCKET_OPEN_MODE);
2311 if (!IoIFP(io) && !IoOFP(io)) PerlLIO_close(fd);
2315 fcntl(fd, F_SETFD, fd > PL_maxsysfd); /* ensure close-on-exec */
2339 int fd[2];
2365 if (PerlSock_socketpair(domain, type, protocol, fd) < 0)
2367 IoIFP(io1) = PerlIO_fdopen(fd[0], "r"SOCKET_OPEN_MODE);
2368 IoOFP(io1) = PerlIO_fdopen(fd[0], "w"SOCKET_OPEN_MODE);
2370 IoIFP(io2) = PerlIO_fdopen(fd[1], "r"SOCKET_OPEN_MODE);
2371 IoOFP(io2) = PerlIO_fdopen(fd[1], "w"SOCKET_OPEN_MODE);
2376 if (!IoIFP(io1) && !IoOFP(io1)) PerlLIO_close(fd[0]);
2379 if (!IoIFP(io2) && !IoOFP(io2)) PerlLIO_close(fd[1]);
2383 fcntl(fd[0],F_SETFD,fd[0] > PL_maxsysfd); /* ensure close-on-exec */
2384 fcntl(fd[1],F_SETFD,fd[1] > PL_maxsysfd); /* ensure close-on-exec */
2522 int fd;
2537 fd = PerlSock_accept(PerlIO_fileno(IoIFP(gstio)), (struct sockaddr *) namebuf, &len);
2538 if (fd < 0)
2542 IoIFP(nstio) = PerlIO_fdopen(fd, "r"SOCKET_OPEN_MODE);
2543 IoOFP(nstio) = PerlIO_fdopen(fd, "w"SOCKET_OPEN_MODE);
2548 if (!IoIFP(nstio) && !IoOFP(nstio)) PerlLIO_close(fd);
2552 fcntl(fd, F_SETFD, fd > PL_maxsysfd); /* ensure close-on-exec */
2618 int fd;
2637 fd = PerlIO_fileno(IoIFP(io));
2645 if (PerlSock_getsockopt(fd, lvl, optname, SvPVX(sv), &len) < 0)
2664 if (PerlSock_setsockopt(fd, lvl, optname, buf, len) < 0)
2699 int fd;
2712 fd = PerlIO_fileno(IoIFP(io));
2715 if (PerlSock_getsockname(fd, (struct sockaddr *)SvPVX(sv), &len) < 0)
2719 if (PerlSock_getpeername(fd, (struct sockaddr *)SvPVX(sv), &len) < 0)
3252 int fd;
3267 fd = PerlIO_fileno(IoIFP(GvIOp(gv)));
3269 fd = atoi(tmps);
3272 if (PerlLIO_isatty(fd))
5656 fcntl_emulate_flock(int fd, int operation)
5677 return fcntl(fd, (operation & LOCK_NB) ? F_SETLK : F_SETLKW, &flock);
5713 lockf_emulate_flock(int fd, int operation)
5721 pos = PerlLIO_lseek(fd, (Off_t)0, SEEK_CUR); /* get pos to restore later */
5723 if (PerlLIO_lseek(fd, (Off_t)0, SEEK_SET) < 0)
5733 i = lockf (fd, F_LOCK, 0);
5740 i = lockf (fd, F_TLOCK, 0);
5749 i = lockf (fd, F_ULOCK, 0);
5760 PerlLIO_lseek(fd, pos, SEEK_SET); /* ignore error here */