1 #ifndef __PERF_MUSL_COMPAT_H
2 #define __PERF_MUSL_COMPAT_H
19 /* Change XSI compliant version into GNU extension hackery */
21 gnu_strerror_r(int err
, char *buf
, size_t buflen
)
23 if (strerror_r(err
, buf
, buflen
))
27 #define strerror_r gnu_strerror_r
29 #define _SC_LEVEL1_DCACHE_LINESIZE -1
31 static inline long sysconf_wrap(int name
)
37 case _SC_LEVEL1_DCACHE_LINESIZE
:
38 f
= fopen("/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size", "r");
42 if (fscanf(f
, "%d", &val
) != 1)
52 #define sysconf(_n) sysconf_wrap(_n)
54 static inline int compat_sched_getcpu(void)
59 if (syscall(__NR_getcpu
, &val
))
68 #define sched_getcpu compat_sched_getcpu