Lines Matching refs:fd
22 static int getFileStartAndLength(int fd, off_t *start_, size_t *length_) in getFileStartAndLength() argument
32 start = TEMP_FAILURE_RETRY(lseek(fd, 0L, SEEK_CUR)); in getFileStartAndLength()
33 end = TEMP_FAILURE_RETRY(lseek(fd, 0L, SEEK_END)); in getFileStartAndLength()
35 if (TEMP_FAILURE_RETRY(lseek(fd, start, SEEK_SET)) == -1 || in getFileStartAndLength()
60 static int sysMapFD(int fd, MemMapping* pMap) in sysMapFD() argument
68 if (getFileStartAndLength(fd, &start, &length) < 0) in sysMapFD()
71 memPtr = mmap(NULL, length, PROT_READ, MAP_PRIVATE, fd, start); in sysMapFD()
74 fd, (int) start, strerror(errno)); in sysMapFD()
130 int fd = open(block_dev, O_RDONLY); in sysMapBlockFile() local
131 if (fd < 0) { in sysMapBlockFile()
144 …void* addr = mmap64(next, (end-start)*blksize, PROT_READ, MAP_PRIVATE | MAP_FIXED, fd, ((off64_t)s… in sysMapBlockFile()
183 int fd = open(fn, O_RDONLY, 0); in sysMapFile() local
184 if (fd < 0) { in sysMapFile()
189 if (sysMapFD(fd, pMap) != 0) { in sysMapFile()
191 close(fd); in sysMapFile()
195 close(fd); in sysMapFile()