Re: [PATCH] Allow times and time system calls to return smallnegative values

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Joakim Tjernlund
Date: Thursday, December 4, 2008 - 9:01 am

On Thu, 2008-12-04 at 16:40 +0100, Ingo Molnar wrote:

Na, that will just hide the bug for some 497 days(or 49 days on alpha).
In user space on have to use this workaround(and I think some variation
is in glibc already):

static unsigned long quagga_times(void)
{
#if defined(GNU_LINUX)
  unsigned long ret;

  errno = 0;
  ret = times(NULL); /* Linux can handle NULL */
  /* Workaround broken syscall impl.
   * A bugfix exists for the kernel, hopefully
   * it will make it into 2.6.29
   */
  if (errno)
    ret = (unsigned long) (-errno);
  return ret;
#else
  struct tms dummy; /* Only return value is used */

  return times(&dummy);
#endif
}


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Allow times and time system calls to return sm ..., Joakim Tjernlund, (Thu Dec 4, 9:01 am)