Skip to content
  • Philippe Gerum's avatar
    lib/cobalt: restrict sched_get_priority_min/max() range for SCHED_FIFO/RR · f84627ce
    Philippe Gerum authored
    Increasing the values returned by the sched_get_priority_max() wrapper
    above the glibc limit breaks the basic assumption that such value
    could be used with pthread_create(), which is wrong.
    
    When an overlap exist for some scheduling policies (i.e. SCHED_FIFO,
    RR) between Cobalt and glibc interface, we must differentiate calls
    for obtaining the static range complying with the glibc, from those
    for dealing specifically with those policies if Cobalt extends them.
    
    This translates to:
    
    sched_get_priority_max(SCHED_FIFO/RR) => 99
    sched_get_priority_max_ex(SCHED_FIFO/RR) => 256
    f84627ce