This function cannot be easily and (more importantly) correctly ported
without cooperation from the libc stdio layer. We already document that
users should be prepared to have the function not available on some
platforms and that they should ideally switch their code to other
more portable and better interfaces.
Instead of making the build fail, and requiring porters to add
exceptions for something that most probably cannot be ported correctly
anyway, simply print a warning and let it build. This will not be a
regression because on those systems libbsd would have never been built
before.
Prompted-by: Jens Finkhaeuser <jens@finkhaeuser.de>
getauxval getentropy getexecname getline \
pstat_getproc sysconf])
AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xyes"])
+AM_CONDITIONAL([HAVE_FOPENCOOKIE], [test "x$ac_cv_func_fopencookie" = "xyes"])
AC_SUBST([MD5_LIBS])
AC_SUBST([LIBBSD_LIBS])
.Fn funopen
function
may not be portable to systems other than
-.Bx .
+.Bx
+and glibc-based (as the libbsd implementation is only provided when the
+system has
+.Fn fopencookie
+available).
.Pp
On
.Fx ,
return fopencookie(cookiewrap, mode, funcswrap);
}
-#elif defined(__MUSL__)
-/*
- * This is unimplementable on musl based systems, and upstream has stated
- * they will not add the needed support to implement it. Just ignore this
- * interface there, as it has never been provided anyway.
- */
#else
-#error "Function funopen() needs to be ported or disabled."
+#warning "Function funopen() is not provided on this platform."
#endif
explicit_bzero \
humanize \
fgetln \
- funopen \
fparseln \
fpurge \
md5 \
vis-openbsd \
# EOL
+if HAVE_FOPENCOOKIE
+check_PROGRAMS += funopen
+endif
+
if HAVE_LIBTESTU01
arc4random_LDADD = $(LDADD) $(TESTU01_LIBS)