1*49cdfc7eSAndroid Build Coastguard Worker // SPDX-License-Identifier: GPL-2.0-or-later
2*49cdfc7eSAndroid Build Coastguard Worker /*
3*49cdfc7eSAndroid Build Coastguard Worker * Copyright (c) 2015 Cedric Hnyda <[email protected]>
4*49cdfc7eSAndroid Build Coastguard Worker */
5*49cdfc7eSAndroid Build Coastguard Worker
6*49cdfc7eSAndroid Build Coastguard Worker #ifndef LAPI_KCMP_H__
7*49cdfc7eSAndroid Build Coastguard Worker #define LAPI_KCMP_H__
8*49cdfc7eSAndroid Build Coastguard Worker
9*49cdfc7eSAndroid Build Coastguard Worker #include <sys/types.h>
10*49cdfc7eSAndroid Build Coastguard Worker #include "config.h"
11*49cdfc7eSAndroid Build Coastguard Worker #include "lapi/syscalls.h"
12*49cdfc7eSAndroid Build Coastguard Worker
13*49cdfc7eSAndroid Build Coastguard Worker #ifndef HAVE_ENUM_KCMP_TYPE
14*49cdfc7eSAndroid Build Coastguard Worker
15*49cdfc7eSAndroid Build Coastguard Worker enum kcmp_type {
16*49cdfc7eSAndroid Build Coastguard Worker KCMP_FILE,
17*49cdfc7eSAndroid Build Coastguard Worker KCMP_VM,
18*49cdfc7eSAndroid Build Coastguard Worker KCMP_FILES,
19*49cdfc7eSAndroid Build Coastguard Worker KCMP_FS,
20*49cdfc7eSAndroid Build Coastguard Worker KCMP_SIGHAND,
21*49cdfc7eSAndroid Build Coastguard Worker KCMP_IO,
22*49cdfc7eSAndroid Build Coastguard Worker KCMP_SYSVSEM,
23*49cdfc7eSAndroid Build Coastguard Worker KCMP_TYPES,
24*49cdfc7eSAndroid Build Coastguard Worker };
25*49cdfc7eSAndroid Build Coastguard Worker
26*49cdfc7eSAndroid Build Coastguard Worker #else
27*49cdfc7eSAndroid Build Coastguard Worker
28*49cdfc7eSAndroid Build Coastguard Worker # include <linux/kcmp.h>
29*49cdfc7eSAndroid Build Coastguard Worker
30*49cdfc7eSAndroid Build Coastguard Worker #endif
31*49cdfc7eSAndroid Build Coastguard Worker
32*49cdfc7eSAndroid Build Coastguard Worker #ifndef HAVE_KCMP
33*49cdfc7eSAndroid Build Coastguard Worker
kcmp(int pid1,int pid2,int type,int fd1,int fd2)34*49cdfc7eSAndroid Build Coastguard Worker static inline int kcmp(int pid1, int pid2, int type, int fd1, int fd2)
35*49cdfc7eSAndroid Build Coastguard Worker {
36*49cdfc7eSAndroid Build Coastguard Worker return tst_syscall(__NR_kcmp, pid1, pid2, type, fd1, fd2);
37*49cdfc7eSAndroid Build Coastguard Worker }
38*49cdfc7eSAndroid Build Coastguard Worker
39*49cdfc7eSAndroid Build Coastguard Worker #endif
40*49cdfc7eSAndroid Build Coastguard Worker
41*49cdfc7eSAndroid Build Coastguard Worker #endif /* LAPI_KCMP_H__ */
42