Lines Matching defs:fd

90     int fd;
113 fd = PerlIO_fileno(IoIFP(io));
118 else if (fd >= 0 && fd <= PL_maxsysfd) {
123 savefd = fd;
131 PerlIO_close(IoIFP(io)); /* clear stdio, fd already closed */
138 if (result == EOF && fd > PL_maxsysfd) {
336 fd = SvUV(*svp);
340 fd = atoi(type);
376 fd = PerlIO_fileno(that_fp);
390 fd = -1;
399 fd = PerlLIO_dup(fd);
402 if (!(fp = PerlIO_openn(aTHX_ type,mode,fd,0,0,NULL,num_svs,svp))) {
404 PerlLIO_close(fd);
561 fd = PerlIO_fileno(fp);
562 /* If there is no fd (e.g. PerlIO::scalar) assume it isn't a
566 if (IoTYPE(io) && IoTYPE(io) != IoTYPE_PIPE && IoTYPE(io) != IoTYPE_STD && fd >= 0) {
567 if (PerlLIO_fstat(fd,&PL_statbuf) < 0) {
568 /* If PerlIO claims to have fd we had better be able to fstat() it. */
587 if (PerlSock_getsockname(fd, (struct sockaddr *)tmpbuf, &buflen) >= 0
598 * and just dup the fd into whatever was on the handle before !
602 /* If fd is less that PL_maxsysfd i.e. STDIN..STDERR
611 if (savefd != fd) {
616 if (PerlLIO_dup2(fd, savefd) < 0) {
624 if (fd == PerlIO_fileno(PerlIO_stdout()))
626 if (fd == PerlIO_fileno(PerlIO_stderr()))
640 sv = *av_fetch(PL_fdpid,fd,TRUE);
652 /* need to close fp without closing underlying fd */
672 fd = PerlIO_fileno(fp);
675 if (fd >= 0) {
677 fcntl(fd,F_SETFD,fd > PL_maxsysfd); /* can change errno */
686 || (IoTYPE(io) == IoTYPE_WRONLY && fd >= 0 && S_ISCHR(PL_statbuf.st_mode)) ) {
691 if (!(IoOFP(io) = PerlIO_openn(aTHX_ type,s,fd,0,0,NULL,0,svp))) {
931 int fd[2];
946 if (PerlProc_pipe(fd) < 0)
948 IoIFP(rstio) = PerlIO_fdopen(fd[0], "r"PIPE_OPEN_MODE);
949 IoOFP(wstio) = PerlIO_fdopen(fd[1], "w"PIPE_OPEN_MODE);
956 else PerlLIO_close(fd[0]);
958 else PerlLIO_close(fd[1]);
1026 PerlIO_close(IoIFP(io)); /* clear stdio, fd already closed */
1209 I32 my_chsize(fd, length)
1210 I32 fd; /* file descriptor */
1216 if (PerlLIO_fstat(fd, &filebuf) < 0)
1223 if ((PerlLIO_lseek(fd, (length - 1), 0)) < 0)
1228 if ((PerlLIO_write(fd, "", 1)) != 1)
1247 if (fcntl(fd, F_FREESP, &fl) < 0)
1421 int fd, int do_report)
1457 PerlLIO_write(fd, (void*)&e, sizeof(int));
1458 PerlLIO_close(fd);
1488 Perl_do_exec3(pTHX_ char *cmd, int fd, int do_report)
1599 PerlLIO_write(fd, (void*)&e, sizeof(int));
1600 PerlLIO_close(fd);