summaryrefslogtreecommitdiff
path: root/fs/tmpfs.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-10-24 14:10:07 +0200
committerAnton Kling <anton@kling.gg>2023-10-24 14:10:07 +0200
commit2292b11e82a3d6d70e7bb932c512155dc13c5025 (patch)
treeda7d90e778495bc9a67ee0e09b32813c11dc6fe5 /fs/tmpfs.c
parente93a49d1eadf4a4b36369e67f112f8c45a0d567e (diff)
VFS/LibC: Create ftruncate function and corresponding syscall and libc implementation
Previously this function was only used for shared memory region created by shm_open because I was lazy. Now exists for all files.
Diffstat (limited to 'fs/tmpfs.c')
-rw-r--r--fs/tmpfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/tmpfs.c b/fs/tmpfs.c
index 575ab0c..a9a3c1f 100644
--- a/fs/tmpfs.c
+++ b/fs/tmpfs.c
@@ -48,7 +48,7 @@ void dual_pipe(int fd[2]) {
0 /*inode_num*/, 0 /*type*/, has_data, can_write, is_open,
internal_object, 0 /*file_size*/, NULL /*open*/, NULL /*create_file*/,
tmp_read, tmp_write, tmp_close, NULL /*create_directory*/,
- NULL /*get_vm_object*/);
+ NULL /*get_vm_object*/, NULL /*truncate*/);
assert(inode);
vfs_fd_t *fd_ptr;
@@ -77,7 +77,8 @@ void pipe(int fd[2]) {
vfs_inode_t *inode = vfs_create_inode(
0 /*inode_num*/, 0 /*type*/, has_data, can_write, is_open,
internal_object, 0 /*file_size*/, NULL /*open*/, NULL /*create_file*/,
- tmp_read, tmp_write, tmp_close, NULL/*create_directory*/, NULL /*get_vm_object*/);
+ tmp_read, tmp_write, tmp_close, NULL /*create_directory*/,
+ NULL /*get_vm_object*/, NULL/*truncate*/);
assert(inode);
vfs_fd_t *fd_ptr;