Lines Matching refs:fd
1261 int fd;
1262 for(fd=0; fd < shp->gd->lim.open_max; fd++)
1263 if((shp->fdstatus[fd]&IOCLEX)&&fd!=shp->infd)
1264 sh_close(fd);
2163 int savein,fd;
2207 fd = sh_redirect(shp,tt->com.comio,3);
2209 if(fd==0)
2210 fd = savein;
2211 iop = sfnew(NULL,NULL,SF_UNBOUND,fd,SF_READ);
2992 tcsetpgrp(job.fd,job.curpgid);
3432 int fd=fcntl(shp->cpipe[1],F_DUPFD,10);
3434 VALIDATE_FD(shp, fd);
3435 if(fd>=10)
3437 shp->fdstatus[fd] = (shp->fdstatus[outfd]&~IOCLEX);
3440 shp->cpipe[1] = fd;
3474 register int i, fd, trace = sh_isoption(SH_XTRACE);
3521 fd = sh_dup(sffileno(sp));
3523 if(fd>9)
3524 *cp++ = '0' + (fd/10);
3525 *cp++ = '0' + fd%10;
3532 close(fd);
3626 int fd = shp->inpipe[1];
3629 VALIDATE_FD(shp, fd);
3630 if(fd>=0 && (!(otype&FPOU) || (otype&FCOOP)) && fcntl(fd,F_SETFD,FD_CLOEXEC)>=0)
3631 shp->fdstatus[fd] |= IOCLEX;
3699 while(tcsetpgrp(job.fd,job.curpgid)<0 && job.curpgid!=spawnpid)
3795 int fd = open(path,O_RDONLY);
3798 if(fd>=0)
3801 sfprintf(shp->strbuf,"/dev/fd/%d",fd);
3808 if(fd>=0)
3809 close(fd);
3854 while(tcsetpgrp(job.fd,job.curpgid)<0 && job.curpgid!=spawnpid)