aboutsummaryrefslogtreecommitdiff
path: root/sim/common/syscall.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2004-12-15 01:26:40 +0000
committerHans-Peter Nilsson <hp@axis.com>2004-12-15 01:26:40 +0000
commit5d945fec64d40266bc8679f455d3f598c4bc627c (patch)
tree67a097a6f6852f5974d72feafe24f6437b6d1c5e /sim/common/syscall.c
parent2adf959d7d8ab01c2e59938ebb5e2f36e1d558c3 (diff)
downloadgdb-5d945fec64d40266bc8679f455d3f598c4bc627c.zip
gdb-5d945fec64d40266bc8679f455d3f598c4bc627c.tar.gz
gdb-5d945fec64d40266bc8679f455d3f598c4bc627c.tar.bz2
* syscall.c (cb_syscall) <case CB_SYS_truncate>
<case CB_SYS_ftruncate>: New cases.
Diffstat (limited to 'sim/common/syscall.c')
-rw-r--r--sim/common/syscall.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/sim/common/syscall.c b/sim/common/syscall.c
index 789aa3a..fcfb417 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;