android: add shm syscalls and fix ioprio definitions
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/arch/arch-x86.h b/arch/arch-x86.h
index 8eea538..69cf60b 100644
--- a/arch/arch-x86.h
+++ b/arch/arch-x86.h
@@ -20,6 +20,12 @@
#define __NR_sys_vmsplice 316
#endif
+#ifndef __NR_shmget
+#define __NR_shmget 29
+#define __NR_shmat 30
+#define __NR_shmctl 31
+#endif
+
#define FIO_HUGE_PAGE 4194304
#define nop __asm__ __volatile__("rep;nop": : :"memory")
diff --git a/os/os-android.h b/os/os-android.h
index 070aa1a..b844982 100644
--- a/os/os-android.h
+++ b/os/os-android.h
@@ -79,11 +79,6 @@
#define SPLICE_DEF_SIZE (64*1024)
-static inline int ioprio_set(int which, int who, int ioprio)
-{
- return syscall(__NR_ioprio_set, which, who, ioprio);
-}
-
enum {
IOPRIO_CLASS_NONE,
IOPRIO_CLASS_RT,
@@ -100,6 +95,18 @@
#define IOPRIO_BITS 16
#define IOPRIO_CLASS_SHIFT 13
+static inline int ioprio_set(int which, int who, int ioprio_class, int ioprio)
+{
+ /*
+ * If no class is set, assume BE
+ */
+ if (!ioprio_class)
+ ioprio_class = IOPRIO_CLASS_BE;
+
+ ioprio |= ioprio_class << IOPRIO_CLASS_SHIFT;
+ return syscall(__NR_ioprio_set, which, who, ioprio);
+}
+
#ifndef BLKGETSIZE64
#define BLKGETSIZE64 _IOR(0x12,114,size_t)
#endif