diff --git a/config/user-aio.h.m4 b/config/user-aio.h.m4 new file mode 100644 index 0000000000..152c094672 --- /dev/null +++ b/config/user-aio.h.m4 @@ -0,0 +1,7 @@ +dnl # +dnl # POSIX specifies as part of realtime extensions, +dnl # and is missing from at least uClibc – force fallbacks there +dnl # +AC_DEFUN([ZFS_AC_CONFIG_USER_AIO_H], [ + ZFS_AC_FIND_SYSTEM_LIBRARY(AIO_H, [], [aio.h], [], [rt], [lio_listio]) +]) diff --git a/config/user-libaio.m4 b/config/user-libaio.m4 index 95c144d76b..8009bd11b3 100644 --- a/config/user-libaio.m4 +++ b/config/user-libaio.m4 @@ -1,5 +1,5 @@ dnl # -dnl # Check for libaio - only used for libaiot test cases. +dnl # Check for libaio - only used for mmap_libaio test cases. dnl # AC_DEFUN([ZFS_AC_CONFIG_USER_LIBAIO], [ ZFS_AC_FIND_SYSTEM_LIBRARY(LIBAIO, [], [libaio.h], [], [aio], [], [user_libaio=yes], [user_libaio=no]) diff --git a/config/user.m4 b/config/user.m4 index 670820b377..f450af47e0 100644 --- a/config/user.m4 +++ b/config/user.m4 @@ -23,6 +23,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [ ZFS_AC_CONFIG_USER_LIBAIO ZFS_AC_CONFIG_USER_LIBATOMIC ZFS_AC_CONFIG_USER_LIBFETCH + ZFS_AC_CONFIG_USER_AIO_H ZFS_AC_CONFIG_USER_CLOCK_GETTIME ZFS_AC_CONFIG_USER_PAM ZFS_AC_CONFIG_USER_RUNSTATEDIR diff --git a/lib/libzutil/zutil_import.c b/lib/libzutil/zutil_import.c index d7547c4249..3744a1c347 100644 --- a/lib/libzutil/zutil_import.c +++ b/lib/libzutil/zutil_import.c @@ -47,7 +47,9 @@ * using our derived config, and record the results. */ +#ifdef HAVE_AIO_H #include +#endif #include #include #include @@ -982,6 +984,9 @@ zpool_read_label_slow(int fd, nvlist_t **config, int *num_labels) int zpool_read_label(int fd, nvlist_t **config, int *num_labels) { +#ifndef HAVE_AIO_H + return (zpool_read_label_slow(fd, config, num_labels)); +#else struct stat64 statbuf; struct aiocb aiocbs[VDEV_LABELS]; struct aiocb *aiocbps[VDEV_LABELS]; @@ -1104,6 +1109,7 @@ zpool_read_label(int fd, nvlist_t **config, int *num_labels) *config = expected_config; return (0); +#endif } /*