Hash :
430cd900
Author :
Date :
2023-01-19T21:55:15
Fix warnings for functions introduced in Android API level 12. Reported by Po Lu <luangruo@yahoo.com>. * m4/ftruncate.m4 (gl_FUNC_FTRUNCATE): Test for ftruncate using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. * m4/glob.m4 (gl_PREREQ_GLOB): Test for getpwnam_r using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. * m4/nproc.m4 (gl_PREREQ_NPROC): Test for sched_getaffinity using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS. * m4/pread.m4 (gl_FUNC_PREAD): Test for pread using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. * m4/pwrite.m4 (gl_FUNC_PWRITE): Test for pwrite using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. * m4/thread.m4 (gl_THREAD): Test for pthread_atfork using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS. * m4/timegm.m4 (gl_FUNC_TIMEGM): Test for timegm using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. * m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Test for utimensat using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. * m4/utimens.m4 (gl_UTIMENS): Likewise.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
# nproc.m4 serial 6
dnl Copyright (C) 2009-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,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_NPROC],
[
gl_PREREQ_NPROC
])
# Prerequisites of lib/nproc.c.
AC_DEFUN([gl_PREREQ_NPROC],
[
dnl Persuade glibc <sched.h> to declare CPU_SETSIZE, CPU_ISSET etc.
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_CHECK_HEADERS([sys/pstat.h sys/sysmp.h sys/param.h],,,
[AC_INCLUDES_DEFAULT])
dnl <sys/sysctl.h> requires <sys/param.h> on OpenBSD 4.0.
AC_CHECK_HEADERS([sys/sysctl.h],,,
[AC_INCLUDES_DEFAULT
#if HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
])
AC_CHECK_FUNCS([sched_getaffinity_np pstat_getdynamic sysmp sysctl])
gl_CHECK_FUNCS_ANDROID([sched_getaffinity], [[#include <sched.h>]])
dnl Test whether sched_getaffinity has the expected declaration.
dnl glibc 2.3.[0-2]:
dnl int sched_getaffinity (pid_t, unsigned int, unsigned long int *);
dnl glibc 2.3.3:
dnl int sched_getaffinity (pid_t, cpu_set_t *);
dnl glibc >= 2.3.4:
dnl int sched_getaffinity (pid_t, size_t, cpu_set_t *);
if test $ac_cv_func_sched_getaffinity = yes; then
AC_CACHE_CHECK([for glibc compatible sched_getaffinity],
[gl_cv_func_sched_getaffinity3],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <errno.h>
#include <sched.h>]],
[[sched_getaffinity (0, 0, (cpu_set_t *) 0);]])],
[gl_cv_func_sched_getaffinity3=yes],
[gl_cv_func_sched_getaffinity3=no])
])
if test $gl_cv_func_sched_getaffinity3 = yes; then
AC_DEFINE([HAVE_SCHED_GETAFFINITY_LIKE_GLIBC], [1],
[Define to 1 if sched_getaffinity has a glibc compatible declaration.])
fi
fi
])