Re: sys_times() return value

From: Russell King (rmk+lkml_at_arm.linux.org.uk)
Date: 07/29/05

  • Next message: Michael Kerrisk: "Re: Broke nice range for RLIMIT NICE"
    Date:	Fri, 29 Jul 2005 11:37:55 +0100
    To: Andrew Morton <akpm@osdl.org>
    
    

    On Sat, Jul 23, 2005 at 03:35:31PM +1000, Andrew Morton wrote:
    > Russell King <rmk+lkml@arm.linux.org.uk> wrote:
    > > ARM folk have recently pointed out a problem with sys_times().
    > > When the kernel boots, we set jiffies to -5 minutes. This causes
    > > sys_times() to return a negative number, which increments through
    > > zero.
    > >
    > > However, some negative numbers are used to return error codes.
    > > Hence, there's a period of time when sys_times() returns values
    > > which are indistinguishable from error codes shortly after boot.
    >
    > What a strange system call.
    >
    > > This probably only affects 32-bit architectures. However, one
    > > wonders whether sys_times() needs force_successful_syscall_return().
    >
    > I'd say so, yes. But lots of architectures seem to have a no-op there.

    As I mentioned below, these other architectures need glibc to be fixed.

    > > Also, it appears that glibc does indeed interpret the return value
    > > from sys_times in the way I describe above on at least ARM and x86.
    > > Other architectures may be similarly affected. Hopefully the ARM
    > > glibc folk will raise a cross-architecture bug in glibc for this.

    -- 
    Russell King
     Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
     maintainer of:  2.6 Serial core
    -
    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: Michael Kerrisk: "Re: Broke nice range for RLIMIT NICE"

    Relevant Pages

    • Re: [PATCH] Remove some divide instructions
      ... >other architectures may want to do other things, ... due to the assignment to __base, the shift / mask optimization does not ... optimizations do not propagate through the assignment. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [bugfix] try_to_unmap_cluster() passes out-of-bounds pte to pte_unmap()
      ... It may be more of an issue with architectures that actually *do* do ... I don't see anyone getting motivated enough to rewrite the ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: [Discuss][i386] Platform SMIs and their interferance with tsc based delay calibration
      ... We increase the delay calibration time and also identify any ... From a maintainability POV it's not good that x86 is no longer using the ... architectures must implement arch_calibrate_delay, then provide stubs for ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [2.6 patch] kill include/linux/platform.h
      ... present on all architectures or whether it's an architecture-specific ... required by cleaning up warnings with the -Wmissing-prototypes compiler ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: add lowpower_idle sysctl
      ... but the *meanings* of the different values of that sysctl need to be ... try to get different architectures to honour `42' in the same way. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)