Add comment in os/os-linux.h wrt glibc-2.3.2
authorJens Axboe <jens.axboe@oracle.com>
Tue, 22 May 2007 15:06:24 +0000 (17:06 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 22 May 2007 15:06:24 +0000 (17:06 +0200)
It was a broken release wrt cpu affinity, they removed the
size argument from the set/get functions. If you want to
compile on such an ancient glibc, manually define GLIBC_2_3_2.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
os/os-linux.h

index 7fa0c9566a6d4e24405b93563f3958b87dd639bb..dfb6eb987d97b9ff3844dc0c2e684ccc8bb749bf 100644 (file)
@@ -35,10 +35,21 @@ typedef struct drand48_data os_random_state_t;
 #define fadvise(fd, off, len, advice)  \
        posix_fadvise((fd), (off_t)(off), (len), (advice))
 
+/*
+ * If you are on an ancient glibc (2.3.2), then define GLIBC_2_3_2 if you want
+ * the affinity helpers to work.
+ */
+#ifndef GLIBC_2_3_2
 #define fio_setaffinity(td)            \
        sched_setaffinity((td)->pid, sizeof((td)->o.cpumask), &(td)->o.cpumask)
 #define fio_getaffinity(pid, ptr)      \
        sched_getaffinity((pid), sizeof(cpu_set_t), (ptr))
+#else
+#define fio_setaffinity(td)            \
+       sched_setaffinity((td)->pid, &(td)->o.cpumask)
+#define fio_getaffinity(pid, ptr)      \
+       sched_getaffinity((pid), (ptr))
+#endif
 
 static inline int ioprio_set(int which, int who, int ioprio)
 {