diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-12-21 12:34:40 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-12-21 12:34:40 +0000 |
commit | 8a3e5a8b05ad0a7fab63595b6b4eafec56f63f89 (patch) | |
tree | 8aaf51a5fe4664a7934afa68c14c391e40b76f47 /src/libstddjb/dir_fd.c | |
parent | b45692fe8638c4faaaedb488402b90971fda18f5 (diff) | |
download | skalibs-8a3e5a8b05ad0a7fab63595b6b4eafec56f63f89.tar.xz |
Add dirfd sysdep, because Solaris sucks
Diffstat (limited to 'src/libstddjb/dir_fd.c')
-rw-r--r-- | src/libstddjb/dir_fd.c | 23 |
1 files changed, 23 insertions, 0 deletions
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 <skalibs/sysdeps.h> +#include <skalibs/nonposix.h> +#include <skalibs/direntry.h> + +#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 |