LibC: Cleanup syscall macros

This commit is contained in:
2026-05-16 16:58:49 +03:00
parent dc1d7e3fae
commit 40dd29b876
2 changed files with 6 additions and 5 deletions

View File

@@ -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;

View File

@@ -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)
{