Commit cff00de8 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 7bc585b2
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#define __NR_restart_syscall 219 #define __NR_restart_syscall 219
#define __NR_msync 227 #define __NR_msync 227
#define __NR_setns 308 #define __NR_setns 308
#define __NR_kcmp 312
#else /* CONFIG_X86_64 */ #else /* CONFIG_X86_64 */
# error x86-32 bit mode not yet implemented # error x86-32 bit mode not yet implemented
......
...@@ -391,6 +391,12 @@ static void sys_set_tid_address(int *tid_addr) { ...@@ -391,6 +391,12 @@ static void sys_set_tid_address(int *tid_addr) {
syscall1(__NR_set_tid_address, (long) 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 #ifndef CLONE_NEWUTS
#define CLONE_NEWUTS 0x04000000 #define CLONE_NEWUTS 0x04000000
#endif #endif
......
...@@ -182,4 +182,17 @@ typedef struct { ...@@ -182,4 +182,17 @@ typedef struct {
# define PAGE_SIZE 4096 # define PAGE_SIZE 4096
#endif #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_ */ #endif /* CR_TYPES_H_ */
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