mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-05 22:20:24 -08:00
; Update from Gnulib
* lib/boot-time-aux.h (get_linux_uptime): * lib/boot-time.c (UT_USER): * lib/nproc.c (num_processors_ignoring_omp): * lib/readutmp.h (WTMP_FILE): * m4/readutmp.m4 (gl_READUTMP): * m4/stdint.m4: Update from Gnulib.
This commit is contained in:
parent
6412ba2f1a
commit
0e390f54fa
6 changed files with 27 additions and 9 deletions
|
|
@ -65,6 +65,7 @@ get_linux_uptime (struct timespec *p_uptime)
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# if HAVE_DECL_SYSINFO /* not available in Android API < 9 */
|
||||||
/* The sysinfo call returns the uptime with a resolution of 1 sec only. */
|
/* The sysinfo call returns the uptime with a resolution of 1 sec only. */
|
||||||
struct sysinfo info;
|
struct sysinfo info;
|
||||||
if (sysinfo (&info) >= 0)
|
if (sysinfo (&info) >= 0)
|
||||||
|
|
@ -73,6 +74,7 @@ get_linux_uptime (struct timespec *p_uptime)
|
||||||
p_uptime->tv_nsec = 0;
|
p_uptime->tv_nsec = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_SYS_SYSCTL_H && !defined __minix
|
#if HAVE_SYS_SYSCTL_H && !(defined __GLIBC__ && defined __linux__) && !defined __minix
|
||||||
# if HAVE_SYS_PARAM_H
|
# if HAVE_SYS_PARAM_H
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
# endif
|
# endif
|
||||||
|
|
@ -65,8 +65,10 @@
|
||||||
# define UT_USER(UT) ((UT)->ut_user)
|
# define UT_USER(UT) ((UT)->ut_user)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !HAVE_UTMPX_H && HAVE_UTMP_H && defined UTMP_NAME_FUNCTION && !HAVE_DECL_GETUTENT
|
#if !HAVE_UTMPX_H && HAVE_UTMP_H && defined UTMP_NAME_FUNCTION
|
||||||
struct utmp *getutent (void);
|
# if !HAVE_DECL_ENDUTENT /* Android */
|
||||||
|
void endutent (void);
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __linux__ || HAVE_UTMPX_H || HAVE_UTMP_H || defined __CYGWIN__ || defined _WIN32
|
#if defined __linux__ || HAVE_UTMPX_H || HAVE_UTMP_H || defined __CYGWIN__ || defined _WIN32
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_SYS_SYSCTL_H && ! defined __GLIBC__
|
#if HAVE_SYS_SYSCTL_H && !(defined __GLIBC__ && defined __linux__)
|
||||||
# include <sys/sysctl.h>
|
# include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -306,7 +306,7 @@ num_processors_ignoring_omp (enum nproc_query query)
|
||||||
/* Finally, as fallback, use the APIs that don't distinguish between
|
/* Finally, as fallback, use the APIs that don't distinguish between
|
||||||
NPROC_CURRENT and NPROC_ALL. */
|
NPROC_CURRENT and NPROC_ALL. */
|
||||||
|
|
||||||
#if HAVE_SYSCTL && ! defined __GLIBC__ && defined HW_NCPU
|
#if HAVE_SYSCTL && !(defined __GLIBC__ && defined __linux__) && defined HW_NCPU
|
||||||
{ /* This works on macOS, FreeBSD, NetBSD, OpenBSD.
|
{ /* This works on macOS, FreeBSD, NetBSD, OpenBSD.
|
||||||
macOS 10.14 does not allow mib to be const. */
|
macOS 10.14 does not allow mib to be const. */
|
||||||
int nprocs;
|
int nprocs;
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,13 @@ struct utmpx32
|
||||||
# define WTMP_FILE "/etc/wtmp"
|
# define WTMP_FILE "/etc/wtmp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* In early versions of Android, <utmp.h> did not define BOOT_TIME, only
|
||||||
|
USER_PROCESS. We need to use the value that is defined in newer versions
|
||||||
|
of Android. */
|
||||||
|
#if defined __ANDROID__ && !defined BOOT_TIME
|
||||||
|
# define BOOT_TIME 2
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Some platforms, such as OpenBSD, don't have an ut_type field and don't have
|
/* Some platforms, such as OpenBSD, don't have an ut_type field and don't have
|
||||||
the BOOT_TIME and USER_PROCESS macros. But we want to support them in
|
the BOOT_TIME and USER_PROCESS macros. But we want to support them in
|
||||||
'struct gl_utmp'. */
|
'struct gl_utmp'. */
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# readutmp.m4 serial 28
|
# readutmp.m4 serial 30
|
||||||
dnl Copyright (C) 2002-2023 Free Software Foundation, Inc.
|
dnl Copyright (C) 2002-2023 Free Software Foundation, Inc.
|
||||||
dnl This file is free software; the Free Software Foundation
|
dnl This file is free software; the Free Software Foundation
|
||||||
dnl gives unlimited permission to copy and/or distribute it,
|
dnl gives unlimited permission to copy and/or distribute it,
|
||||||
|
|
@ -55,7 +55,7 @@ AC_DEFUN_ONCE([gl_PREREQ_READUTMP_H],
|
||||||
if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
|
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.
|
dnl Prerequisites of lib/readutmp.h and lib/readutmp.c.
|
||||||
AC_CHECK_FUNCS_ONCE([utmpname utmpxname])
|
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. */
|
/* <sys/types.h> is a prerequisite of <utmp.h> on FreeBSD 8.0, OpenBSD 4.6. */
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_UTMP_H
|
#ifdef HAVE_UTMP_H
|
||||||
|
|
@ -103,6 +103,10 @@ AC_INCLUDES_DEFAULT
|
||||||
AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
|
AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_DECLS([sysinfo],,,[[
|
||||||
|
#include <sys/sysinfo.h>
|
||||||
|
]])
|
||||||
|
|
||||||
AC_CHECK_HEADERS_ONCE([sys/param.h])
|
AC_CHECK_HEADERS_ONCE([sys/param.h])
|
||||||
dnl <sys/sysctl.h> requires <sys/param.h> on OpenBSD 4.0.
|
dnl <sys/sysctl.h> requires <sys/param.h> on OpenBSD 4.0.
|
||||||
AC_CHECK_HEADERS([sys/sysctl.h],,,
|
AC_CHECK_HEADERS([sys/sysctl.h],,,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# stdint.m4 serial 61
|
# stdint.m4 serial 62
|
||||||
dnl Copyright (C) 2001-2023 Free Software Foundation, Inc.
|
dnl Copyright (C) 2001-2023 Free Software Foundation, Inc.
|
||||||
dnl This file is free software; the Free Software Foundation
|
dnl This file is free software; the Free Software Foundation
|
||||||
dnl gives unlimited permission to copy and/or distribute it,
|
dnl gives unlimited permission to copy and/or distribute it,
|
||||||
|
|
@ -150,7 +150,10 @@ intmax_t i = INTMAX_MAX;
|
||||||
uintmax_t j = UINTMAX_MAX;
|
uintmax_t j = UINTMAX_MAX;
|
||||||
|
|
||||||
/* Check that SIZE_MAX has the correct type, if possible. */
|
/* Check that SIZE_MAX has the correct type, if possible. */
|
||||||
#if 201112 <= __STDC_VERSION__
|
/* ISO C 11 mandates _Generic, but GCC versions < 4.9 lack it. */
|
||||||
|
#if 201112 <= __STDC_VERSION__ \
|
||||||
|
&& (!defined __GNUC__ || 4 < __GNUC__ + (9 <= __GNUC_MINOR__) \
|
||||||
|
|| defined __clang__)
|
||||||
int k = _Generic (SIZE_MAX, size_t: 0);
|
int k = _Generic (SIZE_MAX, size_t: 0);
|
||||||
#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
|
#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
|
||||||
|| (0x5110 <= __SUNPRO_C && !__STDC__))
|
|| (0x5110 <= __SUNPRO_C && !__STDC__))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue