EOWNERDEAD, ENOTRECOVERABLE and porting software to DragonFly

David Shao davshao at gmail.com
Tue Aug 10 13:44:40 PDT 2021


>From the definition in sys/errno.h:

+#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 700
+#define        ENOTRECOVERABLE 94              /* State not recoverable */
+#define        EOWNERDEAD      95              /* Previous owner died */
+#endif

But one does not actually define these; instead, it seems to me the expectation
is one defines something like

_XOPEN_SOURCE=700

before including sys/cdefs.h, because of:

/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
#ifdef _XOPEN_SOURCE
#if _XOPEN_SOURCE - 0 >= 700
#define __XSI_VISIBLE           700
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE         200809

A quck grep of dports indicates that the preference seems to be to
patch per file
to define _XOPEN_SOURCE instead of universally defining using something like
CFLAGS+= -D_XOPEN_SOURCE=700

Also internal C++ headers were patched to actually indicate existence
of EOWNERDEAD.

The result can be seen building something like icu, a program that
uses C++ and that
appears to want to use some form of user mutex, use indicated by an
internal header
umutex.h.

Following the above logic, with zero documentation anywhere, the
expectation seems to
be anyone porting to DragonFly a C++ program that at least uses a user
mutex has to
at the minimum grep the source tree for every single file containing
the user mutex header
and then create a custom patch to define _XOPEN_SOURCE=700 for DragonFly.

How is this any sort of reasonable expectation?


More information about the Users mailing list