summaryrefslogtreecommitdiff
path: root/src/shared/missing.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-07 02:14:14 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-07 02:14:14 +0100
commitf7ad54a301e4ae8dceab54d3ab3934e56c1134ea (patch)
tree1b9d05965d6503704dce71730e04b8a1548a12a8 /src/shared/missing.h
parenta7e07206021c6484a8d33c6ee156ecfb5b90534c (diff)
util: make use of kcmp() to compare fds, if it is available
Diffstat (limited to 'src/shared/missing.h')
-rw-r--r--src/shared/missing.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/missing.h b/src/shared/missing.h
index 5cf179ef00..cdc38b2dd8 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -711,3 +711,13 @@ static inline int renameat2(int oldfd, const char *oldname, int newfd, const cha
#ifndef RENAME_NOREPLACE
#define RENAME_NOREPLACE (1 << 0)
#endif
+
+#if !HAVE_DECL_KCMP
+static inline int kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
+ return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2);
+}
+#endif
+
+#ifndef KCMP_FILE
+#define KCMP_FILE 0
+#endif