[patch 1/1] x86_64: remove duplicated sys_time64

blaisorblade_at_yahoo.it
Date: 07/28/05

  • Next message: blaisorblade_at_yahoo.it: "[patch 1/2] doc: describe Kbuild pitfall"
    To: torvalds@osdl.org
    Date:	Thu, 28 Jul 2005 17:46:49 +0200
    
    

    CC: Andi Kleen <ak@suse.de>

    I'm resending this patch again for 4th time since it wasn't merged nor it is
    in -mm. The first time it didn't look right because of Andi looking at an
    older tree, but it later was sorted out, and he Acked the patch.

    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.

    Acked-by: Andi Kleen <ak@suse.de>

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

    ---
     linux-2.6.git-paolo/arch/x86_64/kernel/sys_x86_64.c |   14 --------------
     linux-2.6.git-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.git/include/asm-x86_64/unistd.h~x86_64-remove-sys-time-x86-64	2005-07-28 17:45:26.000000000 +0200
    +++ linux-2.6.git-paolo/include/asm-x86_64/unistd.h	2005-07-28 17:45:26.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
    @@ -608,6 +608,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.git/arch/x86_64/kernel/sys_x86_64.c~x86_64-remove-sys-time-x86-64	2005-07-28 17:45:26.000000000 +0200
    +++ linux-2.6.git-paolo/arch/x86_64/kernel/sys_x86_64.c	2005-07-28 17:45:26.000000000 +0200
    @@ -161,17 +161,3 @@ asmlinkage long sys_uname(struct new_uts
     		err |= copy_to_user(&name->machine, "i686", 5); 		
     	return err ? -EFAULT : 0;
     }
    -
    -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;
    -}
    _
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: blaisorblade_at_yahoo.it: "[patch 1/2] doc: describe Kbuild pitfall"

    Relevant Pages

    • Re: 2.6.3-rc1-mm1
      ... > This is the first time that anyone told me that it even existed. ... When we're at kernel version 2.6.3! ... without this patch. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • 2.6.0-test1 Adaptec aic7899 Ultra160 SCSI grief
      ... patch), I had two seemingly random SCSI hangs today. ... I was busy the first time around, but the second time I managed ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [patch 12/29] w1: kconfig/Makefile fix.
      ... This patch was sent first time very long time ago, ... If can not be applied cleanly after your w1 queue is flushed ... Patch from Michael Farmbauer. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH 1/7]: PCI revised (3) [PATCH 16/42]: PCI: PCI Error reporting callbacks
      ... > Per Linus's remarks about namespace pollution, I've kept the enums. ... >> more sense to people looking at it for the first time. ... patch" stuff is needed here. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] Kprobes: wrapper to define jprobe.entry
      ... > it easy to handle the three dword function descriptors defined by the ... I don't have the kprobes-for-ppc64 patch here. ... The earlier method of defining jprobe.entry will ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)