1 |
39 |
lampret |
/*
|
2 |
|
|
** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
|
3 |
|
|
**
|
4 |
|
|
** This file is distributed under the terms listed in the document
|
5 |
|
|
** "copying.dj", available from DJ Delorie at the address above.
|
6 |
|
|
** A copy of "copying.dj" should accompany this file; if not, a copy
|
7 |
|
|
** should be available from where this file was obtained. This file
|
8 |
|
|
** may not be distributed without a verbatim copy of "copying.dj".
|
9 |
|
|
**
|
10 |
|
|
** This file is distributed WITHOUT ANY WARRANTY; without even the implied
|
11 |
|
|
** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
12 |
|
|
*/
|
13 |
|
|
|
14 |
|
|
/* ??? This file has been modified to work with newlib's way of storing
|
15 |
|
|
`errno'. Arguably there's no need and arguably we shouldn't diverge
|
16 |
|
|
from go32 sources. If you feel strongly about it, please change it.
|
17 |
|
|
The interface between newlib and system's version of errno is via
|
18 |
|
|
__errno, so there's no problem in storing errno in a different place
|
19 |
|
|
(any changes can be dealt with inside __errno). */
|
20 |
|
|
|
21 |
|
|
#ifndef _SYS_ERRNO_H_
|
22 |
|
|
#define _SYS_ERRNO_H_
|
23 |
|
|
|
24 |
|
|
#ifdef __cplusplus
|
25 |
|
|
extern "C" {
|
26 |
|
|
#endif
|
27 |
|
|
|
28 |
|
|
#include <sys/reent.h>
|
29 |
|
|
|
30 |
|
|
#ifndef _REENT_ONLY
|
31 |
|
|
#define errno (*__errno())
|
32 |
|
|
extern int *__errno _PARAMS ((void));
|
33 |
|
|
#endif
|
34 |
|
|
|
35 |
|
|
#define __errno_r(ptr) ((ptr)->_errno)
|
36 |
|
|
|
37 |
|
|
#define ENOENT 2 /* No such file or directory */
|
38 |
|
|
#define ENOTDIR 3 /* No path */
|
39 |
|
|
#define EMFILE 4 /* Too many open files */
|
40 |
|
|
#define EACCES 5 /* Permission denied */
|
41 |
|
|
#define EBADF 6 /* Bad file number */
|
42 |
|
|
#define EARENA 7 /* Arena trashed */
|
43 |
|
|
#define ENOMEM 8 /* Not enough core */
|
44 |
|
|
#define ESEGV 9 /* invalid memory address */
|
45 |
|
|
#define EBADENV 10 /* invalid environment */
|
46 |
|
|
#define ENODEV 15 /* No such device */
|
47 |
|
|
#define ENMFILE 18 /* No more files */
|
48 |
|
|
#define EINVAL 19 /* Invalid argument */
|
49 |
|
|
#define E2BIG EBADENV /* Arg list too long */
|
50 |
|
|
#define ENOEXEC 21 /* Exec format error */
|
51 |
|
|
#define EXDEV 17 /* Cross-device link */
|
52 |
|
|
#define EPIPE 32 /* POHC */
|
53 |
|
|
#define EDOM 33 /* Math argument */
|
54 |
|
|
#define ERANGE 34 /* Result too large */
|
55 |
|
|
#if 0 /* readline.c assumes that if this is defined, so is O_NDELAY.
|
56 |
|
|
Newlib doesn't use it, so comment it out. */
|
57 |
|
|
#define EWOULDBLOCK 35 /* POHC */
|
58 |
|
|
#endif
|
59 |
|
|
#define EEXIST 36 /* File already exists */
|
60 |
|
|
#define EINTR 100 /* Interrupted system call */
|
61 |
|
|
#define EIO 101 /* I/O or bounds error */
|
62 |
|
|
#define ENOSPC 102 /* No space left on drive */
|
63 |
|
|
#define EAGAIN 103 /* No more processes */
|
64 |
|
|
#define ECHILD 200 /* child exited (porting only) */
|
65 |
|
|
#define EFAULT 201 /* bad address */
|
66 |
|
|
#define ENXIO ENODEV
|
67 |
|
|
#define EPERM EACCES
|
68 |
|
|
|
69 |
|
|
/* New values required by newlib and the Cygnus toolchain. */
|
70 |
|
|
#define ENOSYS 230 /* Function not implemented */
|
71 |
|
|
#define ESPIPE 231 /* Illegal seek */
|
72 |
|
|
|
73 |
|
|
#endif
|