aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2004-12-13 00:46:05 +0000
committerHans-Peter Nilsson <hp@axis.com>2004-12-13 00:46:05 +0000
commit82571856a8259a137ea4afa1263c386548b7beb3 (patch)
treecfc99059dc3f011a87ba526d55b22333cc6f6985 /sim
parent23193ce4abe0f342cf097550f2c6db2b53007a71 (diff)
downloadgdb-82571856a8259a137ea4afa1263c386548b7beb3.zip
gdb-82571856a8259a137ea4afa1263c386548b7beb3.tar.gz
gdb-82571856a8259a137ea4afa1263c386548b7beb3.tar.bz2
* syscall.c (cb_syscall) <case CB_SYS_rename>: New case.
Diffstat (limited to 'sim')
-rw-r--r--sim/common/ChangeLog1
-rw-r--r--sim/common/syscall.c27
2 files changed, 28 insertions, 0 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 0213a9c..bb491f0 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -2,6 +2,7 @@
* syscall.c (cb_syscall) <case CB_SYS_lstat>: New case.
* callback.c (os_lstat): New function.
+ (cb_syscall) <case CB_SYS_rename>: New case.
2004-12-08 Hans-Peter Nilsson <hp@axis.com>
diff --git a/sim/common/syscall.c b/sim/common/syscall.c
index 07521c9..789aa3a 100644
--- a/sim/common/syscall.c
+++ b/sim/common/syscall.c
@@ -400,6 +400,33 @@ cb_syscall (cb, sc)
}
break;
+ case CB_SYS_rename :
+ {
+ char *path1, *path2;
+
+ errcode = get_path (cb, sc, sc->arg1, &path1);
+ if (errcode != 0)
+ {
+ result = -1;
+ errcode = EFAULT;
+ goto FinishSyscall;
+ }
+ errcode = get_path (cb, sc, sc->arg2, &path2);
+ if (errcode != 0)
+ {
+ result = -1;
+ errcode = EFAULT;
+ free (path1);
+ goto FinishSyscall;
+ }
+ result = (*cb->rename) (cb, path1, path2);
+ free (path1);
+ free (path2);
+ if (result < 0)
+ goto ErrorFinish;
+ }
+ break;
+
case CB_SYS_stat :
{
char *path,*buf;