mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 18:25:14 +00:00
linux/seccomp.h may not be available, and the seccomp mode might not be
listed in /proc/pid/status, so let's not assume those two things are
present.
v2: add a seccomp.h with all the constants we use from linux/seccomp.h
v3: don't do a compile time check for PTRACE_O_SUSPEND_SECCOMP, just let
ptrace return EINVAL for it; also add a checkskip to skip the
seccomp_strict test if PTRACE_O_SUSPEND_SECCOMP or linux/seccomp.h
aren't present.
v4: use criu check --feature instead of checkskip to check whether the
kernel supports seccomp_suspend
Reported-by: Mr. Jenkins
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
94 lines
1.1 KiB
Makefile
94 lines
1.1 KiB
Makefile
define TCP_REPAIR_TEST
|
|
|
|
#include <netinet/tcp.h>
|
|
|
|
int main(void)
|
|
{
|
|
struct tcp_repair_opt opts;
|
|
opts.opt_code = TCP_NO_QUEUE;
|
|
opts.opt_val = 0;
|
|
|
|
return opts.opt_val;
|
|
}
|
|
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
|
|
|
|
define LIBBSD_DEV_TEST
|
|
#include <bsd/string.h>
|
|
|
|
int main(void)
|
|
{
|
|
return 0;
|
|
}
|
|
endef
|
|
|
|
define STRLCPY_TEST
|
|
|
|
#include <string.h>
|
|
|
|
#ifdef CONFIG_HAS_LIBBSD
|
|
# include <bsd/string.h>
|
|
#endif
|
|
|
|
int main(void)
|
|
{
|
|
return strlcpy(NULL, NULL, 0);
|
|
}
|
|
endef
|
|
|
|
define STRLCAT_TEST
|
|
|
|
#include <string.h>
|
|
|
|
#ifdef CONFIG_HAS_LIBBSD
|
|
# include <bsd/string.h>
|
|
#endif
|
|
|
|
int main(void)
|
|
{
|
|
return strlcat(NULL, NULL, 0);
|
|
}
|
|
endef
|
|
|
|
define PTRACE_PEEKSIGINFO_TEST
|
|
|
|
#include <sys/ptrace.h>
|
|
|
|
int main(void)
|
|
{
|
|
struct ptrace_peeksiginfo_args args = {};
|
|
|
|
return 0;
|
|
}
|
|
|
|
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
|