Skip to content
  • Jan Kiszka's avatar
    cobalt/select: Add proper handling of EADV · ef3dd5c0
    Jan Kiszka authored
    Since rtdm_fd_select started to return EADV for unknown fds
    (2db562ad
    
    ), we were returning that code to applications in case a
    selector had been allocated for the caller already. That was because
    libcobalt lacked handling of this error.
    
    This fixes it and also establish proper signaling of EBADF in case the
    is a real error related to an RTDM fd. For that purpose, detect if
    __cobalt_select_bind_all got EADV for the first fd or for a succeeding
    one, i.e. on an unsupported mixed fd set.
    
    Also return EADV if the early __cobalt_first_fd_valid_p test fails. That
    ensures that we only retry with the regular Linux call when it makes
    sense.
    
    Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
    ef3dd5c0