adjust ioprio_get/set for kernels which don't define _syscall2/3 (i.e. 2.6.24 and...
authorAndreas Oberritter <obi@opendreambox.org>
Tue, 25 Mar 2008 15:48:44 +0000 (15:48 +0000)
committerAndreas Oberritter <obi@opendreambox.org>
Tue, 25 Mar 2008 15:48:44 +0000 (15:48 +0000)
lib/base/ioprio.cpp

index 63e6ff48eec08c2bdb3a9e5fcc8b42156e87df1c..fb257401c57434e3ba57aa94185691555fbc2916 100644 (file)
@@ -31,9 +31,25 @@ extern "C" int sys_ioprio_get(int, int);
 #error "Unsupported arch"
 #endif
 
+#if defined(_syscall3) && defined(_syscall2)
+
 _syscall3(int, ioprio_set, int, which, int, who, int, ioprio);
 _syscall2(int, ioprio_get, int, which, int, who);
 
+#else
+
+static inline int ioprio_set(int which, int who, int ioprio)
+{
+       return syscall(__NR_ioprio_set, which, who, ioprio);
+}
+
+static inline int ioprio_get(int which, int who)
+{
+       return syscall(__NR_ioprio_get, which, who);
+}
+
+#endif
+
 #define IOPRIO_CLASS_SHIFT     13
 
 enum {