mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibC: Implement dirfd().
This commit is contained in:
parent
3fa0b6cd92
commit
8af495495b
Notes:
sideshowbarker
2024-07-19 13:45:58 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8af495495b2
@ -1,14 +1,15 @@
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <Kernel/Syscall.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -25,5 +25,6 @@ typedef struct __DIR DIR;
|
||||
DIR* opendir(const char* name);
|
||||
int closedir(DIR*);
|
||||
struct dirent* readdir(DIR*);
|
||||
int dirfd(DIR*);
|
||||
|
||||
__END_DECLS
|
||||
|
Loading…
Reference in New Issue
Block a user