Lines Matching refs:fd
33 static void* zend_elf_read_sect(int fd, zend_elf_sectheader *sect) in zend_elf_read_sect() argument
37 if (lseek(fd, sect->ofs, SEEK_SET) < 0) { in zend_elf_read_sect()
41 if (read(fd, s, sect->size) != (ssize_t)sect->size) { in zend_elf_read_sect()
55 int fd = open("/proc/self/exe", O_RDONLY); in zend_elf_load_symbols() local
57 int fd = open("/proc/curproc/exe", O_RDONLY); in zend_elf_load_symbols() local
65 int fd = open(path, O_RDONLY); in zend_elf_load_symbols() local
67 int fd = open("/proc/self/path/a.out", O_RDONLY); in zend_elf_load_symbols() local
75 int fd = open(path, O_RDONLY); in zend_elf_load_symbols() local
79 int fd = -1; in zend_elf_load_symbols() local
82 if (fd >= 0) { in zend_elf_load_symbols()
83 if (read(fd, &hdr, sizeof(hdr)) == sizeof(hdr) in zend_elf_load_symbols()
88 && lseek(fd, hdr.shofs, SEEK_SET) >= 0) { in zend_elf_load_symbols()
90 if (read(fd, §, sizeof(sect)) == sizeof(sect) in zend_elf_load_symbols()
93 zend_elf_symbol *syms = zend_elf_read_sect(fd, §); in zend_elf_load_symbols()
97 if (lseek(fd, hdr.shofs + sect.link * sizeof(sect), SEEK_SET) >= 0 in zend_elf_load_symbols()
98 && read(fd, §, sizeof(sect)) == sizeof(sect) in zend_elf_load_symbols()
99 && (str_tbl = (char*)zend_elf_read_sect(fd, §)) != NULL) { in zend_elf_load_symbols()
113 if (lseek(fd, hdr.shofs + (i + 1) * sizeof(sect), SEEK_SET) < 0) { in zend_elf_load_symbols()
119 close(fd); in zend_elf_load_symbols()