Index: include/roaraudio/error.h
===================================================================
--- include/roaraudio/error.h	(revision 4874)
+++ include/roaraudio/error.h	(revision 4912)
@@ -70,4 +70,23 @@
 #define ROAR_ERROR_NOISE       48 /* Line too noisy */
 #define ROAR_ERROR_LINKDOWN    49 /* Physical or logical link down */
+#define ROAR_ERROR_INTERRUPTED 50 /* Operation was interruped */
+#define ROAR_ERROR_CAUSALITY   51 /* Causality error */
+#define ROAR_ERROR_QUOTA       52 /* Quota exceeded */
+#define ROAR_ERROR_BADLIB      53 /* Accessing a corrupted shared library */
+#define ROAR_ERROR_NOMEDIUM    54 /* No medium found */
+#define ROAR_ERROR_NOTUNIQ     55 /* Name not unique */
+#define ROAR_ERROR_ILLSEQ      56 /* Illegal byte sequence */
+#define ROAR_ERROR_ADDRINUSE   57 /* Address in use */
+#define ROAR_ERROR_HOLE        58 /* Hole in data */
+#define ROAR_ERROR_BADVERSION  59 /* Bad version */
+#define ROAR_ERROR_NSVERSION   60 /* Not supported version */
+#define ROAR_ERROR_BADMAGIC    61 /* Bad magic number */
+#define ROAR_ERROR_LOSTSYNC    62 /* Lost synchronization */
+#define ROAR_ERROR_BADSEEK     63 /* Can not seek to destination position */
+#define ROAR_ERROR_NOSEEK      64 /* Seeking not supported on resource */
+#define ROAR_ERROR_BADCKSUM    65 /* Data integrity error */
+#define ROAR_ERROR_NOHORSE     66 /* Mount failed */
+#define ROAR_ERROR_CHERNOBYL   67 /* Fatal device error */
+#define ROAR_ERROR_NOHUG       68 /* Device needs love */
 
 #endif
Index: libroar/error.c
===================================================================
--- libroar/error.c	(revision 4876)
+++ libroar/error.c	(revision 4912)
@@ -208,4 +208,7 @@
   case EIO:          _roar_errno = ROAR_ERROR_IO; break;
 #endif
+#ifdef EREMOTEIO
+  case EREMOTEIO:    _roar_errno = ROAR_ERROR_RIO; break;
+#endif
 #ifdef EKEYEXPIRED
   case EKEYEXPIRED:  _roar_errno = ROAR_ERROR_KEYEXPIRED; break;
@@ -249,4 +252,28 @@
 #ifdef ENETDOWN
   case ENETDOWN:     _roar_errno = ROAR_ERROR_LINKDOWN; break;
+#endif
+#ifdef EINTR
+  case EINTR:        _roar_errno = ROAR_ERROR_INTERRUPTED; break;
+#endif
+#ifdef EDQUOT
+  case EDQUOT:       _roar_errno = ROAR_ERROR_QUOTA; break;
+#endif
+#ifdef ELIBBAD
+  case ELIBBAD:      _roar_errno = ROAR_ERROR_BADLIB; break;
+#endif
+#ifdef ENOMEDIUM
+  case ENOMEDIUM:    _roar_errno = ROAR_ERROR_NOMEDIUM; break;
+#endif
+#ifdef ENOTUNIQ
+  case ENOTUNIQ:     _roar_errno = ROAR_ERROR_NOTUNIQ; break;
+#endif
+#ifdef EILSEQ
+  case EILSEQ:       _roar_errno = ROAR_ERROR_ILLSEQ; break;
+#endif
+#ifdef EADDRINUSE
+  case EADDRINUSE:   _roar_errno = ROAR_ERROR_ADDRINUSE; break;
+#endif
+#ifdef ESPIPE
+  case ESPIPE:       _roar_errno = ROAR_ERROR_BADSEEK; break;
 #endif
   default:
@@ -354,7 +381,19 @@
    break;
 #endif
