X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=os%2Fos-solaris.h;h=c0d3c30f82ba2e93b458d96bb1c5d9ef238eafd8;hp=f8ce1f31cf3d4b610f898b9da3eedc873190257d;hb=e97c14423a5688d7adfb342c16363c263cb741f9;hpb=c36d16f5a0b9e3d505c9933bbbdccdb519ca4faf diff --git a/os/os-solaris.h b/os/os-solaris.h index f8ce1f31..c0d3c30f 100644 --- a/os/os-solaris.h +++ b/os/os-solaris.h @@ -6,15 +6,20 @@ #include #include #include +#include +#include + +#include "../file.h" #define FIO_HAVE_POSIXAIO #define FIO_HAVE_SOLARISAIO -#define FIO_HAVE_FALLOCATE #define FIO_HAVE_POSIXAIO_FSYNC #define FIO_HAVE_CPU_AFFINITY #define FIO_HAVE_PSHARED_MUTEX -#define FIO_USE_GENERIC_BDEV_SIZE #define FIO_HAVE_FDATASYNC +#define FIO_HAVE_CHARDEV_SIZE +#define FIO_USE_GENERIC_BDEV_SIZE +#define FIO_HAVE_GETTID #define OS_MAP_ANON MAP_ANON #define OS_RAND_MAX 2147483648UL @@ -23,12 +28,32 @@ struct solaris_rand_seed { unsigned short r[3]; }; +#ifndef POSIX_MADV_SEQUENTIAL +#define posix_madvise madvise +#define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL +#define POSIX_MADV_DONTNEED MADV_DONTNEED +#define POSIX_MADV_RANDOM MADV_RANDOM +#endif + typedef psetid_t os_cpu_mask_t; typedef struct solaris_rand_seed os_random_state_t; -static inline int blockdev_invalidate_cache(int fd) +static inline int chardev_size(struct fio_file *f, unsigned long long *bytes) { - return EINVAL; + struct dk_minfo info; + + *bytes = 0; + + if (ioctl(f->fd, DKIOCGMEDIAINFO, &info) < 0) + return errno; + + *bytes = info.dki_lbsize * info.dki_capacity; + return 0; +} + +static inline int blockdev_invalidate_cache(struct fio_file *f) +{ + return 0; } static inline unsigned long long os_phys_mem(void) @@ -95,6 +120,11 @@ static inline int fio_cpuset_exit(os_cpu_mask_t *mask) return 0; } +static inline int gettid(void) +{ + return pthread_self(); +} + /* * Should be enough, not aware of what (if any) restrictions Solaris has */