check if shmat is available to use afl

* Android has sys/shm.h but doesn't have shmat
master
EduardoRFS 2020-07-02 07:07:26 -03:00
parent fb6cfaf74c
commit 8c45f14f0a
4 changed files with 27 additions and 9 deletions

24
configure vendored
View File

@ -12998,13 +12998,6 @@ if test "x$ac_cv_header_stdint_h" = xyes; then :
fi
ac_fn_c_check_header_mongrel "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_shm_h" = xyes; then :
$as_echo "#define HAS_SYS_SHM_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "#include <sys/types.h>
"
if test "x$ac_cv_header_dirent_h" = xyes; then :
@ -15604,6 +15597,23 @@ if test "x$ac_cv_func_getauxval" = xyes; then :
fi
## shmat
ac_fn_c_check_header_mongrel "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_shm_h" = xyes; then :
$as_echo "#define HAS_SYS_SHM_H 1" >>confdefs.h
ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat"
if test "x$ac_cv_func_shmat" = xyes; then :
$as_echo "#define HAS_SHMAT 1" >>confdefs.h
fi
fi
## execvpe
ac_fn_c_check_func "$LINENO" "execvpe" "ac_cv_func_execvpe"

View File

@ -740,7 +740,6 @@ AS_IF([test "x$ac_cv_lib_m_cos" = xyes ], [mathlib="-lm"], [mathlib=""])
AC_CHECK_HEADER([math.h])
AC_CHECK_HEADERS([unistd.h],[AC_DEFINE([HAS_UNISTD])])
AC_CHECK_HEADER([stdint.h],[AC_DEFINE([HAS_STDINT_H])])
AC_CHECK_HEADER([sys/shm.h],[AC_DEFINE([HAS_SYS_SHM_H])])
AC_CHECK_HEADER([dirent.h], [AC_DEFINE([HAS_DIRENT])], [],
[#include <sys/types.h>])
@ -1564,6 +1563,13 @@ AC_CHECK_FUNC([accept4], [AC_DEFINE([HAS_ACCEPT4])])
AC_CHECK_FUNC([getauxval], [AC_DEFINE([HAS_GETAUXVAL])])
## shmat
AC_CHECK_HEADER([sys/shm.h],
[
AC_DEFINE([HAS_SYS_SHM_H])
AC_CHECK_FUNC([shmat], [AC_DEFINE([HAS_SHMAT])])
])
## execvpe
AC_CHECK_FUNC([execvpe], [AC_DEFINE([HAS_EXECVPE])])

View File

@ -15,7 +15,7 @@
/* Runtime support for afl-fuzz */
#include "caml/config.h"
#if !defined(HAS_SYS_SHM_H)
#if !defined(HAS_SYS_SHM_H) || !defined(HAS_SHMAT)
#include "caml/mlvalues.h"

View File

@ -245,6 +245,8 @@
#undef HAS_SYS_SHM_H
#undef HAS_SHMAT
#undef HAS_EXECVPE
#undef HAS_POSIX_SPAWN