+#if defined(EREMOTEIO) || defined(EIO)
+  case ROAR_ERROR_RIO:
+#ifdef EREMOTEIO
+    errno = EREMOTEIO;
+#else
+    errno = EIO;
+#endif
+   break;
+#endif
 #ifdef EIO
   case ROAR_ERROR_IO:
-  case ROAR_ERROR_RIO:
+  case ROAR_ERROR_HOLE:
+  case ROAR_ERROR_BADCKSUM:
+  case ROAR_ERROR_LOSTSYNC:
+  case ROAR_ERROR_NOHORSE:
     errno = EIO;
    break;
@@ -439,4 +478,45 @@
   case ROAR_ERROR_LINKDOWN:
     errno = ENETDOWN;
+   break;
+#endif
+#ifdef EINTR
+  case ROAR_ERROR_INTERRUPTED:
+    errno = EINTR;
+   break;
+#endif
+#ifdef EDQUOT
+  case ROAR_ERROR_QUOTA:
+    errno = EDQUOT;
+   break;
+#endif
+#ifdef ELIBBAD
+  case ROAR_ERROR_BADLIB:
+    errno = ELIBBAD;
+   break;
+#endif
+#ifdef ENOMEDIUM
+  case ROAR_ERROR_NOMEDIUM:
+    errno = ENOMEDIUM;
+   break;
+#endif
+#ifdef ENOTUNIQ
+  case ROAR_ERROR_NOTUNIQ:
+    errno = ENOTUNIQ;
+   break;
+#endif
+#ifdef EILSEQ
+  case ROAR_ERROR_ILLSEQ:
+    errno = EILSEQ;
+   break;
+#endif
+#ifdef EADDRINUSE
+  case ROAR_ERROR_ADDRINUSE:
+    errno = EADDRINUSE;
+   break;
+#endif
+#ifdef ESPIPE
+  case ROAR_ERROR_BADSEEK:
+  case ROAR_ERROR_NOSEEK:
+    errno = ESPIPE;
    break;
 #endif
@@ -451,4 +531,5 @@
 }
 
+// phi@ph7:roaraudio $ grep '^#define ROAR_ERROR_' error.h  | tr -d /\* | while read d c d t; do printf "  {%-23s \"%s\"},\n" $c, "$t"; done
 
 const char * roar_error2str(const int error) {
@@ -496,4 +577,23 @@
   {ROAR_ERROR_NOISE,       "Line too noisy"},
   {ROAR_ERROR_LINKDOWN,    "Physical or logical link down"},
+  {ROAR_ERROR_INTERRUPTED, "Operation was interruped"},
+  {ROAR_ERROR_CAUSALITY,   "Causality error"},
+  {ROAR_ERROR_QUOTA,       "Quota exceeded"},
+  {ROAR_ERROR_BADLIB,      "Accessing a corrupted shared library"},
+  {ROAR_ERROR_NOMEDIUM,    "No medium found"},
+  {ROAR_ERROR_NOTUNIQ,     "Name not unique"},
+  {ROAR_ERROR_ILLSEQ,      "Illegal byte sequence"},
+  {ROAR_ERROR_ADDRINUSE,   "Address in use"},
+  {ROAR_ERROR_HOLE,        "Hole in data"},
+  {ROAR_ERROR_BADVERSION,  "Bad version"},
+  {ROAR_ERROR_NSVERSION,   "Not supported version"},
+  {ROAR_ERROR_BADMAGIC,    "Bad magic number"},
+  {ROAR_ERROR_LOSTSYNC,    "Lost synchronization"},
+  {ROAR_ERROR_BADSEEK,     "Can not seek to destination position"},
+  {ROAR_ERROR_NOSEEK,      "Seeking not supported on resource"},
+  {ROAR_ERROR_BADCKSUM,    "Data integrity error"},
+  {ROAR_ERROR_NOHORSE,     "Mount failed"},
+  {ROAR_ERROR_CHERNOBYL,   "Fatal device error"},
+  {ROAR_ERROR_NOHUG,       "Device needs love"},
   {-1, NULL}
  };
