vfs Rewrite IOCTL_STAT so that it doesnt require an already open handle

This commit is contained in:
2025-10-03 01:00:09 +02:00
parent 2cfd3ee2fa
commit de20efa0f3
7 changed files with 71 additions and 44 deletions

View File

@ -74,19 +74,17 @@ ElfAuxval proc_load_elf_segs(Proc *proc, uint8_t *data) {
}
Proc *proc_spawnuser(char *mountpoint, char *path) {
VfsObj *vobj = vfs_open(mountpoint, path, VFS_FLAG_READ);
if (vobj == NULL) {
return NULL;
}
VfsStat stat;
if (vobj->stat(vobj, &stat) != E_OK) {
vfs_close(vobj);
if (vfs_stat(mountpoint, path, &stat) != E_OK) {
return NULL;
}
if (stat.type != VFS_TYPE_FILE) {
vfs_close(vobj);
return NULL;
}
VfsObj *vobj = vfs_open(mountpoint, path, VFS_FLAG_READ);
if (vobj == NULL) {
return NULL;
}