LibC: add function declarations to sys/stat.h

This commit is contained in:
Bananymous
2023-05-11 01:48:33 +03:00
parent d9be14e1fb
commit 729ff267d7
5 changed files with 26 additions and 9 deletions

View File

@@ -46,8 +46,8 @@ namespace Kernel
BAN::ErrorOr<size_t> write(int fd, const void* buffer, size_t offset, size_t count);
BAN::ErrorOr<void> creat(BAN::StringView name, mode_t);
BAN::ErrorOr<void> fstat(int fd, stat*);
BAN::ErrorOr<void> stat(BAN::StringView path, stat*);
BAN::ErrorOr<void> fstat(int fd, struct stat*);
BAN::ErrorOr<void> stat(BAN::StringView path, struct stat*);
BAN::ErrorOr<void> mount(BAN::StringView source, BAN::StringView target);

View File

@@ -40,7 +40,7 @@ namespace Kernel
int fd = TRY(Process::current().open(path, O_RDONLY));
BAN::ScopeGuard _([fd] { MUST(Process::current().close(fd)); });
stat st;
struct stat st;
TRY(Process::current().fstat(fd, &st));
BAN::Vector<uint8_t> file_data;

View File

@@ -522,7 +522,7 @@ argument_done:
TRY(entry_prefix.push_back('/'));
for (const auto& entry : all_entries)
{
stat st;
struct stat st;
BAN::String entry_path;
TRY(entry_path.append(entry_prefix));
@@ -572,7 +572,7 @@ argument_done:
return {};
}
stat st;
struct stat st;
TRY(Process::current().stat(arguments[1], &st));
Inode::Mode mode { st.st_mode };