#include <sys/syscall.h>
#include <asm/unistd.h>
-#if defined(__i386__)
-#define __NR_ioprio_set 289
-#define __NR_ioprio_get 290
-#elif defined(__powerpc__) || defined(__powerpc64__)
-#define __NR_ioprio_set 273
-#define __NR_ioprio_get 274
-#elif defined(__x86_64__)
-#define __NR_ioprio_set 251
-#define __NR_ioprio_get 252
-#elif defined(__ia64__)
-#define __NR_ioprio_set 1274
-#define __NR_ioprio_get 1275
-#elif defined(__alpha__)
-#define __NR_ioprio_set 442
-#define __NR_ioprio_get 443
-#elif defined(__s390x__) || defined(__s390__)
-#define __NR_ioprio_set 282
-#define __NR_ioprio_get 283
-#elif defined(__sparc__)
-#define __NR_ioprio_set 196
-#define __NR_ioprio_get 218
-#else
-#error "Unsupported arch"
-#endif
+#if !defined(SYS_ioprio_get) || !defined(SYS_ioprio_set)
+
+# if defined(__i386__)
+# define __NR_ioprio_set 289
+# define __NR_ioprio_get 290
+# elif defined(__powerpc__) || defined(__powerpc64__)
+# define __NR_ioprio_set 273
+# define __NR_ioprio_get 274
+# elif defined(__x86_64__)
+# define __NR_ioprio_set 251
+# define __NR_ioprio_get 252
+# elif defined(__ia64__)
+# define __NR_ioprio_set 1274
+# define __NR_ioprio_get 1275
+# elif defined(__alpha__)
+# define __NR_ioprio_set 442
+# define __NR_ioprio_get 443
+# elif defined(__s390x__) || defined(__s390__)
+# define __NR_ioprio_set 282
+# define __NR_ioprio_get 283
+# elif defined(__sparc__) || defined(__sparc64__)
+# define __NR_ioprio_set 196
+# define __NR_ioprio_get 218
+# else
+# error "Unsupported arch"
+# endif
+
+# define SYS_ioprio_get __NR_ioprio_get
+# define SYS_ioprio_set __NR_ioprio_set
+
+#endif /* !SYS_ioprio_get */
static inline int ioprio_set(int which, int who, int ioprio)
{
- return syscall(__NR_ioprio_set, which, who, ioprio);
+ return syscall(SYS_ioprio_set, which, who, ioprio);
}
static inline int ioprio_get(int which, int who)
{
- return syscall(__NR_ioprio_get, which, who);
+ return syscall(SYS_ioprio_get, which, who);
}
enum {