mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
Add getwd().
This commit is contained in:
parent
7c3746592b
commit
e5e0bffd76
Notes:
sideshowbarker
2024-07-19 18:32:57 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e5e0bffd769
4 changed files with 11 additions and 1 deletions
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
#define PATH_MAX 4096
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
|
||||
#include <endian.h>
|
||||
|
||||
#include <limits.h>
|
||||
|
|
|
@ -156,6 +156,11 @@ char* getcwd(char* buffer, size_t size)
|
|||
__RETURN_WITH_ERRNO(rc, buffer, nullptr);
|
||||
}
|
||||
|
||||
char* getwd(char* buf)
|
||||
{
|
||||
return getcwd(buf, PATH_MAX);
|
||||
}
|
||||
|
||||
int sleep(unsigned seconds)
|
||||
{
|
||||
return Syscall::invoke(Syscall::SC_sleep, (dword)seconds);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <limits.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
|
@ -29,6 +30,7 @@ int close(int fd);
|
|||
pid_t waitpid(pid_t, int* wstatus, int options);
|
||||
int chdir(const char* path);
|
||||
char* getcwd(char* buffer, size_t size);
|
||||
char* getwd(char* buffer);
|
||||
int lstat(const char* path, struct stat* statbuf);
|
||||
int stat(const char* path, struct stat* statbuf);
|
||||
int sleep(unsigned seconds);
|
||||
|
|
Loading…
Add table
Reference in a new issue