1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
Description: `ENODATA` is absent in BSD
Evidence exists in various places that BSD systems treat `ENODATA` and
`ENOATTR` as alternatives to each other. See:
* https://mail-index.netbsd.org/tech-kern/2012/04/30/msg013090.html
* https://bugzilla.samba.org/show_bug.cgi?id=5714
* https://lists.freebsd.org/pipermail/freebsd-hackers/2016-May/049494.html
--- a/libutils/include/utils/Errors.h
+++ b/libutils/include/utils/Errors.h
@@ -18,7 +18,7 @@
#define ANDROID_ERRORS_H
#include <sys/types.h>
-#include <errno.h>
+#include <cerrno>
namespace android {
@@ -42,6 +42,10 @@
# undef NO_ERROR
#endif
+#ifdef __FreeBSD_kernel__
+#define ENODATA ENOATTR
+#endif
+
enum {
OK = 0, // Everything's swell.
NO_ERROR = 0, // No errors.
|