filesystem seek

This commit is contained in:
2025-07-06 00:01:33 +02:00
parent dee0e4b0ab
commit 03c5cb09b5
2 changed files with 17 additions and 2 deletions

View File

@@ -396,12 +396,13 @@ void nn_fs_seek(nn_filesystem *fs, void *_, nn_component *component, nn_computer
// size_t capacity = fs->spaceTotal(component, fs->userdata);
int moved = 0;
/* size_t pos = */ fs->seek(component, fs->userdata, fd, whence, off, &moved);
size_t pos = fs->seek(component, fs->userdata, fd, whence, off, &moved);
if(moved < 0) moved = -moved;
// do not ask where it comes from, balance is hard
nn_fs_readCost(fs, 1, component, computer);
nn_fs_seekCost(fs, nn_fs_countChunks(fs, moved, component), component, computer);
nn_return_integer(computer, pos);
}
void nn_loadFilesystemTable(nn_universe *universe) {