skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

error_temp.c (1139B)


      1 /* ISC license. */
      2 
      3 #include <errno.h>
      4 #include <skalibs/error.h>
      5 
      6 int error_temp (int e)
      7 {
      8   if (error_isagain(e)) return 1 ;
      9   switch (e)
     10   {
     11     case 0 :
     12     case EINTR :
     13     case ENOMEM :
     14     case ETXTBSY :
     15     case EIO :
     16     case ETIMEDOUT :
     17     case ENOBUFS :
     18 #ifdef EDEADLK
     19     case EDEADLK :
     20 #endif
     21 #ifdef EBUSY
     22     case EBUSY :
     23 #endif
     24 #ifdef ENFILE
     25     case ENFILE :
     26 #endif
     27 #ifdef EFBIG
     28     case EFBIG :
     29 #endif
     30 #ifdef ENOSPC
     31     case ENOSPC :
     32 #endif
     33 #ifdef ENETDOWN
     34     case ENETDOWN :
     35 #endif
     36 #ifdef ENETUNREACH
     37     case ENETUNREACH :
     38 #endif
     39 #ifdef ENETRESET
     40     case ENETRESET :
     41 #endif
     42 #ifdef ECONNABORTED
     43     case ECONNABORTED :
     44 #endif
     45 #ifdef ECONNRESET
     46     case ECONNRESET :
     47 #endif
     48 #ifdef ETOOMANYREFS
     49     case ETOOMANYREFS :
     50 #endif
     51 #ifdef ECONNREFUSED
     52     case ECONNREFUSED :
     53 #endif
     54 #ifdef EHOSTDOWN
     55     case EHOSTDOWN :
     56 #endif
     57 #ifdef EHOSTUNREACH
     58     case EHOSTUNREACH :
     59 #endif
     60 #ifdef EPROCLIM
     61     case EPROCLIM :
     62 #endif
     63 #ifdef EUSERS
     64     case EUSERS :
     65 #endif
     66 #ifdef EDQUOT
     67     case EDQUOT :
     68 #endif
     69 #ifdef ESTALE
     70     case ESTALE :
     71 #endif
     72 #ifdef ENOLCK
     73     case ENOLCK :
     74 #endif
     75       return 1 ;
     76     default : return 0 ;
     77   }
     78 }