blob: b5cab01c66d9c4e02159c096ea0c6ffa0e1d57fd (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#include <nonstd/syscall.h>
#define SYSCALL(_name, _type, _err, _a1, _a2, _a3, _a4, _a5, _a6) \
static int _scno = -2; \
if (_scno == -2) { _scno = ((syscall_lookup_t)__libc(SYSCALL_LOOKUP))(_name); } \
long _ret = __syscall(_scno, _a1, _a2, _a3, _a4, _a5, _a6); \
if (_ret < 0) { \
errno = -_ret; \
return _err; \
} \
return (_type)_ret
|