fix targets
[AROS.git] / compiler / stdc / __stdc_ioerr2errno.c
blob4ee9dfd35b9ee00d53839a628c6875d68e8e751c
1 /*
2 Copyright © 1995-2012, 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 __stdc_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 } /* __stdc_ioerr2errno */