summaryrefslogtreecommitdiffstats
path: root/src/basic/missing_syscall.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-10-08 10:46:02 +0200
committerLennart Poettering <lennart@poettering.net>2021-10-11 14:31:34 +0200
commitaab35b1e5907a7ac0a218b4f220c66e6d79eb39a (patch)
tree570f7e51dae4b7a0a9e846fde68dcc3c043df700 /src/basic/missing_syscall.h
parentMerge pull request #20979 from poettering/ac-power-tweak (diff)
downloadsystemd-aab35b1e5907a7ac0a218b4f220c66e6d79eb39a.tar.xz
systemd-aab35b1e5907a7ac0a218b4f220c66e6d79eb39a.zip
missing: add getdents64() syscall wrapper
glibc 2.30 (Aug 2019) added a wrapper for getdents64(). For older versions let's define our own. (This syscall exists since Linux 2.4, hence should be safe to use for us)
Diffstat (limited to '')
-rw-r--r--src/basic/missing_syscall.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h
index 57dae77b53..5e80fa79fd 100644
--- a/src/basic/missing_syscall.h
+++ b/src/basic/missing_syscall.h
@@ -540,3 +540,19 @@ static inline int missing_move_mount(
# define move_mount missing_move_mount
#endif
+
+/* ======================================================================= */
+
+#if !HAVE_GETDENTS64
+
+static inline ssize_t missing_getdents64(int fd, void *buffer, size_t length) {
+# if defined __NR_getdents64 && __NR_getdents64 >= 0
+ return syscall(__NR_getdents64, fd, buffer, length);
+# else
+ errno = ENOSYS;
+ return -1;
+# endif
+}
+
+# define getdents64 missing_getdents64
+#endif