summaryrefslogtreecommitdiff
path: root/lib/dirent.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dirent.in.h')
-rw-r--r--lib/dirent.in.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/dirent.in.h b/lib/dirent.in.h
index 2e2c5119a11..4666972b150 100644
--- a/lib/dirent.in.h
+++ b/lib/dirent.in.h
@@ -154,7 +154,8 @@ _GL_WARN_ON_USE (closedir, "closedir is not portable - "
/* Return the file descriptor associated with the given directory stream,
or -1 if none exists. */
# if @REPLACE_DIRFD@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+/* On kLIBC, dirfd() is a macro that does not work. Undefine it. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) || defined dirfd
# undef dirfd
# define dirfd rpl_dirfd
# endif