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