Index: ChangeLog
===================================================================
--- ChangeLog	(revision 5089)
+++ ChangeLog	(revision 5094)
@@ -1,4 +1,5 @@
 v. 0.4beta8 - ?
 	* Fixed endlessloop in MIDI subsystem (Closes: #137)
+	* Added new error codes (mostly from POSIX)
 
 v. 0.4beta7 - Sun Jul 10 2011 13:26 CEST
Index: include/roaraudio/error.h
===================================================================
--- include/roaraudio/error.h	(revision 4912)
+++ include/roaraudio/error.h	(revision 5094)
@@ -89,4 +89,33 @@
 #define ROAR_ERROR_CHERNOBYL   67 /* Fatal device error */
 #define ROAR_ERROR_NOHUG       68 /* Device needs love */
+#define ROAR_ERROR_TEXTBUSY    69 /* Text file busy */
+#define ROAR_ERROR_NOTEMPTY    70 /* Directory not empty */
+#define ROAR_ERROR_NODEUNREACH 71 /* Node is unreachable */
+#define ROAR_ERROR_IDREMOVED   72 /* Identifier removed */
+#define ROAR_ERROR_INPROGRESS  73 /* Operation in progress */
+#define ROAR_ERROR_NOCHILD     74 /* No child processes/object */
+#define ROAR_ERROR_NETUNREACH  75 /* Network unreachable */
+#define ROAR_ERROR_CANCELED    76 /* Operation canceled */
+#define ROAR_ERROR_ISDIR       77 /* Is a directory */
+#define ROAR_ERROR_NOTDIR      78 /* Not a directory */
+#define ROAR_ERROR_BADEXEC     79 /* Executable file format error */
+#define ROAR_ERROR_ISCONN      80 /* Socket/Object is connected */
+#define ROAR_ERROR_DEADLOCK    81 /* Resource deadlock would occur */
+#define ROAR_ERROR_CONNRST     82 /* Connection reset */
+#define ROAR_ERROR_BADFH       83 /* Bad file handle */
+#define ROAR_ERROR_NOTSOCK     84 /* Not a socket */
+#define ROAR_ERROR_TOOMANYARGS 85 /* Argument list too long */
+#define ROAR_ERROR_TOOLARGE    86 /* File/Object too large */
+#define ROAR_ERROR_DESTADDRREQ 87 /* Destination address required */
+#define ROAR_ERROR_AFNOTSUP    88 /* Address family not supported */
+#define ROAR_ERROR_NOPOWER     89 /* Operation can not be completed because we are low on power */
+#define ROAR_ERROR_USER        90 /* Error in front of screen */
+#define ROAR_ERROR_NFILE       91 /* Too many files/objects open in system */
+#define ROAR_ERROR_STALE       92 /* Stale file handle or object */
+#define ROAR_ERROR_XDEVLINK    93 /* Cross-device link */
+#define ROAR_ERROR_MLINK       94 /* Too many links to file or object */
+#define ROAR_ERROR_NONET       95 /* Not connected to any network */
+#define ROAR_ERROR_CONNRSTNET  96 /* Connection reset by network */
+#define ROAR_ERROR_CONNABORTED 97 /* Connection aborted */
 
 #endif
Index: libroar/error.c
===================================================================
--- libroar/error.c	(revision 5040)
+++ libroar/error.c	(revision 5094)
@@ -288,4 +288,85 @@
   case ENOHORSE:     _roar_errno = ROAR_ERROR_NOHORSE; break;
 #endif
+#ifdef ETXTBSY
+  case ETXTBSY:      _roar_errno = ROAR_ERROR_TEXTBUSY; break;
+#endif
+#ifdef ENOTEMPTY
+  case ENOTEMPTY:    _roar_errno = ROAR_ERROR_NOTEMPTY; break
+#endif
+#ifdef EHOSTUNREACH
+  case EHOSTUNREACH: _roar_errno = ROAR_ERROR_NODEUNREACH; break
+#endif
+#ifdef EIDRM
+  case EIDRM:        _roar_errno = ROAR_ERROR_IDREMOVED; break;
+#endif
+#ifdef EINPROGRESS
+  case EINPROGRESS:  _roar_errno = ROAR_ERROR_INPROGRESS; break
+#endif
+#ifdef ECHILD
+  case ECHILD:       _roar_errno = ROAR_ERROR_NOCHILD; break
+#endif
+#ifdef ENETUNREACH
+  case ENETUNREACH:  _roar_errno = ROAR_ERROR_NETUNREACH; break
+#endif
+#ifdef ECANCELED
+  case ECANCELED:    _roar_errno = ROAR_ERROR_CANCELED; break
+#endif
+#ifdef EISDIR
+  case EISDIR:       _roar_errno = ROAR_ERROR_ISDIR; break
+#endif
+#ifdef ENOTDIR
+  case ENOTDIR:      _roar_errno = ROAR_ERROR_NOTDIR; break
+#endif
+#ifdef ENOEXEC
+  case ENOEXEC:      _roar_errno = ROAR_ERROR_BADEXEC; break;
+#endif
+#ifdef EISCONN
+  case EISCONN:      _roar_errno = ROAR_ERROR_ISCONN; break;
+#endif
+#ifdef EDEADLK
+  case EDEADLK:      _roar_errno = ROAR_ERROR_DEADLOCK; break;
+#endif
+#ifdef ECONNRESET
+  case ECONNRESET:   _roar_errno = ROAR_ERROR_CONNRST; break;
+#endif
+#ifdef EBADF
+  case EBADF:        _roar_errno = ROAR_ERROR_BADFH; break;
+#endif
+#ifdef ENOTSOCK
+  case ENOTSOCK:     _roar_errno = ROAR_ERROR_NOTSOCK; break;
+#endif
+#ifdef E2BIG
+  case E2BIG:        _roar_errno = ROAR_ERROR_TOOMANYARGS; break;
+#endif
+#ifdef EFBIG
+  case EFBIG:        _roar_errno = ROAR_ERROR_TOOLARGE; break;
+#endif
+#ifdef EDESTADDRREQ
+  case EDESTADDRREQ: _roar_errno = ROAR_ERROR_DESTADDRREQ; break;
+#endif
+#ifdef EAFNOSUPPORT
+  case EAFNOSUPPORT: _roar_errno = ROAR_ERROR_AFNOTSUP; break;
+#endif
+#ifdef ENFILE
+  case ENFILE:       _roar_errno = ROAR_ERROR_NFILE; break;
+#endif
+#ifdef ESTALE
+  case ESTALE:       _roar_errno = ROAR_ERROR_STALE; break;
+#endif
+#ifdef EXDEV
+  case EXDEV:        _roar_errno = ROAR_ERROR_XDEVLINK; break;
+#endif
+#ifdef EMLINK
+  case EMLINK:       _roar_errno = ROAR_ERROR_MLINK; break;
+#endif
+#ifdef ENONET
+  case ENONET:       _roar_errno = ROAR_ERROR_NONET; break;
+#endif
+#ifdef ENETRESET
+  case ENETRESET:    _roar_errno = ROAR_ERROR_CONNRSTNET; break;
+#endif
+#ifdef ECONNABORTED
+  case ECONNABORTED: _roar_errno = ROAR_ERROR_CONNABORTED; break;
+#endif
   default:
     _roar_errno = ROAR_ERROR_UNKNOWN;
@@ -545,4 +626,151 @@
   case ROAR_ERROR_NOHORSE:
     errno = ENOHORSE;
+   break;
+#endif
+#ifdef ETXTBSY
+  case ROAR_ERROR_TEXTBUSY:
+    errno = ETXTBSY;
+   break;
+#endif
+#ifdef ENOTEMPTY
+  case ROAR_ERROR_NOTEMPTY:
+    errno = ENOTEMPTY;
+   break;
+#endif
+#ifdef EHOSTUNREACH
+  case ROAR_ERROR_NODEUNREACH:
+    errno = EHOSTUNREACH;
+   break;
+#endif
+#ifdef EIDRM
+  case ROAR_ERROR_IDREMOVED:
+    errno = EIDRM;
+   break;
+#endif
+#ifdef EINPROGRESS
+  case ROAR_ERROR_INPROGRESS:
+    errno = EINPROGRESS;
+   break;
+#endif
+#ifdef ECHILD
+  case ROAR_ERROR_NOCHILD:
+    errno = ECHILD;
+   break;
+#endif
+#ifdef ENETUNREACH
+  case ROAR_ERROR_NETUNREACH:
+    errno = ENETUNREACH;
+   break;
+#endif
+#ifdef ECANCELED
+  case ROAR_ERROR_CANCELED:
+    errno = ECANCELED;
+   break;
+#endif
+#ifdef EISDIR
+  case ROAR_ERROR_ISDIR:
+    errno = EISDIR;
+   break;
+#endif
+#ifdef ENOTDOR
+  case ROAR_ERROR_NOTDIR:
+    errno = ENOTDIR;
+   break;
+#endif
+#ifdef ENOEXEC
+  case ROAR_ERROR_BADEXEC:
+    errno = ENOEXEC;
+   break;
+#endif
+#ifdef EISCONN
+  case ROAR_ERROR_ISCONN:
+    errno = EISCONN;
+   break;
+#endif
+#ifdef EDEADLK
+  case ROAR_ERROR_DEADLOCK:
+    errno = EDEADLK;
+   break;
+#endif
+#ifdef ECONNRESET
+  case ROAR_ERROR_CONNRST:
+    errno = ECONNRESET;
+   break;
+#endif
+#ifdef EBADF
+  case ROAR_ERROR_BADFH:
+    errno = EBADF;
+   break;
+#endif
+#ifdef ENOTSOCK
+  case ROAR_ERROR_NOTSOCK:
+    errno = ENOTSOCK;
+   break;
+#endif
+#ifdef E2BIG
+  case ROAR_ERROR_TOOMANYARGS:
+    errno = E2BIG;
+   break;
+#endif
+#ifdef EFBIG
+  case ROAR_ERROR_TOOLARGE:
+    errno = EFBIG;
+   break;
+#endif
+#ifdef EDESTADDRREQ
+  case ROAR_ERROR_DESTADDRREQ:
+    errno = EDESTADDRREQ;
+   break;
+#endif
+#ifdef EAFNOSUPPORT
+  case ROAR_ERROR_AFNOTSUP:
+    errno = EAFNOSUPPORT;
+   break;
+#endif
+// FIXME....
+#ifdef ENOPOWER
+  case ROAR_ERROR_NOPOWER:
+    errno = ENOPOWER;
+   break;
+#endif
+#ifdef EUSER
+  case ROAR_ERROR_USER:
+    errno = EUSER;
+   break;
+#endif
+
+#ifdef ENFILE
+  case ROAR_ERROR_NFILE:
+    errno = ENFILE;
+   break;
+#endif
+#ifdef ESTALE
+  case ROAR_ERROR_STALE:
+    errno = ESTALE;
+   break;
+#endif
+#ifdef EXDEV
+  case ROAR_ERROR_XDEVLINK:
+    errno = EXDEV;
+   break;
+#endif
+#ifdef EMLINK
+  case ROAR_ERROR_MLINK:
+    errno = EMLINK;
+   break;
+#endif
+#ifdef ENONET
+  case ROAR_ERROR_NONET:
+    errno = ENONET;
+   break;
+#endif
+#ifdef ENETRESET
+  case ROAR_ERROR_CONNRSTNET:
+    errno = ENETRESET;
+   break;
+#endif
+#ifdef ECONNABORTED
+  case ROAR_ERROR_CONNABORTED:
+    errno = ECONNABORTED;
    break;
 #endif
@@ -623,4 +851,33 @@
   {ROAR_ERROR_CHERNOBYL,   "Fatal device error"},
   {ROAR_ERROR_NOHUG,       "Device needs love"},
+  {ROAR_ERROR_TEXTBUSY,    "Text file busy"},
+  {ROAR_ERROR_NOTEMPTY,    "Directory not empty"},
+  {ROAR_ERROR_NODEUNREACH, "Node is unreachable"},
+  {ROAR_ERROR_IDREMOVED,   "Identifier removed"},
+  {ROAR_ERROR_INPROGRESS,  "Operation in progress"},
+  {ROAR_ERROR_NOCHILD,     "No child processesobject"},
+  {ROAR_ERROR_NETUNREACH,  "Network unreachable"},
+  {ROAR_ERROR_CANCELED,    "Operation canceled"},
+  {ROAR_ERROR_ISDIR,       "Is a directory"},
+  {ROAR_ERROR_NOTDIR,      "Not a directory"},
+  {ROAR_ERROR_BADEXEC,     "Executable file format error"},
+  {ROAR_ERROR_ISCONN,      "SocketObject is connected"},
+  {ROAR_ERROR_DEADLOCK,    "Resource deadlock would occur"},
+  {ROAR_ERROR_CONNRST,     "Connection reset"},
+  {ROAR_ERROR_BADFH,       "Bad file handle"},
+  {ROAR_ERROR_NOTSOCK,     "Not a socket"},
+  {ROAR_ERROR_TOOMANYARGS, "Argument list too long"},
+  {ROAR_ERROR_TOOLARGE,    "FileObject too large"},
+  {ROAR_ERROR_DESTADDRREQ, "Destination address required"},
+  {ROAR_ERROR_AFNOTSUP,    "Address family not supported"},
+  {ROAR_ERROR_NOPOWER,     "Operation can not be completed because we are low on power"},
+  {ROAR_ERROR_USER,        "Error in front of screen"},
+  {ROAR_ERROR_NFILE,       "Too many filesobjects open in system"},
+  {ROAR_ERROR_STALE,       "Stale file handle or object"},
+  {ROAR_ERROR_XDEVLINK,    "Cross-device link"},
+  {ROAR_ERROR_MLINK,       "Too many links to file or object"},
+  {ROAR_ERROR_NONET,       "Not connected to any network"},
+  {ROAR_ERROR_CONNRSTNET,  "Connection reset by network"},
+  {ROAR_ERROR_CONNABORTED, "Connection aborted"},
   {-1, NULL}
  };
