X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=os%2Fos-solaris.h;h=175654e84bf49864c7dab08e3ad8906b45b8ca73;hb=f8ed6d895233a874ce4e119f24d759445dff254d;hp=ff8d6f25d6ca6a02497d7cab081873dad376a6c5;hpb=535313705d69dc16f27ca38acf2f9bf7205e410d;p=fio.git diff --git a/os/os-solaris.h b/os/os-solaris.h index ff8d6f25..175654e8 100644 --- a/os/os-solaris.h +++ b/os/os-solaris.h @@ -2,6 +2,7 @@ #define FIO_OS_SOLARIS_H #include +#include #include #include #include @@ -102,4 +103,17 @@ static inline int fio_cpuset_exit(os_cpu_mask_t *mask) #define FIO_MADV_FREE MADV_FREE #endif +/* + * Some Solaris versions don't have posix_memalign(), provide a private + * weak alternative + */ +static inline int __weak posix_memalign(void **ptr, size_t align, size_t size) +{ + *ptr = memalign(align, size); + if (*ptr) + return 0; + + return ENOMEM; +} + #endif