Conditionally expose splice(2) and sync_file_range(2) constants.
As in other places, only expose the constants at API levels where
we're also exposing the functions (to cope with "poor man's configure"
where an author assumes the presence of the #define to imply the
availability of the function).
Bug: http://b/63145226
Test: builds
Change-Id: I524f7288513aa6c35479c550e748a619397929b0
diff --git a/libc/include/fcntl.h b/libc/include/fcntl.h
index 652430c..c98022c 100644
--- a/libc/include/fcntl.h
+++ b/libc/include/fcntl.h
@@ -56,14 +56,18 @@
#define O_ASYNC FASYNC
#define O_RSYNC O_SYNC
+#if __ANDROID_API__ >= __ANDROID_API_L__
#define SPLICE_F_MOVE 1
#define SPLICE_F_NONBLOCK 2
#define SPLICE_F_MORE 4
#define SPLICE_F_GIFT 8
+#endif
+#if __ANDROID_API__ >= __ANDROID_API_O__
#define SYNC_FILE_RANGE_WAIT_BEFORE 1
#define SYNC_FILE_RANGE_WRITE 2
#define SYNC_FILE_RANGE_WAIT_AFTER 4
+#endif
int creat(const char*, mode_t);
int creat64(const char*, mode_t) __INTRODUCED_IN(21);