diff --git a/Makefile.config b/Makefile.config index ce4b8d844..26d581bfa 100644 --- a/Makefile.config +++ b/Makefile.config @@ -41,6 +41,9 @@ endif ifeq ($(call try-cc,$(SETPROCTITLE_INIT_TEST),-lbsd),y) $(Q) @echo '#define CONFIG_HAS_SETPROCTITLE_INIT' >> $@ endif +ifeq ($(call try-cc,$(MEMFD_TEST),),y) + $(Q) @echo '#define CONFIG_HAS_MEMFD' >> $@ +endif ifeq ($(piegen-y),y) $(Q) @echo '#define CONFIG_PIEGEN' >> $@ endif diff --git a/scripts/feature-tests.mak b/scripts/feature-tests.mak index 519eb5269..9a491de45 100644 --- a/scripts/feature-tests.mak +++ b/scripts/feature-tests.mak @@ -92,3 +92,17 @@ int main(int argc, char *argv[], char *envp[]) } endef + +define MEMFD_TEST + +#include +#include + +int main(void) +{ +#ifdef __NR_memfd_create + return 0; +#endif +} + +endef