return d;
}
-#if defined(__linux__)
+#ifdef HAVE_SYS_SYSCALL_H
# include <sys/syscall.h>
# if defined(SYS_close_range)
# include <sys/types.h>
# endif
# define HAVE_CLOSE_RANGE 1
# endif /* SYS_close_range */
-#endif /* __linux__ */
+#endif /* HAVE_SYS_SYSCALL_H */
extern void ul_close_all_fds(unsigned int first, unsigned int last);
#ifndef UTIL_LINUX_PIDFD_UTILS
#define UTIL_LINUX_PIDFD_UTILS
-#if defined(__linux__)
+#ifdef HAVE_SYS_SYSCALL_H
# include <sys/syscall.h>
# if defined(SYS_pidfd_send_signal) && defined(SYS_pidfd_open)
# include <sys/types.h>
# define UL_HAVE_PIDFD 1
# endif /* SYS_pidfd_send_signal */
-#endif /* __linux__ */
+#endif /* HAVE_SYS_SYSCALL_H */
#endif /* UTIL_LINUX_PIDFD_UTILS */
#include <errno.h>
#include <string.h>
#include <ctype.h>
+#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
+#endif
#include "cpuset.h"
#include "c.h"
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
-#ifdef __linux__
+#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
#endif
#include "c.h"
#include <errno.h>
#include <getopt.h>
#include <unistd.h>
+#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
+#endif
#include <ctype.h>
#include "nls.h"
# define SCHED_FLAG_UTIL_CLAMP_MAX 0x40
#endif
-#if defined (__linux__)
+#ifdef HAVE_SYS_SYSCALL_H
# include <sys/syscall.h>
#endif
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
+#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
+#endif
#include <time.h>
#include <unistd.h>
#include <inttypes.h>