1288917Sroyger#ifndef __XEN_PUBLIC_ERRNO_H__
2288917Sroyger
3288917Sroyger#ifndef __ASSEMBLY__
4288917Sroyger
5288917Sroyger#define XEN_ERRNO(name, value) XEN_##name = value,
6288917Sroygerenum xen_errno {
7288917Sroyger
8288917Sroyger#else /* !__ASSEMBLY__ */
9288917Sroyger
10288917Sroyger#define XEN_ERRNO(name, value) .equ XEN_##name, value
11288917Sroyger
12288917Sroyger#endif /* __ASSEMBLY__ */
13288917Sroyger
14288917Sroyger/* ` enum neg_errnoval {  [ -Efoo for each Efoo in the list below ]  } */
15288917Sroyger/* ` enum errnoval { */
16288917Sroyger
17288917Sroyger#endif /* __XEN_PUBLIC_ERRNO_H__ */
18288917Sroyger
19288917Sroyger#ifdef XEN_ERRNO
20288917Sroyger
21288917Sroyger/*
22288917Sroyger * Values originating from x86 Linux. Please consider using respective
23288917Sroyger * values when adding new definitions here.
24288917Sroyger *
25288917Sroyger * The set of identifiers to be added here shouldn't extend beyond what
26288917Sroyger * POSIX mandates (see e.g.
27288917Sroyger * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html)
28288917Sroyger * with the exception that we support some optional (XSR) values
29288917Sroyger * specified there (but no new ones should be added).
30288917Sroyger */
31288917Sroyger
32288917SroygerXEN_ERRNO(EPERM,	 1)	/* Operation not permitted */
33288917SroygerXEN_ERRNO(ENOENT,	 2)	/* No such file or directory */
34288917SroygerXEN_ERRNO(ESRCH,	 3)	/* No such process */
35288917Sroyger#ifdef __XEN__ /* Internal only, should never be exposed to the guest. */
36288917SroygerXEN_ERRNO(EINTR,	 4)	/* Interrupted system call */
37288917Sroyger#endif
38288917SroygerXEN_ERRNO(EIO,		 5)	/* I/O error */
39288917SroygerXEN_ERRNO(ENXIO,	 6)	/* No such device or address */
40288917SroygerXEN_ERRNO(E2BIG,	 7)	/* Arg list too long */
41288917SroygerXEN_ERRNO(ENOEXEC,	 8)	/* Exec format error */
42288917SroygerXEN_ERRNO(EBADF,	 9)	/* Bad file number */
43288917SroygerXEN_ERRNO(ECHILD,	10)	/* No child processes */
44288917SroygerXEN_ERRNO(EAGAIN,	11)	/* Try again */
45288917SroygerXEN_ERRNO(ENOMEM,	12)	/* Out of memory */
46288917SroygerXEN_ERRNO(EACCES,	13)	/* Permission denied */
47288917SroygerXEN_ERRNO(EFAULT,	14)	/* Bad address */
48288917SroygerXEN_ERRNO(EBUSY,	16)	/* Device or resource busy */
49288917SroygerXEN_ERRNO(EEXIST,	17)	/* File exists */
50288917SroygerXEN_ERRNO(EXDEV,	18)	/* Cross-device link */
51288917SroygerXEN_ERRNO(ENODEV,	19)	/* No such device */
52288917SroygerXEN_ERRNO(EINVAL,	22)	/* Invalid argument */
53288917SroygerXEN_ERRNO(ENFILE,	23)	/* File table overflow */
54288917SroygerXEN_ERRNO(EMFILE,	24)	/* Too many open files */
55288917SroygerXEN_ERRNO(ENOSPC,	28)	/* No space left on device */
56288917SroygerXEN_ERRNO(EMLINK,	31)	/* Too many links */
57288917SroygerXEN_ERRNO(EDOM,		33)	/* Math argument out of domain of func */
58288917SroygerXEN_ERRNO(ERANGE,	34)	/* Math result not representable */
59288917SroygerXEN_ERRNO(EDEADLK,	35)	/* Resource deadlock would occur */
60288917SroygerXEN_ERRNO(ENAMETOOLONG,	36)	/* File name too long */
61288917SroygerXEN_ERRNO(ENOLCK,	37)	/* No record locks available */
62288917SroygerXEN_ERRNO(ENOSYS,	38)	/* Function not implemented */
63288917SroygerXEN_ERRNO(ENODATA,	61)	/* No data available */
64288917SroygerXEN_ERRNO(ETIME,	62)	/* Timer expired */
65288917SroygerXEN_ERRNO(EBADMSG,	74)	/* Not a data message */
66288917SroygerXEN_ERRNO(EOVERFLOW,	75)	/* Value too large for defined data type */
67288917SroygerXEN_ERRNO(EILSEQ,	84)	/* Illegal byte sequence */
68288917Sroyger#ifdef __XEN__ /* Internal only, should never be exposed to the guest. */
69288917SroygerXEN_ERRNO(ERESTART,	85)	/* Interrupted system call should be restarted */
70288917Sroyger#endif
71288917SroygerXEN_ERRNO(ENOTSOCK,	88)	/* Socket operation on non-socket */
72288917SroygerXEN_ERRNO(EOPNOTSUPP,	95)	/* Operation not supported on transport endpoint */
73288917SroygerXEN_ERRNO(EADDRINUSE,	98)	/* Address already in use */
74288917SroygerXEN_ERRNO(EADDRNOTAVAIL, 99)	/* Cannot assign requested address */
75288917SroygerXEN_ERRNO(ENOBUFS,	105)	/* No buffer space available */
76288917SroygerXEN_ERRNO(EISCONN,	106)	/* Transport endpoint is already connected */
77288917SroygerXEN_ERRNO(ENOTCONN,	107)	/* Transport endpoint is not connected */
78288917SroygerXEN_ERRNO(ETIMEDOUT,	110)	/* Connection timed out */
79288917Sroyger
80288917Sroyger#undef XEN_ERRNO
81288917Sroyger#endif /* XEN_ERRNO */
82288917Sroyger
83288917Sroyger#ifndef __XEN_PUBLIC_ERRNO_H__
84288917Sroyger#define __XEN_PUBLIC_ERRNO_H__
85288917Sroyger
86288917Sroyger/* ` } */
87288917Sroyger
88288917Sroyger#ifndef __ASSEMBLY__
89288917Sroyger};
90288917Sroyger#endif
91288917Sroyger
92288917Sroyger#define	XEN_EWOULDBLOCK	XEN_EAGAIN	/* Operation would block */
93288917Sroyger#define	XEN_EDEADLOCK	XEN_EDEADLK	/* Resource deadlock would occur */
94288917Sroyger
95288917Sroyger#endif /*  __XEN_PUBLIC_ERRNO_H__ */
96