Don't call ReadArgs() if started from WB.
[tangerine.git] / compiler / clib / __ioerr2errno.c
blob735d34f08bdd52b5c6c20e6d48f4dff9e7635149
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: errno internals
6 Lang: english
7 */
9 #include <dos/dos.h>
10 #include <dos/dosasl.h>
11 #include <dos/filesystem.h>
12 #include "__errno.h"
14 int IoErr2errno (int ioerr)
16 switch (ioerr)
18 case 0:
19 return 0;
21 case ERROR_OBJECT_WRONG_TYPE:
22 return EINVAL;
24 case ERROR_NO_FREE_STORE:
25 return ENOMEM;
27 case ERROR_DEVICE_NOT_MOUNTED:
28 case ERROR_OBJECT_NOT_FOUND:
29 return ENOENT;
31 case ERROR_WOULD_BLOCK:
32 return EAGAIN;
34 case ERROR_BROKEN_PIPE:
35 return EPIPE;
37 case ERROR_OBJECT_EXISTS:
38 return EEXIST;
40 case ERROR_BUFFER_OVERFLOW:
41 return ENOBUFS;
43 case ERROR_BREAK:
44 return EINTR;
46 case ERROR_FILE_NOT_OBJECT:
47 case ERROR_NOT_EXECUTABLE:
48 return ENOEXEC;
50 case ERROR_OBJECT_IN_USE:
51 return EBUSY;
53 case ERROR_DIR_NOT_FOUND:
54 return ENOTDIR;
57 return MAX_ERRNO+ioerr;
58 } /* IoErr2errno */