mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:37:44 +00:00
LibC: Implement dirfd().
This commit is contained in:
parent
3fa0b6cd92
commit
8af495495b
2 changed files with 17 additions and 9 deletions
|
@ -1,14 +1,15 @@
|
||||||
#include <dirent.h>
|
#include <AK/Assertions.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/StdLibExtras.h>
|
#include <AK/StdLibExtras.h>
|
||||||
#include <Kernel/Syscall.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" {
|
extern "C" {
|
||||||
|
|
||||||
|
@ -85,5 +86,11 @@ dirent* readdir(DIR* dirp)
|
||||||
return &dirp->cur_ent;
|
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);
|
DIR* opendir(const char* name);
|
||||||
int closedir(DIR*);
|
int closedir(DIR*);
|
||||||
struct dirent* readdir(DIR*);
|
struct dirent* readdir(DIR*);
|
||||||
|
int dirfd(DIR*);
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue