summaryrefslogtreecommitdiff
path: root/src/libunixonacid
diff options
context:
space:
mode:
Diffstat (limited to 'src/libunixonacid')
-rw-r--r--src/libunixonacid/opendir_at.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libunixonacid/opendir_at.c b/src/libunixonacid/opendir_at.c
new file mode 100644
index 0000000..bee971f
--- /dev/null
+++ b/src/libunixonacid/opendir_at.c
@@ -0,0 +1,15 @@
+/* ISC license. */
+
+#include <skalibs/direntry.h>
+#include <skalibs/djbunix.h>
+#include <skalibs/unix-transactional.h>
+
+DIR *opendir_at (int dfd, char const *name)
+{
+ DIR *dir ;
+ int fd = open_readatb(dfd, name) ;
+ if (fd < 0) return 0 ;
+ dir = fdopendir(fd) ;
+ if (!dir) fd_close(fd) ;
+ return dir ;
+}