Commit 5e58a5dc authored by Ruslan Kuprieiev's avatar Ruslan Kuprieiev Committed by Pavel Emelyanov

crtools: check for setproctitle_init

Check for setproctitle_init, as old versions of libbsd don't have one.
Reported-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarRuslan Kuprieiev <kupruser@gmail.com>
Acked-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 21445837
......@@ -32,6 +32,9 @@ ifeq ($(call try-cc,$(PTRACE_PEEKSIGINFO_TEST),),y)
endif
ifeq ($(VDSO),y)
$(Q) @echo '#define CONFIG_VDSO' >> $@
endif
ifeq ($(call try-cc,$(SETPROCTITLE_INIT_TEST),-lbsd),y)
$(Q) @echo '#define CONFIG_HAS_SETPROCTITLE_INIT' >> $@
endif
$(Q) @echo '#endif /* __CR_CONFIG_H__ */' >> $@
......
......@@ -4,7 +4,15 @@
#ifdef CONFIG_HAS_LIBBSD
#include <bsd/unistd.h>
#else
/*
* setproctitle_init is in the libbsd since v0.6.0. This macro allows to
* compile criu with libbsd<0.6.0.
*/
#ifndef CONFIG_HAS_SETPROCTITLE_INIT
#define setproctitle_init(argc, argv, envp)
#endif
#define setproctitle(fmt, ...)
#endif
......
......@@ -79,3 +79,16 @@ int main(void)
}
endef
define SETPROCTITLE_INIT_TEST
#include <bsd/unistd.h>
int main(int argc, char *argv[], char *envp[])
{
setproctitle_init(argc, argv, envp);
return 0;
}
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