aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libspl
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2019-10-25 13:40:50 -0700
committerBrian Behlendorf <[email protected]>2019-10-25 13:40:50 -0700
commit1952fe0e2552d9b65b2db1e76c1a4a3f5ab0f27e (patch)
tree079221a6e2b8f97336574445cfb437b26e5ef7e1 /lib/libspl
parent68a1b1589ad60f9c07d3299f7068ad29fb47e695 (diff)
Move platform dependent errno aliases
EBADE, EBADR, and ENOANO do not exist on FreeBSD The libspl errno.h is similarly platform dependent. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9498
Diffstat (limited to 'lib/libspl')
-rw-r--r--lib/libspl/include/os/linux/sys/Makefile.am1
-rw-r--r--lib/libspl/include/os/linux/sys/errno.h (renamed from lib/libspl/include/sys/errno.h)11
-rw-r--r--lib/libspl/include/sys/Makefile.am1
3 files changed, 12 insertions, 1 deletions
diff --git a/lib/libspl/include/os/linux/sys/Makefile.am b/lib/libspl/include/os/linux/sys/Makefile.am
index c11732cc1..6b170fa8c 100644
--- a/lib/libspl/include/os/linux/sys/Makefile.am
+++ b/lib/libspl/include/os/linux/sys/Makefile.am
@@ -1,6 +1,7 @@
libspldir = $(includedir)/libspl/sys
libspl_HEADERS = \
$(top_srcdir)/lib/libspl/include/os/linux/sys/byteorder.h \
+ $(top_srcdir)/lib/libspl/include/os/linux/sys/errno.h \
$(top_srcdir)/lib/libspl/include/os/linux/sys/file.h \
$(top_srcdir)/lib/libspl/include/os/linux/sys/mnttab.h \
$(top_srcdir)/lib/libspl/include/os/linux/sys/mount.h \
diff --git a/lib/libspl/include/sys/errno.h b/lib/libspl/include/os/linux/sys/errno.h
index e8bfbe353..30d20ab89 100644
--- a/lib/libspl/include/sys/errno.h
+++ b/lib/libspl/include/os/linux/sys/errno.h
@@ -31,5 +31,16 @@
*/
#ifndef _LIBSPL_SYS_ERRNO_H
#define _LIBSPL_SYS_ERRNO_H
+
#include <errno.h>
+/*
+ * We'll take the unused errnos, 'EBADE' and 'EBADR' (from the Convergent
+ * graveyard) to indicate checksum errors and fragmentation.
+ */
+#define ECKSUM EBADE
+#define EFRAGS EBADR
+
+/* Similar for ENOACTIVE */
+#define ENOTACTIVE ENOANO
+
#endif /* _LIBSPL_SYS_ERRNO_H */
diff --git a/lib/libspl/include/sys/Makefile.am b/lib/libspl/include/sys/Makefile.am
index 54aece129..6855a39d1 100644
--- a/lib/libspl/include/sys/Makefile.am
+++ b/lib/libspl/include/sys/Makefile.am
@@ -11,7 +11,6 @@ libspl_HEADERS = \
$(top_srcdir)/lib/libspl/include/sys/debug.h \
$(top_srcdir)/lib/libspl/include/sys/dkio.h \
$(top_srcdir)/lib/libspl/include/sys/dklabel.h \
- $(top_srcdir)/lib/libspl/include/sys/errno.h \
$(top_srcdir)/lib/libspl/include/sys/feature_tests.h \
$(top_srcdir)/lib/libspl/include/sys/int_limits.h \
$(top_srcdir)/lib/libspl/include/sys/int_types.h \