projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'doc-Clarify_Runtime_Param' of https://github.com/horshack-dpreview/fio
[fio.git]
/
os
/
os.h
diff --git
a/os/os.h
b/os/os.h
index dadcd87bcd9625daad0728ffd2d8ce4bbd473e47..ebaf8af5e2f3f683dabd15249df6dcbd662bae5e 100644
(file)
--- a/
os/os.h
+++ b/
os/os.h
@@
-7,6
+7,7
@@
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>
+#include <errno.h>
#include "../arch/arch.h" /* IWYU pragma: export */
#include "../lib/types.h"
#include "../arch/arch.h" /* IWYU pragma: export */
#include "../lib/types.h"
@@
-32,9
+33,7
@@
typedef enum {
} cpu_features;
/* IWYU pragma: begin_exports */
} 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"
#include "os-linux.h"
#elif defined(__FreeBSD__)
#include "os-freebsd.h"
@@
-58,6
+57,10
@@
typedef enum {
#error "unsupported os"
#endif
#error "unsupported os"
#endif
+#ifndef EDQUOT
+#define EDQUOT EIO
+#endif
+
#ifdef CONFIG_POSIXAIO
#include <aio.h>
#ifndef FIO_OS_HAVE_AIOCB_TYPEDEF
#ifdef CONFIG_POSIXAIO
#include <aio.h>
#ifndef FIO_OS_HAVE_AIOCB_TYPEDEF
@@
-112,8
+115,16
@@
static inline int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu_index)
extern int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu);
#endif
extern int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu);
#endif
+#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
#ifndef FIO_HAVE_IOPRIO
+#define ioprio_value(prioclass, prio) (0)
#define ioprio_set(which, who, 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
#endif
#ifndef FIO_HAVE_ODIRECT
@@
-122,12
+133,6
@@
extern int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu);
#define OS_O_DIRECT O_DIRECT
#endif
#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
#ifndef FIO_HAVE_HUGETLB
#define SHM_HUGETLB 0
#define MAP_HUGETLB 0
@@
-152,10
+157,6
@@
extern int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu);
#define OS_RAND_MAX RAND_MAX
#endif
#define OS_RAND_MAX RAND_MAX
#endif
-#ifndef FIO_HAVE_RAWBIND
-#define fio_lookup_raw(dev, majdev, mindev) 1
-#endif
-
#ifndef FIO_PREFERRED_ENGINE
#define FIO_PREFERRED_ENGINE "psync"
#endif
#ifndef FIO_PREFERRED_ENGINE
#define FIO_PREFERRED_ENGINE "psync"
#endif
@@
-172,10
+173,6
@@
extern int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu);
#endif
#endif
#endif
#endif
-#ifndef FIO_MAX_JOBS
-#define FIO_MAX_JOBS 4096
-#endif
-
#ifndef CONFIG_SOCKLEN_T
typedef unsigned int socklen_t;
#endif
#ifndef CONFIG_SOCKLEN_T
typedef unsigned int socklen_t;
#endif
@@
-349,10
+346,12
@@
static inline unsigned long long get_fs_free_size(const char *path)
}
#endif
}
#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
}
#endif
@@
-360,7
+359,7
@@
static inline unsigned int cpus_online(void)
#ifdef FIO_HAVE_CPU_AFFINITY
static inline int CPU_COUNT(os_cpu_mask_t *mask)
{
#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++)
int nr_cpus, i;
for (i = 0, nr_cpus = 0; i < max_cpus; i++)
@@
-407,4
+406,17
@@
static inline bool os_cpu_has(cpu_features feature)
}
#endif
}
#endif
+#ifndef FIO_EMULATED_MKDIR_TWO
+# 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
+
+#endif /* FIO_OS_H */