diff options
| author | Jakob Kaivo <jkk@ung.org> | 2019-02-02 13:12:59 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2019-02-02 13:12:59 -0500 |
| commit | aa2c7727b1ee7b3747681f6b78f9ef0d36beb749 (patch) | |
| tree | 2d637999ffbf3661fa5ef2e6e93bf40bff13672f /nonstd/syscall.h | |
| parent | a4bd7a9c848d024ecb9c2bd9af0facaec728ba30 (diff) | |
trim old nonstd
Diffstat (limited to 'nonstd/syscall.h')
| -rw-r--r-- | nonstd/syscall.h | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/nonstd/syscall.h b/nonstd/syscall.h deleted file mode 100644 index e698f40d..00000000 --- a/nonstd/syscall.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef __NONSTD_SYSCALL_H__ -#define __NONSTD_SYSCALL_H__ - -#include <errno.h> -#include "nonstd/types.h" - -#ifndef ENOSYS -#define ENOSYS 10 -#endif - -#define SCNO(_var, _name, _notfound) static int _var = -2; do { \ - if ((_var) == -2) { (_var) = __libc.syscall_lookup((_name)); } \ - if ((_var) == -1) { errno = ENOSYS; return (_notfound); } \ - } while (0) - -#define SCNOFAIL() static int _scno = -2; \ - if (_scno == -2) { _scno = __libc.syscall_lookup(__func__); } \ - return __libc.syscall(_scno) - -#define SC(_type, ...) static int _scno = -2; \ - if (_scno == -2) { _scno = __libc.syscall_lookup(__func__); } \ - _type _ret = __libc.syscall(_scno, __VA_ARGS__); \ - if (_ret < 0) { \ - errno = -_ret; \ - return -1; \ - } \ - return _ret - -#define SC0(_type) static int _scno = -2; \ - if (_scno == -2) { _scno = __libc.syscall_lookup(__func__); } \ - _type _ret = __libc.syscall(_scno); \ - if (_ret < 0) { \ - errno = -_ret; \ - return -1; \ - } \ - return _ret - -#endif |
