]>
Commit | Line | Data |
---|---|---|
84980ee0 RN |
1 | dnl # |
2 | dnl # 6.8.x replaced strlcpy with strscpy. Check for both so we can provide | |
3 | dnl # appropriate fallbacks. | |
4 | dnl # | |
5 | AC_DEFUN([ZFS_AC_KERNEL_SRC_STRLCPY], [ | |
6 | ZFS_LINUX_TEST_SRC([kernel_has_strlcpy], [ | |
7 | #include <linux/string.h> | |
8 | ], [ | |
9 | const char *src = "goodbye"; | |
10 | char dst[32]; | |
11 | size_t len; | |
12 | len = strlcpy(dst, src, sizeof (dst)); | |
13 | ]) | |
14 | ]) | |
15 | ||
16 | AC_DEFUN([ZFS_AC_KERNEL_SRC_STRSCPY], [ | |
17 | ZFS_LINUX_TEST_SRC([kernel_has_strscpy], [ | |
18 | #include <linux/string.h> | |
19 | ], [ | |
20 | const char *src = "goodbye"; | |
21 | char dst[32]; | |
22 | ssize_t len; | |
23 | len = strscpy(dst, src, sizeof (dst)); | |
24 | ]) | |
25 | ]) | |
26 | ||
27 | AC_DEFUN([ZFS_AC_KERNEL_STRLCPY], [ | |
28 | AC_MSG_CHECKING([whether strlcpy() exists]) | |
29 | ZFS_LINUX_TEST_RESULT([kernel_has_strlcpy], [ | |
30 | AC_MSG_RESULT([yes]) | |
31 | AC_DEFINE(HAVE_KERNEL_STRLCPY, 1, | |
32 | [strlcpy() exists]) | |
33 | ], [ | |
34 | AC_MSG_RESULT([no]) | |
35 | ]) | |
36 | ]) | |
37 | ||
38 | AC_DEFUN([ZFS_AC_KERNEL_STRSCPY], [ | |
39 | AC_MSG_CHECKING([whether strscpy() exists]) | |
40 | ZFS_LINUX_TEST_RESULT([kernel_has_strscpy], [ | |
41 | AC_MSG_RESULT([yes]) | |
42 | AC_DEFINE(HAVE_KERNEL_STRSCPY, 1, | |
43 | [strscpy() exists]) | |
44 | ], [ | |
45 | AC_MSG_RESULT([no]) | |
46 | ]) | |
47 | ]) |