Lines Matching refs:fd
537 register int fd= -1;
554 if((fd = sh_open(path_relative(shp,stakptr(PATH_OFFSET)),O_RDONLY,0)) >= 0)
556 if(fstat(fd,&statb)<0 || S_ISDIR(statb.st_mode))
559 sh_close(fd);
560 fd = -1;
564 while( fd<0 && pp);
565 if(fd>=0 && (fd = sh_iomovefd(fd)) > 0)
567 fcntl(fd,F_SETFD,FD_CLOEXEC);
568 VALIDATE_FD(shp, fd);
569 shp->fdstatus[fd] |= IOCLEX;
571 return(fd);
901 register int fd=0;
905 if((fd=open(path,O_RDONLY,0))<0 || fstat(fd,&statb)<0)
936 return(fd);
937 if(isfun && fd>=0)
938 sh_close(fd);
1372 int fd;
1381 fd = open( SHACCT , O_WRONLY | O_APPEND | O_CREAT,RW_ALL);
1382 write(fd, (const char*)&sabuf, sizeof( sabuf ));
1383 close( fd);
1476 int k,m,n,fd;
1482 if((fd=open(stakptr(offset),O_RDONLY))>=0)
1484 fstat(fd,&statb);
1489 n=read(fd,cp=sp,n);
1491 close(fd);