X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=os%2Fos-openbsd.h;h=f1bad67165e982c4da1ecc743887ec8e4bbe056c;hb=a87ea1a869595ca57052e7645431a397d3c7d5ac;hp=b4c02c9bf236803227cdb053f35975bb2b6f26d6;hpb=c032d6743ad21cc6702e8ac71afe227e9cd8773c;p=fio.git diff --git a/os/os-openbsd.h b/os/os-openbsd.h index b4c02c9b..f1bad671 100644 --- a/os/os-openbsd.h +++ b/os/os-openbsd.h @@ -20,7 +20,6 @@ #include "../file.h" -#define FIO_USE_GENERIC_RAND #define FIO_USE_GENERIC_INIT_RANDOM_STATE #define FIO_HAVE_FS_STAT #define FIO_HAVE_GETTID @@ -32,11 +31,15 @@ #define PTHREAD_STACK_MIN 4096 #endif -#define fio_swap16(x) bswap16(x) -#define fio_swap32(x) bswap32(x) -#define fio_swap64(x) bswap64(x) +#define fio_swap16(x) swap16(x) +#define fio_swap32(x) swap32(x) +#define fio_swap64(x) swap64(x) -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 static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) { @@ -66,10 +69,12 @@ static inline unsigned long long os_phys_mem(void) return mem; } +#ifndef CONFIG_HAVE_GETTID static inline int gettid(void) { return (int)(intptr_t) pthread_self(); } +#endif static inline unsigned long long get_fs_free_size(const char *path) {