Commit fc7c13de authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

make: config -- Add test for prlimit call

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 88b13cff
...@@ -9,6 +9,9 @@ $(CONFIG): scripts/utilities.mak scripts/feature-tests.mak ...@@ -9,6 +9,9 @@ $(CONFIG): scripts/utilities.mak scripts/feature-tests.mak
$(Q) @echo '#define __CR_CONFIG_H__' >> $@ $(Q) @echo '#define __CR_CONFIG_H__' >> $@
ifeq ($(call try-cc,$(TCP_REPAIR_TEST),,),y) ifeq ($(call try-cc,$(TCP_REPAIR_TEST),,),y)
$(Q) @echo '#define CONFIG_HAS_TCP_REPAIR' >> $@ $(Q) @echo '#define CONFIG_HAS_TCP_REPAIR' >> $@
endif
ifeq ($(call try-cc,$(PRLIMIT_TEST),,),y)
$(Q) @echo '#define CONFIG_HAS_PRLIMIT' >> $@
endif endif
$(Q) @echo '#endif /* __CR_CONFIG_H__ */' >> $@ $(Q) @echo '#endif /* __CR_CONFIG_H__ */' >> $@
......
...@@ -11,3 +11,21 @@ int main(void) ...@@ -11,3 +11,21 @@ int main(void)
return opts.opt_val; return opts.opt_val;
} }
endef endef
define PRLIMIT_TEST
#include <stdlib.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
int main(void)
{
struct rlimit limit = {
.rlim_cur = RLIM_INFINITY,
.rlim_max = RLIM_INFINITY,
};
return prlimit(getpid(), RLIMIT_CPU, &limit, NULL);
}
endef
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment