+ return nrand48(rs->r);
+}
+
+#define FIO_OS_DIRECTIO
+extern int directio(int, int);
+static inline int fio_set_odirect(int fd)
+{
+ if (directio(fd, DIRECTIO_ON) < 0)
+ return errno;
+
+ return 0;
+}
+
+/*
+ * pset binding hooks for fio
+ */
+#define fio_setaffinity(td) \
+ pset_bind((td)->o.cpumask, P_PID, (td)->pid, NULL)
+#define fio_getaffinity(pid, ptr) ({ 0; })
+
+#define fio_cpu_clear(mask, cpu) pset_assign(PS_NONE, (cpu), NULL)
+#define fio_cpu_set(mask, cpu) pset_assign(*(mask), (cpu), NULL)
+
+static inline int fio_cpuset_init(os_cpu_mask_t *mask)
+{
+ int ret;
+
+ if (pset_create(mask) < 0) {
+ ret = errno;
+ return -1;
+ }