${ARCH_EXT_LIST}
vpx_ports
pthread_h
- sys_mman_h
unistd_h
"
EXPERIMENT_LIST="
*)
case $header in
pthread.h) true;;
- sys/mman.h) true;;
unistd.h) true;;
*) false;;
esac && enable_feature $var
EOF
# check system headers
check_header pthread.h
- check_header sys/mman.h
check_header unistd.h # for sysconf(3) and friends.
check_header vpx/vpx_integer.h -I${source_path} && enable_feature vpx_ports
stats->buf.buf = NULL;
res = (stats->file != NULL);
} else {
-#if USE_POSIX_MMAP
- struct stat stat_buf;
- int fd;
-
- fd = open(fpf, O_RDONLY);
- stats->file = fdopen(fd, "rb");
- fstat(fd, &stat_buf);
- stats->buf.sz = stat_buf.st_size;
- stats->buf.buf = mmap(NULL, stats->buf.sz, PROT_READ, MAP_PRIVATE, fd, 0);
- res = (stats->buf.buf != NULL);
-#else
size_t nbytes;
stats->file = fopen(fpf, "rb");
nbytes = fread(stats->buf.buf, 1, stats->buf.sz, stats->file);
res = (nbytes == stats->buf.sz);
-#endif /* USE_POSIX_MMAP */
}
return res;
void stats_close(stats_io_t *stats, int last_pass) {
if (stats->file) {
if (stats->pass == last_pass) {
-#if USE_POSIX_MMAP
- munmap(stats->buf.buf, stats->buf.sz);
-#else
free(stats->buf.buf);
-#endif /* USE_POSIX_MMAP */
}
fclose(stats->file);