[systemd-devel] [PATCH] buildsys, missing: include linux/memfd.h if found

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Sun Oct 5 16:07:56 PDT 2014


On Tue, Sep 16, 2014 at 07:10:41PM -0300, Cristian Rodríguez wrote:
> That's in order to get the system 's definitions of memfd API flags
> instead of relying on the locally defined ones.
> ---
>  configure.ac         | 1 +
>  src/shared/missing.h | 4 ++++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index fb16904..5ebe6ae 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -283,6 +283,7 @@ AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
>  AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
>  AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
>  AC_CHECK_HEADERS([linux/btrfs.h], [], [])
> +AC_CHECK_HEADERS_ONCE([linux/memfd.h])
>  
>  # unconditionally pull-in librt with old glibc versions
>  AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
> diff --git a/src/shared/missing.h b/src/shared/missing.h
> index b441149..9da6e71 100644
> --- a/src/shared/missing.h
> +++ b/src/shared/missing.h
> @@ -45,6 +45,10 @@
>  #include <asm/sgidefs.h>
>  #endif
>  
> +#ifdef HAVE_LINUX_MEMFD_H
> +#include <linux/memfd.h>
> +#endif
> +
>  #ifndef RLIMIT_RTTIME
>  #define RLIMIT_RTTIME 15
>  #endif
Hi,

this patch does the reverse of the customary thing: normally we include the headers
in the main part of the code, and  only provide fallbacks in missing.h.

I pushed a patch which includes linux/memfd.h in memfd.c now.

Zbyszek


More information about the systemd-devel mailing list