X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=os%2Fos-hpux.h;h=821c91690b12c8165488c5d2e99170d98a77e1af;hb=d3b70f32bd8aa8c1ed1fff25c9c08b20370e0847;hp=c65fea69db22e1555a88be51a0f1ea0c8f04afc4;hpb=8c9ca2e6fe5a400fcba3a7dd45a33effea8298e0;p=fio.git diff --git a/os/os-hpux.h b/os/os-hpux.h index c65fea69..821c9169 100644 --- a/os/os-hpux.h +++ b/os/os-hpux.h @@ -1,6 +1,8 @@ #ifndef FIO_OS_HPUX_H #define FIO_OS_HPUX_H +#define FIO_OS os_hpux + #include #include #include @@ -8,20 +10,26 @@ #include #include #include -#include +#include #include #include #include #include +#include #include "../file.h" #define FIO_HAVE_POSIXAIO #define FIO_HAVE_ODIRECT #define FIO_USE_GENERIC_RAND +#define FIO_USE_GENERIC_INIT_RANDOM_STATE #define FIO_HAVE_CLOCK_MONOTONIC #define FIO_HAVE_PSHARED_MUTEX #define FIO_HAVE_FADVISE +#define FIO_HAVE_CHARDEV_SIZE +#define FIO_HAVE_FALLOCATE +#define FIO_HAVE_POSIXAIO_FSYNC +#define FIO_HAVE_FDATASYNC #define OS_MAP_ANON MAP_ANONYMOUS #define OS_MSG_DONTWAIT 0 @@ -39,6 +47,20 @@ #define MSG_WAITALL 0x40 #endif +#ifdef LITTLE_ENDIAN +#define FIO_LITTLE_ENDIAN +#else +#define FIO_BIG_ENDIAN +#endif + +#define FIO_USE_GENERIC_SWAP + +#define FIO_OS_HAVE_AIOCB_TYPEDEF +typedef struct aiocb64 os_aiocb_t; + +#define FIO_OS_HAVE_SOCKLEN_T +typedef int fio_socklen_t; + static inline int blockdev_invalidate_cache(struct fio_file *f) { return EINVAL; @@ -46,10 +68,13 @@ static inline int blockdev_invalidate_cache(struct fio_file *f) static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) { - struct capacity cap; + disk_describe_type_ext_t dext; + + if (!ioctl(f->fd, DIOC_DESCRIBE_EXT, &dext)) { + unsigned long long lba; - if (!ioctl(f->fd, SIOC_CAPACITY, &cap) == -1) { - *bytes = cap.lba * cap.blksz; + lba = ((uint64_t) dext.maxsva_high << 32) | dext.maxsva_low; + *bytes = lba * dext.lgblksz; return 0; } @@ -57,6 +82,11 @@ static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) return errno; } +static inline int chardev_size(struct fio_file *f, unsigned long long *bytes) +{ + return blockdev_size(f, bytes); +} + static inline unsigned long long os_phys_mem(void) { unsigned long long ret;