+2023-08-13 Bruno Haible <bruno@clisp.org>
+
+ readutmp, boot-time: Fix compilation error on old Android.
+ Reported by Po Lu in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2023-08/msg00108.html>.
+ * lib/readutmp.c (endutent): New fallback declaration, for Android.
+ (getutent): Remove Ultrix workaround from 2000-04-05.
+ * lib/boot-time.c: Likewise.
+ * m4/readutmp.m4 (gl_PREREQ_READUTMP_H): Test whether endutent is
+ declared, not getutent.
+ * doc/glibc-functions/endutent.texi: Mention the Android bug.
+
2023-08-12 Paul Eggert <eggert@cs.ucla.edu>
boot-time,readutmp: do not depend on c-strtod
@item
This function is missing on some platforms:
macOS 11.1, FreeBSD 13.0, OpenBSD 6.7, Minix 3.1.8, mingw, MSVC 14.
+@item
+This function is not declared on some platforms:
+Android before ca.@: 2015.
@end itemize
# define UT_USER(UT) ((UT)->ut_user)
#endif
-#if !HAVE_UTMPX_H && HAVE_UTMP_H && defined UTMP_NAME_FUNCTION && !HAVE_DECL_GETUTENT
-struct utmp *getutent (void);
+#if !HAVE_UTMPX_H && HAVE_UTMP_H && defined UTMP_NAME_FUNCTION
+# if !HAVE_DECL_ENDUTENT /* Android */
+void endutent (void);
+# endif
#endif
#if defined __linux__ || HAVE_UTMPX_H || HAVE_UTMP_H || defined __CYGWIN__ || defined _WIN32
return false;
}
-# if !HAVE_UTMPX_H && HAVE_UTMP_H && defined UTMP_NAME_FUNCTION && !HAVE_DECL_GETUTENT
-struct utmp *getutent (void);
+#if !HAVE_UTMPX_H && HAVE_UTMP_H && defined UTMP_NAME_FUNCTION
+# if !HAVE_DECL_ENDUTENT /* Android */
+void endutent (void);
# endif
+#endif
static int
read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
-# readutmp.m4 serial 28
+# readutmp.m4 serial 29
dnl Copyright (C) 2002-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
dnl Prerequisites of lib/readutmp.h and lib/readutmp.c.
AC_CHECK_FUNCS_ONCE([utmpname utmpxname])
- AC_CHECK_DECLS([getutent],,,[[
+ AC_CHECK_DECLS([endutent],,,[[
/* <sys/types.h> is a prerequisite of <utmp.h> on FreeBSD 8.0, OpenBSD 4.6. */
#include <sys/types.h>
#ifdef HAVE_UTMP_H