summaryrefslogtreecommitdiff
path: root/LibC/dirent.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-06-03 18:42:40 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-06-03 18:42:40 +0200
commit8af495495b2192f2dd5dd3e13900d508c65dbc51 (patch)
tree90534e985d13efe1339fdbdf4934ae432b48fe87 /LibC/dirent.cpp
parent3fa0b6cd9239d5cf5804be963ef177129d28e72e (diff)
downloadserenity-8af495495b2192f2dd5dd3e13900d508c65dbc51.zip
LibC: Implement dirfd().
Diffstat (limited to 'LibC/dirent.cpp')
-rw-r--r--LibC/dirent.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/LibC/dirent.cpp b/LibC/dirent.cpp
index f9c8d33db1..cf2e8b5498 100644
--- a/LibC/dirent.cpp
+++ b/LibC/dirent.cpp
@@ -1,14 +1,15 @@
+#include <AK/Assertions.h>
+#include <AK/StdLibExtras.h>
+#include <Kernel/Syscall.h>
#include <dirent.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
#include <errno.h>
#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <AK/StdLibExtras.h>
-#include <Kernel/Syscall.h>
+#include <unistd.h>
extern "C" {
@@ -85,5 +86,11 @@ dirent* readdir(DIR* dirp)
return &dirp->cur_ent;
}
+int dirfd(DIR* dirp)
+{
+ ASSERT(dirp);
+ return dirp->fd;
+}
+
}