diff options
| -rw-r--r-- | src/nonstd/SYSCALL.c | 4 | ||||
| -rw-r--r-- | src/nonstd/SYSCALL0.c | 2 | ||||
| -rw-r--r-- | src/nonstd/SYSCALL_NOFAIL.c | 2 | ||||
| -rw-r--r-- | src/nonstd/SYSCALL_NUMBER.c | 7 |
4 files changed, 7 insertions, 8 deletions
diff --git a/src/nonstd/SYSCALL.c b/src/nonstd/SYSCALL.c index 4c04ab1b..8f91d870 100644 --- a/src/nonstd/SYSCALL.c +++ b/src/nonstd/SYSCALL.c @@ -1,9 +1,9 @@ #include <nonstd/syscall.h> -#define SYSCALL(_name, _type, ...) +#define SYSCALL(_name, _type, _args) \ static int _scno = -2; \ if (_scno == -2) { _scno = ((syscall_lookup_t)__libc(SYSCALL_LOOKUP))(_name); } \ - _type _ret = __syscall(_scno, __VA_ARGS__); \ + _type _ret = __syscall(_scno, _args); \ if (_ret < 0) { \ errno = -_ret; \ return -1; \ diff --git a/src/nonstd/SYSCALL0.c b/src/nonstd/SYSCALL0.c index c52a944d..c9359035 100644 --- a/src/nonstd/SYSCALL0.c +++ b/src/nonstd/SYSCALL0.c @@ -1,6 +1,6 @@ #include <nonstd/syscall.h> -#define SYSCALL0(_name, _type) +#define SYSCALL0(_name, _type) \ static int _scno = -2; \ if (_scno == -2) { _scno = ((sycall_lookup_t)__libc(LOOKUP))(_name); } \ _type _ret = __syscall(_scno); \ diff --git a/src/nonstd/SYSCALL_NOFAIL.c b/src/nonstd/SYSCALL_NOFAIL.c index 715fde95..e609e76d 100644 --- a/src/nonstd/SYSCALL_NOFAIL.c +++ b/src/nonstd/SYSCALL_NOFAIL.c @@ -1,6 +1,6 @@ #include <nonstd/syscall.h> -#define SYSCALL_NOFAIL(_name) +#define SYSCALL_NOFAIL(_name) \ static int _scno = -2; \ if (_scno == -2) { _scno = __libc(SYSCALL_LOOKUP)(_name); } \ return __libc(SYSCALL)(_scno) diff --git a/src/nonstd/SYSCALL_NUMBER.c b/src/nonstd/SYSCALL_NUMBER.c index f37e4a21..10f2aeeb 100644 --- a/src/nonstd/SYSCALL_NUMBER.c +++ b/src/nonstd/SYSCALL_NUMBER.c @@ -1,8 +1,7 @@ #include <nonstd/syscall.h> -#define SYSCALL_NUMBER(_var, _name, _notfound) long _var = _notfound - - static int _var = -2; do { \ - if (_var == -2) { (_var) = __libc(SYSCALL_LOOKUP)(_name); } \ +#define SYSCALL_NUMBER(_var, _name, _notfound) \ + static long _var = -2; do { \ + if (_var == -2) { (_var) = ((long (*)(char*))__libc(SYSCALL_LOOKUP))(_name); } \ if (_var == -1) { errno = ENOSYS; return (_notfound); } \ } while (0) |
