Break ioctl() up into smaller syscalls

This commit is contained in:
2025-10-14 20:05:41 +02:00
parent c34a253d11
commit 406434fed0
21 changed files with 375 additions and 320 deletions

View File

@ -26,15 +26,15 @@ void fs_mkf(void) {
uprintf("fs mkf: Could not parse args: %d\n", ret);
}
IOH ioh = ioctl(IOCTL_NOHANDLE, IOCTL_OPENF, (uint64_t)path, IOCTL_F_MAKE | IOCTL_F_WRITE, 0);
if (ioh < 0) {
int32_t h = fs_openf(path, FS_OF_MAKE | FS_OF_WRITE);
if (h < 0) {
uprintf("fs mkf: could not create %s\n", path);
return;
}
if (FS_MKF_CONFIG.write != NULL) {
if (ioctl(ioh, IOCTL_WRITE, (uint64_t)FS_MKF_CONFIG.write, string_len(FS_MKF_CONFIG.write), 0) < 0) {
if (fs_write(h, (const uint8_t *)FS_MKF_CONFIG.write, string_len(FS_MKF_CONFIG.write), 0) < 0) {
uprintf("fs mkf: could not write to %s\n", path);
}
}
ioctl(ioh, IOCTL_CLOSEF, 0, 0, 0);
fs_closef(h);
}