1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 05:27:14 +09:00

LibCore: Implement chdir on Windows

This commit adds a wrapper around chdir in LibCore.

Co-authored-by: Andrew Kaster <andrew@ladybird.org>
This commit is contained in:
R-Goc 2025-05-30 10:44:19 +02:00 committed by Andrew Kaster
parent 0de3a95433
commit 6c8623320f
Notes: github-actions[bot] 2025-06-06 04:02:02 +00:00

View file

@ -126,6 +126,17 @@ ErrorOr<ByteString> getcwd()
return string_cwd;
}
ErrorOr<void> chdir(StringView path)
{
if (path.is_null())
return Error::from_errno(EFAULT);
ByteString path_string = path;
if (::_chdir(path_string.characters()) < 0)
return Error::from_syscall("chdir"sv, errno);
return {};
}
ErrorOr<struct stat> stat(StringView path)
{
if (path.is_null())