Lines Matching defs:fd
68 int fd;
101 if ((ef->fd = open(filename, O_RDONLY)) == -1)
105 close(ef->fd);
108 bytes_read = read(ef->fd, ef->firstpage, PAGE_SIZE);
137 if (ef->fd != -1) {
138 close(ef->fd);
139 ef->fd = -1;
166 ef.fd = -1;
286 if (ef.fd != -1)
287 close(ef.fd);
292 * With the file (fd) open on the image, and (ehdr) containing
438 if (kern_pread(ef->fd, phdr[i].p_paddr + off + fpcopy,
446 if (kern_pread(ef->fd, phdr[i].p_vaddr + off + fpcopy,
510 shdr = alloc_pread(ef->fd, ehdr->e_shoff, chunk);
525 shstr = alloc_pread(ef->fd, shdr[ehdr->e_shstrndx].sh_offset, chunk);
606 if (lseek(ef->fd, (off_t)shdr[i].sh_offset, SEEK_SET) == -1) {
612 result = archsw.arch_readin(ef->fd, lastaddr, shdr[i].sh_size);
789 ef.fd = -1;
803 shdr = alloc_pread(ef.fd, ef.ehdr->e_shoff, size);
810 shstrtab = alloc_pread(ef.fd, shdr[ef.ehdr->e_shstrndx].sh_offset,
839 err = kern_pread(ef.fd, dest, sh_meta->sh_size, sh_meta->sh_offset);
850 err = kern_pread(ef.fd, dest, sh_data[0]->sh_size,
865 err = kern_pread(ef.fd, dest, sh_data[1]->sh_size,
887 if (ef.fd != -1)
888 close(ef.fd);