- [AC_MSG_ERROR(missing required O_NOFOLLOW flag in fcntl.h)],
- [[#include <fcntl.h>]])
+ [AC_MSG_ERROR(missing required O_NOFOLLOW flag in fcntl.h)],
+ [[#include <fcntl.h>]])
+AC_CHECK_DECLS([O_PATH],
+ [],
+ [AC_MSG_ERROR(missing required O_PATH flag in fcntl.h)],
+ [[#define _GNU_SOURCE
+ #include <fcntl.h>]])
+
+# And check for the GNU/BSD extension asprintf(), which lets us avoid
+# praying to the PATH_MAX gods while constructing long paths.
+AC_CHECK_FUNC(asprintf,
+ [],
+ AC_MSG_ERROR(missing required asprintf function))