diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-06-03 18:42:40 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-06-03 18:42:40 +0200 |
commit | 8af495495b2192f2dd5dd3e13900d508c65dbc51 (patch) | |
tree | 90534e985d13efe1339fdbdf4934ae432b48fe87 /LibC/dirent.cpp | |
parent | 3fa0b6cd9239d5cf5804be963ef177129d28e72e (diff) | |
download | serenity-8af495495b2192f2dd5dd3e13900d508c65dbc51.zip |
LibC: Implement dirfd().
Diffstat (limited to 'LibC/dirent.cpp')
-rw-r--r-- | LibC/dirent.cpp | 19 |
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; +} + } |