chiark / gitweb /
util: make use of kcmp() to compare fds, if it is available
[elogind.git] / src / shared / missing.h
index 5cf179ef00e74c515d4081b9183a4008b7aa4cd0..cdc38b2dd8945850b9b316c29eabe9af0a176391 100644 (file)
@@ -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