syscalls: make execve and vfs_read_file_by_path use follow_path, fix vfs_read_file_by_path name, fix execve-related pagefault

This commit is contained in:
2025-10-07 23:41:55 +03:00
parent 8c26f54d28
commit 88c1936e83
5 changed files with 11 additions and 14 deletions
+4 -7
View File
@@ -191,18 +191,14 @@ void test_iso9660()
}
}
int vsf_read_file_by_path(const char* path, uint8_t** buffer, l9660_dir* dir)
int vfs_read_file_by_path(const char* path, uint8_t** buffer)
{
l9660_file* file = (l9660_file*)malloc(sizeof(l9660_file));
l9660_dir* dir = (l9660_dir*)malloc(sizeof(l9660_dir));
l9660_status err;
err = l9660_openat(file, dir, path);
if (err != L9660_OK)
{
debug_log("read_file: err: 0x%X\n", err);
return err;
}
follow_path(path, file, dir);
debug_log("HEHE %s\n", path);
@@ -218,6 +214,7 @@ int vsf_read_file_by_path(const char* path, uint8_t** buffer, l9660_dir* dir)
read = vfs_read_file(file, *buffer);
free(file);
free(dir);
debug_log("bytes read: 0x%X\n", read);
return 0;