summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-23 21:09:38 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-23 21:09:38 +0200
commit97f709186b1f18e24b3aada244047d08613523ee (patch)
treecd22f006fa0873bdb96fca55d33a3d78728574f0 /src
parent1ed11ff659f63feecad34daba93718cc7489817c (diff)
parent75b554579b4e962e2c02053129a37611a2dc9133 (diff)
Merge pull request #1365 from floppym/kcmp
Add fallback for kcmp() in case __NR_kcmp is undefined
Diffstat (limited to 'src')
-rw-r--r--src/basic/missing.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/basic/missing.h b/src/basic/missing.h
index 93a7cb9aa0..9811b6b23e 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
@@ -1030,7 +1030,12 @@ static inline int renameat2(int oldfd, const char *oldname, int newfd, const cha
#if !HAVE_DECL_KCMP
static inline int kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
+#if defined(__NR_kcmp)
return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2);
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
}
#endif