Add write_file () syscall, CE implement redirections, libarena arena_realloc ()
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m14s

This commit is contained in:
2026-03-01 12:04:21 +01:00
parent abd85744cc
commit a5d5e7d6a4
9 changed files with 220 additions and 44 deletions

View File

@@ -205,6 +205,25 @@ int vfs_read_file (struct proc* proc, const char* volume_name, const char* path,
return volume->driver_ops.read_file (volume, path, buffer, off, size);
}
int vfs_write_file (struct proc* proc, const char* volume_name, const char* path, uint8_t* buffer,
size_t off, size_t size) {
struct vfs_volume* volume = vfs_find_volume (volume_name);
if (volume == NULL)
return -ST_NOT_FOUND;
spin_lock (&volume->lock);
if (volume->locked && volume->owner != proc) {
spin_unlock (&volume->lock);
return -ST_PERMISSION_ERROR;
}
spin_unlock (&volume->lock);
return volume->driver_ops.write_file (volume, path, buffer, off, size);
}
int vfs_create_file (struct proc* proc, const char* volume_name, const char* path) {
struct vfs_volume* volume = vfs_find_volume (volume_name);

View File

@@ -69,6 +69,9 @@ int vfs_format (struct proc* proc, const char* volume_name);
int vfs_read_file (struct proc* proc, const char* volume, const char* path, uint8_t* buffer,
size_t off, size_t size);
int vfs_write_file (struct proc* proc, const char* volume, const char* path, uint8_t* buffer,
size_t off, size_t size);
int vfs_describe (struct proc* proc, const char* volume, const char* path, struct desc* desc);
int vfs_read_dir_entry (struct proc* proc, const char* volume, const char* path,