• Antonio J. Pena's avatar
    Added support for thread-safe errno in Solaris · be93caec
    Antonio J. Pena authored
    The _REENTRANT macro is required to be defined in order to get
    thread-safe "errno" values. Modern POSIX systems provide this by default
    when using -lpthreads, but there are still some (Solaris) that require
    an explicit define. Since we weren't compiling with that macro, we were
    getting incorrect "errno" values from the threads (mainly 0).
    More details: since we use nonblocking sockets, our code was checking
    "errno" to not be EINPROGRESS whenever we got an error code from a
    connect/accept, in order to determine an actual error (a return value
    of -1 and errno of EINPROGRESS does not define an actual error but a
    "not yet" when using nonblocking sockets).
    This patch automatically gets this macro defined by configure whenever
    we are not building in MPI_THREAD_SINGLE mode only.
    Fixes #2107
    Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <raffenet@mcs.anl.gov>