diff options
| author | Andreas Oberritter <obi@opendreambox.org> | 2008-03-25 15:48:44 +0000 |
|---|---|---|
| committer | Andreas Oberritter <obi@opendreambox.org> | 2008-03-25 15:48:44 +0000 |
| commit | 2f078db56fe65c0720078c1af9dac3ed6e9c5252 (patch) | |
| tree | 82f6aa7808b9f26bf40c27bf6df7526e0bf16102 /lib/base | |
| parent | 6b252fc01a7668fe251a7392c63a136becc8325b (diff) | |
| download | enigma2-2f078db56fe65c0720078c1af9dac3ed6e9c5252.tar.gz enigma2-2f078db56fe65c0720078c1af9dac3ed6e9c5252.zip | |
adjust ioprio_get/set for kernels which don't define _syscall2/3 (i.e. 2.6.24 and higher)
Diffstat (limited to 'lib/base')
| -rw-r--r-- | lib/base/ioprio.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/base/ioprio.cpp b/lib/base/ioprio.cpp index 63e6ff48..fb257401 100644 --- a/lib/base/ioprio.cpp +++ b/lib/base/ioprio.cpp @@ -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 { |
