lkml.org 
[lkml]   [2005]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: RFC: Kill -ERESTART_RESTARTBLOCK.
    Hi,

    On Thu, 24 Nov 2005, David Woodhouse wrote:

    > I'm looking at implementing ppoll() and pselect(), and the existing
    > restartblock stuff isn't sufficient for that -- we don't get to store
    > enough args, and although it could possibly be expanded, I just don't
    > much like restarting syscalls that way.

    What arguments do you need to store?
    Instead of messing with the signal delivery it may be better to slightly
    change the restart logic. Instead of calling a separate function, we could
    call the original function with all the arguments, which would reduce the
    state required to be saved.
    In the case of nanosleep this could look like this:

    sys_nanosleep()
    {
    ...
    if (restart_block) {
    expire = restart_block->arg0;
    } else {
    if (copy_from_user(&t, rqtp, sizeof(t)))
    ...
    }
    expire = schedule_timeout_interruptible(expire);
    if (expire) {
    ...
    restart_block->arg0 = expire;
    ret = -ERESTART_RESTARTBLOCK;
    }
    }

    AFAICT only the timeout argument needs to saved over a restart, the rest
    can be reinitialized from the original arguments.
    The main problem would be to prevent an incorrect restart, e.g. if the
    debugger pokes around in the registers.

    bye, Roman
    -
    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/

    \
     
     \ /
      Last update: 2005-11-25 02:13    [W:0.025 / U:60.812 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site