Lines Matching defs:fd
134 hasGzipMagic(int fd)
137 size_t sz = pread(fd, buf, 2, 0);
143 doGzipLoad(int fd)
147 gzFile fdz = gzdopen(fd, "rb");
156 fd = mkstemp(tmpnam); // repurposing fd variable for output
157 if (fd < 0) {
160 return fd;
173 auto sz = write(fd, p, r);
182 close(fd);
186 return fd; // return fd to decompressed temporary file for mmap()'ing
193 int fd = open(fname.c_str(), O_RDONLY);
194 if (fd < 0) {
199 if (hasGzipMagic(fd)) {
200 fd = doGzipLoad(fd);
201 if (fd < 0) {
207 off_t off = lseek(fd, 0, SEEK_END);
214 fd, 0);
215 close(fd);