compiler/clib/__arosc_privdata.h: Don't include "__vfork.h"
[AROS.git] / compiler / clib / __ioerr2errno.c
blob5fff2bc9169d1255fc823f69b90d09ad97e86327
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 "__errno.h"
13 int IoErr2errno (int ioerr)
15 switch (ioerr)
17 case 0:
18 return 0;
20 case ERROR_OBJECT_WRONG_TYPE:
21 return EINVAL;
23 case ERROR_NO_FREE_STORE:
24 return ENOMEM;
26 case ERROR_DEVICE_NOT_MOUNTED:
27 case ERROR_OBJECT_NOT_FOUND:
28 return ENOENT;
30 case ERROR_OBJECT_EXISTS:
31 return EEXIST;
33 case ERROR_BUFFER_OVERFLOW:
34 return ENOBUFS;
36 case ERROR_BREAK:
37 return EINTR;
39 case ERROR_FILE_NOT_OBJECT:
40 case ERROR_NOT_EXECUTABLE:
41 return ENOEXEC;
43 case ERROR_OBJECT_IN_USE:
44 return EBUSY;
46 case ERROR_DIR_NOT_FOUND:
47 return ENOTDIR;
49 case ERROR_RENAME_ACROSS_DEVICES:
50 return EXDEV;
53 return MAX_ERRNO+ioerr;
54 } /* IoErr2errno */