The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: blaisorblade@yahoo.it
To: torvalds@osdl.org
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org,
	blaisorblade@yahoo.it, ak@suse.de
Subject: [patch 2/3] x86_64: remove duplicated sys_time64
Date: Wed, 30 Mar 2005 19:32:16 +0200	[thread overview]
Message-ID: <20050330173216.426CFEFECF@zion> (raw)


CC: Andi Kleen <ak@suse.de>

Keeping this function does not makes sense because it's a copied (and buggy)
copy of sys_time. The only difference is that now.tv_sec (which is a time_t,
i.e. a 64-bit long) is copied (and truncated) into a int (32-bit).

The prototype is the same (they both take a long __user *), so let's drop this
and redirect it to sys_time (and make sure it exists by defining
__ARCH_WANT_SYS_TIME).

Only disadvantage is that the sys_stime definition is also compiled (may be
fixed if needed by adding a separate __ARCH_WANT_SYS_STIME macro, and defining
it for all arch's defining __ARCH_WANT_SYS_TIME except x86_64).

Not compile-tested, sorry.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---

 linux-2.6.11-paolo/arch/x86_64/kernel/sys_x86_64.c |   14 --------------
 linux-2.6.11-paolo/include/asm-x86_64/unistd.h     |    3 ++-
 2 files changed, 2 insertions(+), 15 deletions(-)

diff -puN include/asm-x86_64/unistd.h~x86_64-remove-sys-time-x86-64 include/asm-x86_64/unistd.h
--- linux-2.6.11/include/asm-x86_64/unistd.h~x86_64-remove-sys-time-x86-64	2005-03-29 17:39:38.000000000 +0200
+++ linux-2.6.11-paolo/include/asm-x86_64/unistd.h	2005-03-29 17:47:36.000000000 +0200
@@ -462,7 +462,7 @@ __SYSCALL(__NR_fremovexattr, sys_fremove
 #define __NR_tkill	200
 __SYSCALL(__NR_tkill, sys_tkill) 
 #define __NR_time      201
-__SYSCALL(__NR_time, sys_time64)
+__SYSCALL(__NR_time, sys_time)
 #define __NR_futex     202
 __SYSCALL(__NR_futex, sys_futex)
 #define __NR_sched_setaffinity    203
@@ -600,6 +600,7 @@ do { \
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
+#define __ARCH_WANT_SYS_TIME
 #define __ARCH_WANT_COMPAT_SYS_TIME
 #endif
 
diff -puN arch/x86_64/kernel/sys_x86_64.c~x86_64-remove-sys-time-x86-64 arch/x86_64/kernel/sys_x86_64.c
--- linux-2.6.11/arch/x86_64/kernel/sys_x86_64.c~x86_64-remove-sys-time-x86-64	2005-03-29 17:39:38.000000000 +0200
+++ linux-2.6.11-paolo/arch/x86_64/kernel/sys_x86_64.c	2005-03-29 17:40:30.000000000 +0200
@@ -158,17 +158,3 @@ asmlinkage long wrap_sys_shmat(int shmid
 	unsigned long raddr;
 	return do_shmat(shmid,shmaddr,shmflg,&raddr) ?: (long)raddr;
 }
-
-asmlinkage long sys_time64(long __user * tloc)
-{
-	struct timeval now; 
-	int i; 
-
-	do_gettimeofday(&now);
-	i = now.tv_sec;
-	if (tloc) {
-		if (put_user(i,tloc))
-			i = -EFAULT;
-	}
-	return i;
-}
_

             reply	other threads:[~2005-03-30 18:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-30 17:32 blaisorblade [this message]
2005-03-31 10:38 ` [patch 2/3] x86_64: remove duplicated sys_time64 Andi Kleen
2005-03-31 11:10   ` Stephen Rothwell
2005-03-31 11:12     ` Andi Kleen
2005-03-31 11:25       ` Stephen Rothwell
2005-03-31 11:36         ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050330173216.426CFEFECF@zion \
    --to=blaisorblade@yahoo.it \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox