aboutsummaryrefslogtreecommitdiff
path: root/tests/chapters/shim/file.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/chapters/shim/file.h')
-rw-r--r--tests/chapters/shim/file.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/chapters/shim/file.h b/tests/chapters/shim/file.h
new file mode 100644
index 0000000..7601b39
--- /dev/null
+++ b/tests/chapters/shim/file.h
@@ -0,0 +1,5 @@
+#pragma once
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
+static inline off_t ffilesize(int fd){ struct stat st; return fstat(fd,&st)?-1:st.st_size; }