summaryrefslogtreecommitdiffstats
path: root/Compat.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-11-20 17:50:34 +0100
committerBenBE <BenBE@geshi.org>2020-11-28 12:35:34 +0100
commit2ff2859c237a0b4928c28a0086dd2f5fb9b2da70 (patch)
tree27f74d10d90d21fc7732d7e0b0b9bb0a01619a21 /Compat.c
parent638207a2ff91089de7679b4ed20fc0b01116c37c (diff)
Add compat mode for systems without openat(2)
Diffstat (limited to 'Compat.c')
-rw-r--r--Compat.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Compat.c b/Compat.c
index 37e7c042..dfe2151f 100644
--- a/Compat.c
+++ b/Compat.c
@@ -80,6 +80,20 @@ int Compat_fstatat(int dirfd,
#endif
}
+#ifndef HAVE_OPENAT
+
+int Compat_openat(const char* dirpath,
+ const char* pathname,
+ int flags) {
+
+ char path[4096];
+ xSnprintf(path, sizeof(path), "%s/%s", dirpath, pathname);
+
+ return open(path, flags);
+}
+
+#endif /* !HAVE_OPENAT */
+
int Compat_readlinkat(int dirfd,
const char* dirpath,
const char* pathname,

© 2014-2024 Faster IT GmbH | imprint | privacy policy