[lkml]   [2006]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [patch 2/2] alarm unsigned signed conversion fixup
    On Sat, 2006-03-18 at 15:18 +0000, Thomas Gleixner wrote:
    > plain text document attachment (alarm-fixup-unsigned-signed.patch)
    > alarm() calls the kernel with an unsigend int timeout in seconds.
    > The value is converted to a timeval which is used to setup the
    > itimer. The tv_sec field of the timeval is a long, which causes
    > the timeout to be negative on 32 bit machines if seconds > INT_MAX.
    > Also this was silently caught before the hrtimer merge.
    > To avoid fixups all over the place the duplicated sys_alarm code
    > is moved to itimer.c.

    Also this needs a better explanation.

    The timeval_to_jiffies conversion converted the resulting negative value

    hrtimer treats the negative value as expired. The valid range for
    alarm() is 1 .. UINT_MAX, so ignoring the conversion problem would cause
    early expiry and break valid userspace code.


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2006-03-18 21:04    [W:0.019 / U:4.216 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site