Rework __linux_syscall

This commit is contained in:
Thomas A. 2024-01-01 19:07:20 -08:00
parent 7e2ade452a
commit f5640390d7

View File

@ -26,7 +26,11 @@ struct filter;
#if HAVE_SYS_EVENTFD_H
# include <sys/eventfd.h>
#else
#ifdef DARLING
# define eventfd(a,b) __linux_syscall_2args(SYS_eventfd, (a), (b))
#else // !DARLING
# define eventfd(a,b) syscall(SYS_eventfd, (a), (b))
#endif
static inline int eventfd_write(int fd, uint64_t val) {
if (write(fd, &val, sizeof(val)) < (ssize_t) sizeof(val))
@ -44,7 +48,6 @@ struct filter;
*/
#ifdef DARLING
#include <darling/emulation/base.h>
# define syscall __linux_syscall
#else
# define _GNU_SOURCE
# include <linux/unistd.h>