log: make the logging functions handle > 1024 bytes correctly
[fio.git] / os / os-linux.h
index 911f7e7c8710719d5c6d2d9b094efb096077f0c5..008ce2d0af1c15e78d0bcf19574f5d0ba0a0df02 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/unistd.h>
 #include <linux/raw.h>
 #include <linux/major.h>
+#include <linux/fs.h>
+#include <scsi/sg.h>
 
 #include "./os-linux-syscall.h"
 #include "binject.h"
@@ -258,6 +260,14 @@ static inline int arch_cache_line_size(void)
                return atoi(size);
 }
 
+#ifdef __powerpc64__
+#define FIO_HAVE_CPU_ONLINE_SYSCONF
+static inline unsigned int cpus_online(void)
+{
+        return sysconf(_SC_NPROCESSORS_CONF);
+}
+#endif
+
 static inline unsigned long long get_fs_free_size(const char *path)
 {
        unsigned long long ret;
@@ -314,9 +324,13 @@ static inline int fio_set_sched_idle(void)
 static inline void make_pos_h_l(unsigned long *pos_h, unsigned long *pos_l,
                                off_t offset)
 {
+#if BITS_PER_LONG == 64
+       *pos_l = offset;
+       *pos_h = 0;
+#else
        *pos_l = offset & 0xffffffff;
        *pos_h = ((uint64_t) offset) >> 32;
-
+#endif
 }
 static inline ssize_t preadv2(int fd, const struct iovec *iov, int iovcnt,
                              off_t offset, unsigned int flags)