Skip to content

Commit bc3f12b

Browse files
config: user: check for <aio.h>
And always zpool_read_label_slow() on non-conformant libcs Reviewed-by: Brian Behlendorf <[email protected]> Co-authored-by: José Luis Salvador Rufo <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13207 Closes #13254
1 parent b61595f commit bc3f12b

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

config/user-aio.h.m4

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dnl #
2+
dnl # POSIX specifies <aio.h> as part of realtime extensions,
3+
dnl # and is missing from at least uClibc – force fallbacks there
4+
dnl #
5+
AC_DEFUN([ZFS_AC_CONFIG_USER_AIO_H], [
6+
ZFS_AC_FIND_SYSTEM_LIBRARY(AIO_H, [], [aio.h], [], [rt], [lio_listio])
7+
])

config/user-libaio.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl #
2-
dnl # Check for libaio - only used for libaiot test cases.
2+
dnl # Check for libaio - only used for mmap_libaio test cases.
33
dnl #
44
AC_DEFUN([ZFS_AC_CONFIG_USER_LIBAIO], [
55
ZFS_AC_FIND_SYSTEM_LIBRARY(LIBAIO, [], [libaio.h], [], [aio], [], [user_libaio=yes], [user_libaio=no])

config/user.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [
2323
ZFS_AC_CONFIG_USER_LIBAIO
2424
ZFS_AC_CONFIG_USER_LIBATOMIC
2525
ZFS_AC_CONFIG_USER_LIBFETCH
26+
ZFS_AC_CONFIG_USER_AIO_H
2627
ZFS_AC_CONFIG_USER_CLOCK_GETTIME
2728
ZFS_AC_CONFIG_USER_PAM
2829
ZFS_AC_CONFIG_USER_RUNSTATEDIR

lib/libzutil/zutil_import.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
* using our derived config, and record the results.
4848
*/
4949

50+
#ifdef HAVE_AIO_H
5051
#include <aio.h>
52+
#endif
5153
#include <ctype.h>
5254
#include <dirent.h>
5355
#include <errno.h>
@@ -982,6 +984,9 @@ zpool_read_label_slow(int fd, nvlist_t **config, int *num_labels)
982984
int
983985
zpool_read_label(int fd, nvlist_t **config, int *num_labels)
984986
{
987+
#ifndef HAVE_AIO_H
988+
return (zpool_read_label_slow(fd, config, num_labels));
989+
#else
985990
struct stat64 statbuf;
986991
struct aiocb aiocbs[VDEV_LABELS];
987992
struct aiocb *aiocbps[VDEV_LABELS];
@@ -1104,6 +1109,7 @@ zpool_read_label(int fd, nvlist_t **config, int *num_labels)
11041109
*config = expected_config;
11051110

11061111
return (0);
1112+
#endif
11071113
}
11081114

11091115
/*

0 commit comments

Comments
 (0)