aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@embecosm.com>2003-10-15 12:30:47 +0000
committerJoern Rennecke <joern.rennecke@embecosm.com>2003-10-15 12:30:47 +0000
commit8822d0016c0c592c921a3a4e96d2e8533c79545f (patch)
tree990fecea2f39fa10115680ad71e7dfca642d51bd /sim/common
parentcdc9c0bc96781bae099051b052ccfd66ea685ba5 (diff)
downloadgdb-8822d0016c0c592c921a3a4e96d2e8533c79545f.zip
gdb-8822d0016c0c592c921a3a4e96d2e8533c79545f.tar.gz
gdb-8822d0016c0c592c921a3a4e96d2e8533c79545f.tar.bz2
include/gdb:
* callback.h (struct host_callback_struct): New members ftruncate and truncate. gdb: sim/common: * callback.c (os_ftruncate, os_truncate): New functions. (default_callback): Initialize ftruncate and truncate members. sim/sh: * syscall.h (SYS_truncate, SYS_ftruncate): Define. * interp.c (trap): Add support for SYS_ftruncate and SYS_truncate.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog5
-rw-r--r--sim/common/callback.c27
2 files changed, 32 insertions, 0 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index ca6d384..be39aba 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-15 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * callback.c (os_ftruncate, os_truncate): New functions.
+ (default_callback): Initialize ftruncate and truncate members.
+
2003-09-08 Dave Brolley <brolley@redhat.com>
On behalf of Doug Evans <dje@sebabeach.org>
diff --git a/sim/common/callback.c b/sim/common/callback.c
index db0fff6..b225481 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -399,6 +399,30 @@ os_fstat (p, fd, buf)
return wrap (p, fstat (fdmap (p, fd), buf));
}
+static int
+os_ftruncate (p, fd, len)
+ host_callback *p;
+ int fd;
+ long len;
+{
+ int result;
+
+ result = fdbad (p, fd);
+ if (result)
+ return result;
+ result = wrap (p, ftruncate (fdmap (p, fd), len));
+ return result;
+}
+
+static int
+os_truncate (p, file, len)
+ host_callback *p;
+ const char *file;
+ long len;
+{
+ return wrap (p, stat (file, len));
+}
+
static int
os_shutdown (p)
host_callback *p;
@@ -538,6 +562,9 @@ host_callback default_callback =
os_stat,
os_fstat,
+ os_ftruncate,
+ os_truncate,
+
os_poll_quit,
os_shutdown,