From 8a3e5a8b05ad0a7fab63595b6b4eafec56f63f89 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 21 Dec 2017 12:34:40 +0000 Subject: Add dirfd sysdep, because Solaris sucks --- src/libstddjb/dir_fd.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/libstddjb/dir_fd.c (limited to 'src/libstddjb') diff --git a/src/libstddjb/dir_fd.c b/src/libstddjb/dir_fd.c new file mode 100644 index 0000000..403853f --- /dev/null +++ b/src/libstddjb/dir_fd.c @@ -0,0 +1,23 @@ +/* ISC license. */ + +#include +#include +#include + +#ifdef SKALIBS_HASDIRFD + +int dir_fd (DIR *dir) +{ + return dirfd(dir) ; +} + +#else + + /* Pokes at the internals of DIR - no choice here */ + +int dir_fd (DIR *dir) +{ + return dir->dd_fd ; +} + +#endif -- cgit v1.2.3