Merge branch 'master' of https://github.com/DevriesL/fio
[fio.git] / os / os-mac.h
index 0b9c870761df96677a90a80f183a1c850fec2a36..ec2cc1e555f43c2bc5afce2cc35396ebd7adfc1d 100644 (file)
 #define fio_swap32(x)  OSSwapInt32(x)
 #define fio_swap64(x)  OSSwapInt64(x)
 
-/*
- * OSX has a pitifully small shared memory segment by default,
- * so default to a lower number of max jobs supported
- */
-#define FIO_MAX_JOBS           128
-
-typedef off_t off64_t;
+#ifdef CONFIG_PTHREAD_GETAFFINITY
+#define FIO_HAVE_GET_THREAD_AFFINITY
+#define fio_get_thread_affinity(mask)  \
+       pthread_getaffinity_np(pthread_self(), sizeof(mask), &(mask))
+#endif
 
 #ifndef CONFIG_CLOCKID_T
 typedef unsigned int clockid_t;
@@ -90,16 +88,12 @@ static inline unsigned long long os_phys_mem(void)
        return mem;
 }
 
+#ifndef CONFIG_HAVE_GETTID
 static inline int gettid(void)
 {
        return mach_thread_self();
 }
-
-/*
- * For some reason, there's no header definition for fdatasync(), even
- * if it exists.
- */
-extern int fdatasync(int fd);
+#endif
 
 static inline bool fio_fallocate(struct fio_file *f, uint64_t offset, uint64_t len)
 {