LibC: Cleanup syscall macros
This commit is contained in:
@@ -612,16 +612,17 @@ long syscall(long syscall, ...);
|
||||
#include <kernel/API/Syscall.h>
|
||||
#include <errno.h>
|
||||
#define _syscall(...) ({ \
|
||||
long _ret = -ERESTART; \
|
||||
while (_ret == -ERESTART) \
|
||||
long _ret; \
|
||||
do { \
|
||||
_ret = _kas_syscall(__VA_ARGS__); \
|
||||
if (_ret < 0) { \
|
||||
} while (__builtin_expect(_ret == -ERESTART, 0)); \
|
||||
if (__builtin_expect(_ret < 0, 0)) { \
|
||||
errno = -_ret; \
|
||||
_ret = -1; \
|
||||
} \
|
||||
_ret; \
|
||||
})
|
||||
#define syscall _syscall
|
||||
#define syscall(...) _syscall(__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
extern char** environ;
|
||||
|
||||
@@ -270,7 +270,7 @@ long syscall(long syscall, ...)
|
||||
|
||||
return _syscall(syscall, arg1, arg2, arg3, arg4, arg5);
|
||||
}
|
||||
#define syscall _syscall
|
||||
#define syscall(...) _syscall(__VA_ARGS__)
|
||||
|
||||
int close(int fd)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user