} cpu_features;
/* IWYU pragma: begin_exports */
-#if defined(__ANDROID__)
-#include "os-android.h"
-#elif defined(__linux__)
+#if defined(__linux__)
#include "os-linux.h"
#elif defined(__FreeBSD__)
#include "os-freebsd.h"
#ifndef FIO_HAVE_IOPRIO_CLASS
#define ioprio_value_is_class_rt(prio) (false)
+#define IOPRIO_MIN_PRIO_CLASS 0
+#define IOPRIO_MAX_PRIO_CLASS 0
#endif
#ifndef FIO_HAVE_IOPRIO
#define ioprio_value(prioclass, prio) (0)
#define ioprio_set(which, who, prioclass, prio) (0)
+#define IOPRIO_MIN_PRIO 0
+#define IOPRIO_MAX_PRIO 0
#endif
#ifndef FIO_HAVE_ODIRECT
#define OS_O_DIRECT O_DIRECT
#endif
-#ifdef OS_O_ATOMIC
-#define FIO_O_ATOMIC OS_O_ATOMIC
-#else
-#define FIO_O_ATOMIC 0
-#endif
-
#ifndef FIO_HAVE_HUGETLB
#define SHM_HUGETLB 0
#define MAP_HUGETLB 0
}
#endif
-#ifndef FIO_HAVE_CPU_ONLINE_SYSCONF
-static inline unsigned int cpus_online(void)
+#ifndef FIO_HAVE_CPU_CONF_SYSCONF
+static inline unsigned int cpus_configured(void)
{
- return sysconf(_SC_NPROCESSORS_ONLN);
+ int nr_cpus = sysconf(_SC_NPROCESSORS_CONF);
+
+ return nr_cpus >= 1 ? nr_cpus : 1;
}
#endif
#ifdef FIO_HAVE_CPU_AFFINITY
static inline int CPU_COUNT(os_cpu_mask_t *mask)
{
- int max_cpus = cpus_online();
+ int max_cpus = cpus_configured();
int nr_cpus, i;
for (i = 0, nr_cpus = 0; i < max_cpus; i++)
# define fio_mkdir(path, mode) mkdir(path, mode)
#endif
+#ifdef _SC_CLK_TCK
+static inline void os_clk_tck(long *clk_tck)
+{
+ *clk_tck = sysconf(_SC_CLK_TCK);
+}
+#else
+extern void os_clk_tck(long *clk_tck);
+#endif
+
#endif /* FIO_OS_H */