2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 21:38:16 +00:00

syscalls: Introduce sys_kcmp syscall

Though we can use libc's syscall() wrapper
I would prefer to have own implementation
in case if we will need it in non-libc bindable
code.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov 2012-02-22 00:37:58 +04:00
parent 7bc585b226
commit cff00de82d
3 changed files with 20 additions and 0 deletions

View File

@ -51,6 +51,7 @@
#define __NR_restart_syscall 219
#define __NR_msync 227
#define __NR_setns 308
#define __NR_kcmp 312
#else /* CONFIG_X86_64 */
# error x86-32 bit mode not yet implemented

View File

@ -391,6 +391,12 @@ static void sys_set_tid_address(int *tid_addr) {
syscall1(__NR_set_tid_address, (long) tid_addr);
}
static long always_inline
sys_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2)
{
return syscall5(__NR_kcmp, (long)pid1, (long)pid2, (long)type, idx1, idx2);
}
#ifndef CLONE_NEWUTS
#define CLONE_NEWUTS 0x04000000
#endif

View File

@ -182,4 +182,17 @@ typedef struct {
# define PAGE_SIZE 4096
#endif
/* For sys_kcmp */
enum kcmp_type {
KCMP_FILE,
KCMP_VM,
KCMP_FILES,
KCMP_FS,
KCMP_SIGHAND,
KCMP_IO,
KCMP_SYSVSEM,
KCMP_TYPES,
};
#endif /* CR_TYPES_H_ */