libclues
Linux C++ Tracing Library
Loading...
Searching...
No Matches
arch.hxx
1// Linux
2#include <sys/syscall.h>
3
4// cosmos
5#include <cosmos/compiler.hxx>
6
7/*
8 * this header contains preprocessor defines to help with conditional
9 * compilation of system calls only present certain architectures.
10 */
11
12#ifdef COSMOS_X86
13# define CLUES_HAVE_ARCH_PRCTL
14# define CLUES_HAVE_LEGACY_GETDENTS
15/* aarch64 only has openat() anymore */
16# define CLUES_HAVE_OPEN
17#endif
18
19/*
20 * presence of fork() depends not only on the ABI/arch but also on the kernel
21 * configuration CONFIG_COMPAT and the present userspace headers.
22 */
23#ifdef SYS_fork
24# define CLUES_HAVE_FORK
25#endif
26
27/* aarch64 only has statx() and newfstatat() instead of stat() and lstat() */
28#ifdef SYS_stat
29# define CLUES_HAVE_STAT
30#endif
31
32#ifdef SYS_lstat
33# define CLUES_HAVE_LSTAT
34#endif
35
36/* aarch64 only has faccessat() & friends */
37#ifdef SYS_access
38# define CLUES_HAVE_ACCESS
39#endif
40
41/* aarch64 only comes with pipe2() */
42#ifdef SYS_pipe
43# define CLUES_HAVE_PIPE1
44#endif
45
46/* aarch64 only comes with setitimer */
47#ifdef SYS_alarm
48# define CLUES_HAVE_ALARM
49#endif