Kernel/LibC: Add SYS_TRUNCATE

This commit is contained in:
2024-05-28 01:08:04 +03:00
parent f5987b68ff
commit 18e2559b1e
6 changed files with 23 additions and 0 deletions

View File

@@ -73,6 +73,7 @@ __BEGIN_DECLS
O(SYS_CONNECT, connect) \
O(SYS_LISTEN, listen) \
O(SYS_PSELECT, pselect) \
O(SYS_TRUNCATE, truncate) \
enum Syscall
{

View File

@@ -99,6 +99,11 @@ off_t lseek(int fildes, off_t offset, int whence)
return syscall(SYS_SEEK, fildes, offset, whence);
}
int ftruncate(int fildes, off_t length)
{
return syscall(SYS_TRUNCATE, fildes, length);
}
int dup(int fildes)
{
return syscall(SYS_DUP, fildes);