1 #ifndef __PERF_MUSL_COMPAT_H
2 #define __PERF_MUSL_COMPAT_H
17 /* Change XSI compliant version into GNU extension hackery */
18 #define strerror_r(err, buf, buflen) \
19 (strerror_r(err, buf, buflen) ? NULL : buf)
21 #define _SC_LEVEL1_DCACHE_LINESIZE -1
23 static inline long sysconf_wrap(int name
)
29 case _SC_LEVEL1_DCACHE_LINESIZE
:
30 f
= fopen("/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size", "r");
34 if (fscanf(f
, "%d", &val
) != 1)
44 #define sysconf(_n) sysconf_wrap(_n)
46 static inline int compat_sched_getcpu(void)
51 if (syscall(__NR_getcpu
, &val
))
60 #define sched_getcpu compat_sched_getcpu