summaryrefslogtreecommitdiffstats
path: root/arch/mips64
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-10-02 20:36:27 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-10-02 20:36:27 +0000
commitaee5c651f2bbaee1b484ab5e83cd36abe0e43897 (patch)
tree323530bb85bfdabb92724647a3c3d11c255ca175 /arch/mips64
parentfe7c8ddf82f7f330e5a730fd836dbce5e0ec4105 (diff)
Compatibility version of utime(2).
Diffstat (limited to 'arch/mips64')
-rw-r--r--arch/mips64/kernel/linux32.c31
-rw-r--r--arch/mips64/kernel/scall_o32.S2
2 files changed, 32 insertions, 1 deletions
diff --git a/arch/mips64/kernel/linux32.c b/arch/mips64/kernel/linux32.c
index 9c6643f81..981c639df 100644
--- a/arch/mips64/kernel/linux32.c
+++ b/arch/mips64/kernel/linux32.c
@@ -22,6 +22,7 @@
#include <linux/sem.h>
#include <linux/msg.h>
#include <linux/sysctl.h>
+#include <linux/utime.h>
#include <linux/utsname.h>
#include <linux/personality.h>
#include <linux/timex.h>
@@ -179,6 +180,36 @@ asmlinkage int sys_ftruncate64(unsigned int fd, unsigned int high,
return sys_ftruncate(fd, ((long) high << 32) | low);
}
+extern asmlinkage int sys_utime(char * filename, struct utimbuf * times);
+
+struct utimbuf32 {
+ __kernel_time_t32 actime, modtime;
+};
+
+asmlinkage int sys32_utime(char * filename, struct utimbuf32 *times)
+{
+ struct utimbuf t;
+ mm_segment_t old_fs;
+ int ret;
+ char *filenam;
+
+ if (!times)
+ return sys_utime(filename, NULL);
+ if (get_user (t.actime, &times->actime) ||
+ __get_user (t.modtime, &times->modtime))
+ return -EFAULT;
+ filenam = getname (filename);
+ ret = PTR_ERR(filenam);
+ if (!IS_ERR(filenam)) {
+ old_fs = get_fs();
+ set_fs (KERNEL_DS);
+ ret = sys_utime(filenam, &t);
+ set_fs (old_fs);
+ putname (filenam);
+ }
+ return ret;
+}
+
#if 0
/*
* count32() counts the number of arguments/envelopes
diff --git a/arch/mips64/kernel/scall_o32.S b/arch/mips64/kernel/scall_o32.S
index 4d1450a6b..3a814fd7f 100644
--- a/arch/mips64/kernel/scall_o32.S
+++ b/arch/mips64/kernel/scall_o32.S
@@ -231,7 +231,7 @@ illegal_syscall:
sys sys32_alarm 1
sys sys_fstat 2
sys sys_pause 0
- sys sys_utime 2 /* 4030 */
+ sys sys32_utime 2 /* 4030 */
sys sys_ni_syscall 0
sys sys_ni_syscall 0
sys sys_access 2