From 5d945fec64d40266bc8679f455d3f598c4bc627c Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Wed, 15 Dec 2004 01:26:40 +0000 Subject: [PATCH] * syscall.c (cb_syscall) : New cases. --- sim/common/ChangeLog | 5 +++++ sim/common/syscall.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index d7440be7726..78be8dca45e 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +2004-12-15 Hans-Peter Nilsson + + * syscall.c (cb_syscall) + : New cases. + 2004-12-13 Hans-Peter Nilsson * syscall.c (cb_syscall) : New case. diff --git a/sim/common/syscall.c b/sim/common/syscall.c index 789aa3ac79a..fcfb4176809 100644 --- a/sim/common/syscall.c +++ b/sim/common/syscall.c @@ -400,6 +400,36 @@ cb_syscall (cb, sc) } break; + case CB_SYS_truncate : + { + char *path; + long len = sc->arg2; + + errcode = get_path (cb, sc, sc->arg1, &path); + if (errcode != 0) + { + result = -1; + errcode = EFAULT; + goto FinishSyscall; + } + result = (*cb->truncate) (cb, path, len); + free (path); + if (result < 0) + goto ErrorFinish; + } + break; + + case CB_SYS_ftruncate : + { + int fd = sc->arg1; + long len = sc->arg2; + + result = (*cb->ftruncate) (cb, fd, len); + if (result < 0) + goto ErrorFinish; + } + break; + case CB_SYS_rename : { char *path1, *path2; -- 2.30.2