Lines Matching refs:fd
54 short fd;
64 register int r, flags=0, fd=0;
81 fd = rp->fd;
108 if((fd = shp->cpipe[0])<=0)
127 fd = (int)opt_info.num;
128 if(sh_inuse(shp,fd))
129 fd = -1;
144 if(!((r=shp->fdstatus[fd])&IOREAD) || !(r&(IOSEEK|IONOSEEK)))
145 r = sh_iocheckfd(shp,fd);
146 if(fd<0 || !(r&IOREAD))
156 rp->fd = fd;
173 r=sh_readline(shp,argv,fd,flags,timeout);
175 if(r==0 && (r=(sfeof(shp->sftable[fd])||sferror(shp->sftable[fd]))))
177 if(fd == shp->cpipe[0])
183 sfclrerr(shp->sftable[fd]);
199 * <fd> is the file descriptor
204 int sh_readline(register Shell_t *shp,char **names, int fd, int flags,long timeout)
228 if(!(iop=shp->sftable[fd]) && !(iop=sh_iostream(shp,fd)))
278 if(shp->fdstatus[fd]&IOTTY)
279 tty_raw(fd,1);
315 if(fd==0)
317 if(timeout || (shp->fdstatus[fd]&(IOTTY|IONOSEEK)))
339 if((sfset(iop,SF_SHARE,1)&SF_SHARE) && fd!=0)
721 if(timeout || (shp->fdstatus[fd]&(IOTTY|IONOSEEK)))
728 if((flags>>D_FLAG) && (shp->fdstatus[fd]&IOTTY))
729 tty_cooked(fd);