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