106b79f55SAugustin Cavalier/*
206b79f55SAugustin Cavalier * Copyright 2007-2014 Haiku, Inc. All rights reserved.
306b79f55SAugustin Cavalier * Distributed under the terms of the MIT License.
406b79f55SAugustin Cavalier */
55e19679eSAugustin Cavalier#ifndef _BUILD_ERRORS_H
65e19679eSAugustin Cavalier#define _BUILD_ERRORS_H
7338b8dc3SIngo Weinhold
806b79f55SAugustin Cavalier
906b79f55SAugustin Cavalier#include <errno.h> /* build-specific overrides errno */
10338b8dc3SIngo Weinhold#include <limits.h>
11338b8dc3SIngo Weinhold
12338b8dc3SIngo Weinhold
1306b79f55SAugustin Cavalier/* Error baselines */
142d6d5298SJérôme Duval#define B_GENERAL_ERROR_BASE		INT_MIN
1506b79f55SAugustin Cavalier#define B_OS_ERROR_BASE				(B_GENERAL_ERROR_BASE + 0x1000)
1606b79f55SAugustin Cavalier#define B_APP_ERROR_BASE			(B_GENERAL_ERROR_BASE + 0x2000)
1706b79f55SAugustin Cavalier#define B_INTERFACE_ERROR_BASE		(B_GENERAL_ERROR_BASE + 0x3000)
1806b79f55SAugustin Cavalier#define B_MEDIA_ERROR_BASE			(B_GENERAL_ERROR_BASE + 0x4000)
1906b79f55SAugustin Cavalier										/* - 0x41ff */
2006b79f55SAugustin Cavalier#define B_TRANSLATION_ERROR_BASE	(B_GENERAL_ERROR_BASE + 0x4800)
2106b79f55SAugustin Cavalier										/* - 0x48ff */
2206b79f55SAugustin Cavalier#define B_MIDI_ERROR_BASE			(B_GENERAL_ERROR_BASE + 0x5000)
2306b79f55SAugustin Cavalier#define B_STORAGE_ERROR_BASE		(B_GENERAL_ERROR_BASE + 0x6000)
2406b79f55SAugustin Cavalier#define B_POSIX_ERROR_BASE			(B_GENERAL_ERROR_BASE + 0x7000)
2506b79f55SAugustin Cavalier#define B_MAIL_ERROR_BASE			(B_GENERAL_ERROR_BASE + 0x8000)
2606b79f55SAugustin Cavalier#define B_PRINT_ERROR_BASE			(B_GENERAL_ERROR_BASE + 0x9000)
2706b79f55SAugustin Cavalier#define B_DEVICE_ERROR_BASE			(B_GENERAL_ERROR_BASE + 0xa000)
2806b79f55SAugustin Cavalier
2906b79f55SAugustin Cavalier/* Developer-defined errors start at (B_ERRORS_END+1) */
3006b79f55SAugustin Cavalier#define B_ERRORS_END				(B_GENERAL_ERROR_BASE + 0xffff)
3106b79f55SAugustin Cavalier
3206b79f55SAugustin Cavalier/* General Errors */
3306b79f55SAugustin Cavalier#define B_NO_MEMORY					(B_GENERAL_ERROR_BASE + 0)
3406b79f55SAugustin Cavalier#define B_IO_ERROR					(B_GENERAL_ERROR_BASE + 1)
3506b79f55SAugustin Cavalier#define B_PERMISSION_DENIED			(B_GENERAL_ERROR_BASE + 2)
3606b79f55SAugustin Cavalier#define B_BAD_INDEX					(B_GENERAL_ERROR_BASE + 3)
3706b79f55SAugustin Cavalier#define B_BAD_TYPE					(B_GENERAL_ERROR_BASE + 4)
3806b79f55SAugustin Cavalier#define B_BAD_VALUE					(B_GENERAL_ERROR_BASE + 5)
3906b79f55SAugustin Cavalier#define B_MISMATCHED_VALUES			(B_GENERAL_ERROR_BASE + 6)
4006b79f55SAugustin Cavalier#define B_NAME_NOT_FOUND			(B_GENERAL_ERROR_BASE + 7)
4106b79f55SAugustin Cavalier#define B_NAME_IN_USE				(B_GENERAL_ERROR_BASE + 8)
4206b79f55SAugustin Cavalier#define B_TIMED_OUT					(B_GENERAL_ERROR_BASE + 9)
4306b79f55SAugustin Cavalier#define B_INTERRUPTED				(B_GENERAL_ERROR_BASE + 10)
4406b79f55SAugustin Cavalier#define B_WOULD_BLOCK				(B_GENERAL_ERROR_BASE + 11)
4506b79f55SAugustin Cavalier#define B_CANCELED					(B_GENERAL_ERROR_BASE + 12)
4606b79f55SAugustin Cavalier#define B_NO_INIT					(B_GENERAL_ERROR_BASE + 13)
4706b79f55SAugustin Cavalier#define B_NOT_INITIALIZED			(B_GENERAL_ERROR_BASE + 13)
4806b79f55SAugustin Cavalier#define B_BUSY						(B_GENERAL_ERROR_BASE + 14)
4906b79f55SAugustin Cavalier#define B_NOT_ALLOWED				(B_GENERAL_ERROR_BASE + 15)
5006b79f55SAugustin Cavalier#define B_BAD_DATA					(B_GENERAL_ERROR_BASE + 16)
5106b79f55SAugustin Cavalier#define B_DONT_DO_THAT				(B_GENERAL_ERROR_BASE + 17)
5206b79f55SAugustin Cavalier
5306b79f55SAugustin Cavalier#define B_ERROR						(-1)
5406b79f55SAugustin Cavalier#define B_OK						((int)0)
5506b79f55SAugustin Cavalier#define B_NO_ERROR					((int)0)
5606b79f55SAugustin Cavalier
5706b79f55SAugustin Cavalier/* Kernel Kit Errors */
5806b79f55SAugustin Cavalier#define B_BAD_SEM_ID				(B_OS_ERROR_BASE + 0)
5906b79f55SAugustin Cavalier#define B_NO_MORE_SEMS				(B_OS_ERROR_BASE + 1)
6006b79f55SAugustin Cavalier
6106b79f55SAugustin Cavalier#define B_BAD_THREAD_ID				(B_OS_ERROR_BASE + 0x100)
6206b79f55SAugustin Cavalier#define B_NO_MORE_THREADS			(B_OS_ERROR_BASE + 0x101)
6306b79f55SAugustin Cavalier#define B_BAD_THREAD_STATE			(B_OS_ERROR_BASE + 0x102)
6406b79f55SAugustin Cavalier#define B_BAD_TEAM_ID				(B_OS_ERROR_BASE + 0x103)
6506b79f55SAugustin Cavalier#define B_NO_MORE_TEAMS				(B_OS_ERROR_BASE + 0x104)
6606b79f55SAugustin Cavalier
6706b79f55SAugustin Cavalier#define B_BAD_PORT_ID				(B_OS_ERROR_BASE + 0x200)
6806b79f55SAugustin Cavalier#define B_NO_MORE_PORTS				(B_OS_ERROR_BASE + 0x201)
6906b79f55SAugustin Cavalier
7006b79f55SAugustin Cavalier#define B_BAD_IMAGE_ID				(B_OS_ERROR_BASE + 0x300)
7106b79f55SAugustin Cavalier#define B_BAD_ADDRESS				(B_OS_ERROR_BASE + 0x301)
7206b79f55SAugustin Cavalier#define B_NOT_AN_EXECUTABLE			(B_OS_ERROR_BASE + 0x302)
7306b79f55SAugustin Cavalier#define B_MISSING_LIBRARY			(B_OS_ERROR_BASE + 0x303)
7406b79f55SAugustin Cavalier#define B_MISSING_SYMBOL			(B_OS_ERROR_BASE + 0x304)
7506b79f55SAugustin Cavalier#define B_UNKNOWN_EXECUTABLE		(B_OS_ERROR_BASE + 0x305)
7606b79f55SAugustin Cavalier#define B_LEGACY_EXECUTABLE			(B_OS_ERROR_BASE + 0x306)
7706b79f55SAugustin Cavalier
7806b79f55SAugustin Cavalier#define B_DEBUGGER_ALREADY_INSTALLED	(B_OS_ERROR_BASE + 0x400)
7906b79f55SAugustin Cavalier
8006b79f55SAugustin Cavalier/* Application Kit Errors */
8106b79f55SAugustin Cavalier#define B_BAD_REPLY							(B_APP_ERROR_BASE + 0)
8206b79f55SAugustin Cavalier#define B_DUPLICATE_REPLY					(B_APP_ERROR_BASE + 1)
8306b79f55SAugustin Cavalier#define B_MESSAGE_TO_SELF					(B_APP_ERROR_BASE + 2)
8406b79f55SAugustin Cavalier#define B_BAD_HANDLER						(B_APP_ERROR_BASE + 3)
8506b79f55SAugustin Cavalier#define B_ALREADY_RUNNING					(B_APP_ERROR_BASE + 4)
8606b79f55SAugustin Cavalier#define B_LAUNCH_FAILED						(B_APP_ERROR_BASE + 5)
8706b79f55SAugustin Cavalier#define B_AMBIGUOUS_APP_LAUNCH				(B_APP_ERROR_BASE + 6)
8806b79f55SAugustin Cavalier#define B_UNKNOWN_MIME_TYPE					(B_APP_ERROR_BASE + 7)
8906b79f55SAugustin Cavalier#define B_BAD_SCRIPT_SYNTAX					(B_APP_ERROR_BASE + 8)
9006b79f55SAugustin Cavalier#define B_LAUNCH_FAILED_NO_RESOLVE_LINK		(B_APP_ERROR_BASE + 9)
9106b79f55SAugustin Cavalier#define B_LAUNCH_FAILED_EXECUTABLE			(B_APP_ERROR_BASE + 10)
9206b79f55SAugustin Cavalier#define B_LAUNCH_FAILED_APP_NOT_FOUND		(B_APP_ERROR_BASE + 11)
9306b79f55SAugustin Cavalier#define B_LAUNCH_FAILED_APP_IN_TRASH		(B_APP_ERROR_BASE + 12)
9406b79f55SAugustin Cavalier#define B_LAUNCH_FAILED_NO_PREFERRED_APP	(B_APP_ERROR_BASE + 13)
9506b79f55SAugustin Cavalier#define B_LAUNCH_FAILED_FILES_APP_NOT_FOUND	(B_APP_ERROR_BASE + 14)
9606b79f55SAugustin Cavalier#define B_BAD_MIME_SNIFFER_RULE				(B_APP_ERROR_BASE + 15)
9706b79f55SAugustin Cavalier#define B_NOT_A_MESSAGE						(B_APP_ERROR_BASE + 16)
9806b79f55SAugustin Cavalier#define B_SHUTDOWN_CANCELLED				(B_APP_ERROR_BASE + 17)
9906b79f55SAugustin Cavalier#define B_SHUTTING_DOWN						(B_APP_ERROR_BASE + 18)
10006b79f55SAugustin Cavalier
10106b79f55SAugustin Cavalier/* Storage Kit/File System Errors */
10206b79f55SAugustin Cavalier#define B_FILE_ERROR						(B_STORAGE_ERROR_BASE + 0)
10306b79f55SAugustin Cavalier#define B_FILE_NOT_FOUND					(B_STORAGE_ERROR_BASE + 1)
10406b79f55SAugustin Cavalier			/* deprecated: use B_ENTRY_NOT_FOUND instead */
10506b79f55SAugustin Cavalier#define B_FILE_EXISTS						(B_STORAGE_ERROR_BASE + 2)
10606b79f55SAugustin Cavalier#define B_ENTRY_NOT_FOUND					(B_STORAGE_ERROR_BASE + 3)
10706b79f55SAugustin Cavalier#define B_NAME_TOO_LONG						(B_STORAGE_ERROR_BASE + 4)
10806b79f55SAugustin Cavalier#define B_NOT_A_DIRECTORY					(B_STORAGE_ERROR_BASE + 5)
10906b79f55SAugustin Cavalier#define B_DIRECTORY_NOT_EMPTY				(B_STORAGE_ERROR_BASE + 6)
11006b79f55SAugustin Cavalier#define B_DEVICE_FULL						(B_STORAGE_ERROR_BASE + 7)
11106b79f55SAugustin Cavalier#define B_READ_ONLY_DEVICE					(B_STORAGE_ERROR_BASE + 8)
11206b79f55SAugustin Cavalier#define B_IS_A_DIRECTORY					(B_STORAGE_ERROR_BASE + 9)
11306b79f55SAugustin Cavalier#define B_NO_MORE_FDS						(B_STORAGE_ERROR_BASE + 10)
11406b79f55SAugustin Cavalier#define B_CROSS_DEVICE_LINK					(B_STORAGE_ERROR_BASE + 11)
11506b79f55SAugustin Cavalier#define B_LINK_LIMIT						(B_STORAGE_ERROR_BASE + 12)
11606b79f55SAugustin Cavalier#define B_BUSTED_PIPE						(B_STORAGE_ERROR_BASE + 13)
11706b79f55SAugustin Cavalier#define B_UNSUPPORTED						(B_STORAGE_ERROR_BASE + 14)
11806b79f55SAugustin Cavalier#define B_PARTITION_TOO_SMALL				(B_STORAGE_ERROR_BASE + 15)
11906b79f55SAugustin Cavalier#define B_PARTIAL_READ						(B_STORAGE_ERROR_BASE + 16)
12006b79f55SAugustin Cavalier#define B_PARTIAL_WRITE						(B_STORAGE_ERROR_BASE + 17)
12106b79f55SAugustin Cavalier
12206b79f55SAugustin Cavalier/* POSIX Errors */
12306b79f55SAugustin Cavalier#define B_TO_POSIX_ERROR(error)		(error)
12406b79f55SAugustin Cavalier#define B_FROM_POSIX_ERROR(error)	(error)
12506b79f55SAugustin Cavalier
12606b79f55SAugustin Cavalier#define B_POSIX_ENOMEM		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 0)
12706b79f55SAugustin Cavalier#define HAIKU_E2BIG			B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 1)
12806b79f55SAugustin Cavalier#define HAIKU_ECHILD		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 2)
12906b79f55SAugustin Cavalier#define HAIKU_EDEADLK		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 3)
13006b79f55SAugustin Cavalier#define HAIKU_EFBIG			B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 4)
13106b79f55SAugustin Cavalier#define HAIKU_EMLINK		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 5)
13206b79f55SAugustin Cavalier#define HAIKU_ENFILE		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 6)
13306b79f55SAugustin Cavalier#define HAIKU_ENODEV		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 7)
13406b79f55SAugustin Cavalier#define HAIKU_ENOLCK		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 8)
13506b79f55SAugustin Cavalier#define HAIKU_ENOSYS		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 9)
13606b79f55SAugustin Cavalier#define HAIKU_ENOTTY		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 10)
13706b79f55SAugustin Cavalier#define HAIKU_ENXIO			B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 11)
13806b79f55SAugustin Cavalier#define HAIKU_ESPIPE		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 12)
13906b79f55SAugustin Cavalier#define HAIKU_ESRCH			B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 13)
14006b79f55SAugustin Cavalier#define HAIKU_EFPOS			B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 14)
14106b79f55SAugustin Cavalier#define HAIKU_ESIGPARM		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 15)
14206b79f55SAugustin Cavalier#define HAIKU_EDOM			B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 16)
14306b79f55SAugustin Cavalier#define HAIKU_ERANGE		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 17)
14406b79f55SAugustin Cavalier#define HAIKU_EPROTOTYPE	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 18)
14506b79f55SAugustin Cavalier#define HAIKU_EPROTONOSUPPORT	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 19)
14606b79f55SAugustin Cavalier#define HAIKU_EPFNOSUPPORT	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 20)
14706b79f55SAugustin Cavalier#define HAIKU_EAFNOSUPPORT	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 21)
14806b79f55SAugustin Cavalier#define HAIKU_EADDRINUSE	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 22)
14906b79f55SAugustin Cavalier#define HAIKU_EADDRNOTAVAIL	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 23)
15006b79f55SAugustin Cavalier#define HAIKU_ENETDOWN		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 24)
15106b79f55SAugustin Cavalier#define HAIKU_ENETUNREACH	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 25)
15206b79f55SAugustin Cavalier#define HAIKU_ENETRESET		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 26)
15306b79f55SAugustin Cavalier#define HAIKU_ECONNABORTED	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 27)
15406b79f55SAugustin Cavalier#define HAIKU_ECONNRESET	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 28)
15506b79f55SAugustin Cavalier#define HAIKU_EISCONN		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 29)
15606b79f55SAugustin Cavalier#define HAIKU_ENOTCONN		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 30)
15706b79f55SAugustin Cavalier#define HAIKU_ESHUTDOWN		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 31)
15806b79f55SAugustin Cavalier#define HAIKU_ECONNREFUSED	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 32)
15906b79f55SAugustin Cavalier#define HAIKU_EHOSTUNREACH	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 33)
16006b79f55SAugustin Cavalier#define HAIKU_ENOPROTOOPT	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 34)
16106b79f55SAugustin Cavalier#define HAIKU_ENOBUFS		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 35)
16206b79f55SAugustin Cavalier#define HAIKU_EINPROGRESS	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 36)
16306b79f55SAugustin Cavalier#define HAIKU_EALREADY		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 37)
16406b79f55SAugustin Cavalier#define HAIKU_EILSEQ		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 38)
16506b79f55SAugustin Cavalier#define HAIKU_ENOMSG		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 39)
16606b79f55SAugustin Cavalier#define HAIKU_ESTALE		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 40)
16706b79f55SAugustin Cavalier#define HAIKU_EOVERFLOW		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 41)
16806b79f55SAugustin Cavalier#define HAIKU_EMSGSIZE		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 42)
16906b79f55SAugustin Cavalier#define HAIKU_EOPNOTSUPP	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 43)
17006b79f55SAugustin Cavalier#define HAIKU_ENOTSOCK		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 44)
17106b79f55SAugustin Cavalier#define HAIKU_EHOSTDOWN		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 45)
17206b79f55SAugustin Cavalier#define HAIKU_EBADMSG		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 46)
17306b79f55SAugustin Cavalier#define HAIKU_ECANCELED		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 47)
17406b79f55SAugustin Cavalier#define HAIKU_EDESTADDRREQ	B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 48)
17506b79f55SAugustin Cavalier#define HAIKU_EDQUOT		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 49)
17606b79f55SAugustin Cavalier#define HAIKU_EIDRM			B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 50)
17706b79f55SAugustin Cavalier#define HAIKU_EMULTIHOP		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 51)
17806b79f55SAugustin Cavalier#define HAIKU_ENODATA		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 52)
17906b79f55SAugustin Cavalier#define HAIKU_ENOLINK		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 53)
18006b79f55SAugustin Cavalier#define HAIKU_ENOSR			B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 54)
18106b79f55SAugustin Cavalier#define HAIKU_ENOSTR		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 55)
18206b79f55SAugustin Cavalier#define HAIKU_ENOTSUP		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 56)
18306b79f55SAugustin Cavalier#define HAIKU_EPROTO		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 57)
18406b79f55SAugustin Cavalier#define HAIKU_ETIME			B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 58)
18506b79f55SAugustin Cavalier#define HAIKU_ETXTBSY		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 59)
18606b79f55SAugustin Cavalier#define HAIKU_ENOATTR		B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 60)
18706b79f55SAugustin Cavalier
18806b79f55SAugustin Cavalier/* B_NO_MEMORY (0x80000000) can't be negated, so it needs special handling */
18906b79f55SAugustin Cavalier#define HAIKU_ENOMEM		B_NO_MEMORY
19006b79f55SAugustin Cavalier
19106b79f55SAugustin Cavalier/* POSIX errors that can be mapped to BeOS error codes */
19206b79f55SAugustin Cavalier#define HAIKU_EACCES		B_TO_POSIX_ERROR(B_PERMISSION_DENIED)
19306b79f55SAugustin Cavalier#define HAIKU_EINTR			B_TO_POSIX_ERROR(B_INTERRUPTED)
19406b79f55SAugustin Cavalier#define HAIKU_EIO			B_TO_POSIX_ERROR(B_IO_ERROR)
19506b79f55SAugustin Cavalier#define HAIKU_EBUSY			B_TO_POSIX_ERROR(B_BUSY)
19606b79f55SAugustin Cavalier#define HAIKU_EFAULT		B_TO_POSIX_ERROR(B_BAD_ADDRESS)
19706b79f55SAugustin Cavalier#define HAIKU_ETIMEDOUT		B_TO_POSIX_ERROR(B_TIMED_OUT)
19806b79f55SAugustin Cavalier#define HAIKU_EAGAIN 		B_TO_POSIX_ERROR(B_WOULD_BLOCK)	/* SysV compatibility */
19906b79f55SAugustin Cavalier#define HAIKU_EWOULDBLOCK 	B_TO_POSIX_ERROR(B_WOULD_BLOCK)	/* BSD compatibility */
20006b79f55SAugustin Cavalier#define HAIKU_EBADF			B_TO_POSIX_ERROR(B_FILE_ERROR)
20106b79f55SAugustin Cavalier#define HAIKU_EEXIST		B_TO_POSIX_ERROR(B_FILE_EXISTS)
20206b79f55SAugustin Cavalier#define HAIKU_EINVAL		B_TO_POSIX_ERROR(B_BAD_VALUE)
20306b79f55SAugustin Cavalier#define HAIKU_ENAMETOOLONG	B_TO_POSIX_ERROR(B_NAME_TOO_LONG)
20406b79f55SAugustin Cavalier#define HAIKU_ENOENT		B_TO_POSIX_ERROR(B_ENTRY_NOT_FOUND)
20506b79f55SAugustin Cavalier#define HAIKU_EPERM			B_TO_POSIX_ERROR(B_NOT_ALLOWED)
20606b79f55SAugustin Cavalier#define HAIKU_ENOTDIR		B_TO_POSIX_ERROR(B_NOT_A_DIRECTORY)
20706b79f55SAugustin Cavalier#define HAIKU_EISDIR		B_TO_POSIX_ERROR(B_IS_A_DIRECTORY)
20806b79f55SAugustin Cavalier#define HAIKU_ENOTEMPTY		B_TO_POSIX_ERROR(B_DIRECTORY_NOT_EMPTY)
20906b79f55SAugustin Cavalier#define HAIKU_ENOSPC		B_TO_POSIX_ERROR(B_DEVICE_FULL)
21006b79f55SAugustin Cavalier#define HAIKU_EROFS			B_TO_POSIX_ERROR(B_READ_ONLY_DEVICE)
21106b79f55SAugustin Cavalier#define HAIKU_EMFILE		B_TO_POSIX_ERROR(B_NO_MORE_FDS)
21206b79f55SAugustin Cavalier#define HAIKU_EXDEV			B_TO_POSIX_ERROR(B_CROSS_DEVICE_LINK)
21306b79f55SAugustin Cavalier#define HAIKU_ELOOP			B_TO_POSIX_ERROR(B_LINK_LIMIT)
21406b79f55SAugustin Cavalier#define HAIKU_ENOEXEC		B_TO_POSIX_ERROR(B_NOT_AN_EXECUTABLE)
21506b79f55SAugustin Cavalier#define HAIKU_EPIPE			B_TO_POSIX_ERROR(B_BUSTED_PIPE)
21606b79f55SAugustin Cavalier
21706b79f55SAugustin Cavalier/* new error codes that can be mapped to POSIX errors */
218b5c220fbSAugustin Cavalier#ifndef BUILDING_HAIKU_ERROR_MAPPER
21906b79f55SAugustin Cavalier#define B_BUFFER_OVERFLOW			B_FROM_POSIX_ERROR(HAIKU_EOVERFLOW)
22006b79f55SAugustin Cavalier#define B_TOO_MANY_ARGS				B_FROM_POSIX_ERROR(HAIKU_E2BIG)
22106b79f55SAugustin Cavalier#define B_FILE_TOO_LARGE			B_FROM_POSIX_ERROR(HAIKU_EFBIG)
22206b79f55SAugustin Cavalier#define B_RESULT_NOT_REPRESENTABLE	B_FROM_POSIX_ERROR(HAIKU_ERANGE)
22306b79f55SAugustin Cavalier#define B_DEVICE_NOT_FOUND			B_FROM_POSIX_ERROR(HAIKU_ENODEV)
22406b79f55SAugustin Cavalier#define B_NOT_SUPPORTED				B_FROM_POSIX_ERROR(HAIKU_EOPNOTSUPP)
225b5c220fbSAugustin Cavalier#endif
22606b79f55SAugustin Cavalier
22706b79f55SAugustin Cavalier/* Media Kit Errors */
22806b79f55SAugustin Cavalier#define B_STREAM_NOT_FOUND				(B_MEDIA_ERROR_BASE + 0)
22906b79f55SAugustin Cavalier#define B_SERVER_NOT_FOUND				(B_MEDIA_ERROR_BASE + 1)
23006b79f55SAugustin Cavalier#define B_RESOURCE_NOT_FOUND			(B_MEDIA_ERROR_BASE + 2)
23106b79f55SAugustin Cavalier#define B_RESOURCE_UNAVAILABLE			(B_MEDIA_ERROR_BASE + 3)
23206b79f55SAugustin Cavalier#define B_BAD_SUBSCRIBER				(B_MEDIA_ERROR_BASE + 4)
23306b79f55SAugustin Cavalier#define B_SUBSCRIBER_NOT_ENTERED		(B_MEDIA_ERROR_BASE + 5)
23406b79f55SAugustin Cavalier#define B_BUFFER_NOT_AVAILABLE			(B_MEDIA_ERROR_BASE + 6)
23506b79f55SAugustin Cavalier#define B_LAST_BUFFER_ERROR				(B_MEDIA_ERROR_BASE + 7)
23606b79f55SAugustin Cavalier
23706b79f55SAugustin Cavalier#define B_MEDIA_SYSTEM_FAILURE			(B_MEDIA_ERROR_BASE + 100)
23806b79f55SAugustin Cavalier#define B_MEDIA_BAD_NODE				(B_MEDIA_ERROR_BASE + 101)
23906b79f55SAugustin Cavalier#define B_MEDIA_NODE_BUSY				(B_MEDIA_ERROR_BASE + 102)
24006b79f55SAugustin Cavalier#define B_MEDIA_BAD_FORMAT				(B_MEDIA_ERROR_BASE + 103)
24106b79f55SAugustin Cavalier#define B_MEDIA_BAD_BUFFER				(B_MEDIA_ERROR_BASE + 104)
24206b79f55SAugustin Cavalier#define B_MEDIA_TOO_MANY_NODES			(B_MEDIA_ERROR_BASE + 105)
24306b79f55SAugustin Cavalier#define B_MEDIA_TOO_MANY_BUFFERS		(B_MEDIA_ERROR_BASE + 106)
24406b79f55SAugustin Cavalier#define B_MEDIA_NODE_ALREADY_EXISTS		(B_MEDIA_ERROR_BASE + 107)
24506b79f55SAugustin Cavalier#define B_MEDIA_BUFFER_ALREADY_EXISTS	(B_MEDIA_ERROR_BASE + 108)
24606b79f55SAugustin Cavalier#define B_MEDIA_CANNOT_SEEK				(B_MEDIA_ERROR_BASE + 109)
24706b79f55SAugustin Cavalier#define B_MEDIA_CANNOT_CHANGE_RUN_MODE	(B_MEDIA_ERROR_BASE + 110)
24806b79f55SAugustin Cavalier#define B_MEDIA_APP_ALREADY_REGISTERED	(B_MEDIA_ERROR_BASE + 111)
24906b79f55SAugustin Cavalier#define B_MEDIA_APP_NOT_REGISTERED		(B_MEDIA_ERROR_BASE + 112)
25006b79f55SAugustin Cavalier#define B_MEDIA_CANNOT_RECLAIM_BUFFERS	(B_MEDIA_ERROR_BASE + 113)
25106b79f55SAugustin Cavalier#define B_MEDIA_BUFFERS_NOT_RECLAIMED	(B_MEDIA_ERROR_BASE + 114)
25206b79f55SAugustin Cavalier#define B_MEDIA_TIME_SOURCE_STOPPED		(B_MEDIA_ERROR_BASE + 115)
25306b79f55SAugustin Cavalier#define B_MEDIA_TIME_SOURCE_BUSY		(B_MEDIA_ERROR_BASE + 116)
25406b79f55SAugustin Cavalier#define B_MEDIA_BAD_SOURCE				(B_MEDIA_ERROR_BASE + 117)
25506b79f55SAugustin Cavalier#define B_MEDIA_BAD_DESTINATION			(B_MEDIA_ERROR_BASE + 118)
25606b79f55SAugustin Cavalier#define B_MEDIA_ALREADY_CONNECTED		(B_MEDIA_ERROR_BASE + 119)
25706b79f55SAugustin Cavalier#define B_MEDIA_NOT_CONNECTED			(B_MEDIA_ERROR_BASE + 120)
25806b79f55SAugustin Cavalier#define B_MEDIA_BAD_CLIP_FORMAT			(B_MEDIA_ERROR_BASE + 121)
25906b79f55SAugustin Cavalier#define B_MEDIA_ADDON_FAILED			(B_MEDIA_ERROR_BASE + 122)
26006b79f55SAugustin Cavalier#define B_MEDIA_ADDON_DISABLED			(B_MEDIA_ERROR_BASE + 123)
26106b79f55SAugustin Cavalier#define B_MEDIA_CHANGE_IN_PROGRESS		(B_MEDIA_ERROR_BASE + 124)
26206b79f55SAugustin Cavalier#define B_MEDIA_STALE_CHANGE_COUNT		(B_MEDIA_ERROR_BASE + 125)
26306b79f55SAugustin Cavalier#define B_MEDIA_ADDON_RESTRICTED		(B_MEDIA_ERROR_BASE + 126)
26406b79f55SAugustin Cavalier#define B_MEDIA_NO_HANDLER				(B_MEDIA_ERROR_BASE + 127)
26506b79f55SAugustin Cavalier#define B_MEDIA_DUPLICATE_FORMAT		(B_MEDIA_ERROR_BASE + 128)
26606b79f55SAugustin Cavalier#define B_MEDIA_REALTIME_DISABLED		(B_MEDIA_ERROR_BASE + 129)
26706b79f55SAugustin Cavalier#define B_MEDIA_REALTIME_UNAVAILABLE	(B_MEDIA_ERROR_BASE + 130)
26806b79f55SAugustin Cavalier
26906b79f55SAugustin Cavalier/* Mail Kit Errors */
27006b79f55SAugustin Cavalier#define B_MAIL_NO_DAEMON				(B_MAIL_ERROR_BASE + 0)
27106b79f55SAugustin Cavalier#define B_MAIL_UNKNOWN_USER				(B_MAIL_ERROR_BASE + 1)
27206b79f55SAugustin Cavalier#define B_MAIL_WRONG_PASSWORD			(B_MAIL_ERROR_BASE + 2)
27306b79f55SAugustin Cavalier#define B_MAIL_UNKNOWN_HOST				(B_MAIL_ERROR_BASE + 3)
27406b79f55SAugustin Cavalier#define B_MAIL_ACCESS_ERROR				(B_MAIL_ERROR_BASE + 4)
27506b79f55SAugustin Cavalier#define B_MAIL_UNKNOWN_FIELD			(B_MAIL_ERROR_BASE + 5)
27606b79f55SAugustin Cavalier#define B_MAIL_NO_RECIPIENT				(B_MAIL_ERROR_BASE + 6)
27706b79f55SAugustin Cavalier#define B_MAIL_INVALID_MAIL				(B_MAIL_ERROR_BASE + 7)
27806b79f55SAugustin Cavalier
27906b79f55SAugustin Cavalier/* Printing Errors */
28006b79f55SAugustin Cavalier#define B_NO_PRINT_SERVER				(B_PRINT_ERROR_BASE + 0)
28106b79f55SAugustin Cavalier
28206b79f55SAugustin Cavalier/* Device Kit Errors */
28306b79f55SAugustin Cavalier#define B_DEV_INVALID_IOCTL				(B_DEVICE_ERROR_BASE + 0)
28406b79f55SAugustin Cavalier#define B_DEV_NO_MEMORY					(B_DEVICE_ERROR_BASE + 1)
28506b79f55SAugustin Cavalier#define B_DEV_BAD_DRIVE_NUM				(B_DEVICE_ERROR_BASE + 2)
28606b79f55SAugustin Cavalier#define B_DEV_NO_MEDIA					(B_DEVICE_ERROR_BASE + 3)
28706b79f55SAugustin Cavalier#define B_DEV_UNREADABLE				(B_DEVICE_ERROR_BASE + 4)
28806b79f55SAugustin Cavalier#define B_DEV_FORMAT_ERROR				(B_DEVICE_ERROR_BASE + 5)
28906b79f55SAugustin Cavalier#define B_DEV_TIMEOUT					(B_DEVICE_ERROR_BASE + 6)
29006b79f55SAugustin Cavalier#define B_DEV_RECALIBRATE_ERROR			(B_DEVICE_ERROR_BASE + 7)
29106b79f55SAugustin Cavalier#define B_DEV_SEEK_ERROR				(B_DEVICE_ERROR_BASE + 8)
29206b79f55SAugustin Cavalier#define B_DEV_ID_ERROR					(B_DEVICE_ERROR_BASE + 9)
29306b79f55SAugustin Cavalier#define B_DEV_READ_ERROR				(B_DEVICE_ERROR_BASE + 10)
29406b79f55SAugustin Cavalier#define B_DEV_WRITE_ERROR				(B_DEVICE_ERROR_BASE + 11)
29506b79f55SAugustin Cavalier#define B_DEV_NOT_READY					(B_DEVICE_ERROR_BASE + 12)
29606b79f55SAugustin Cavalier#define B_DEV_MEDIA_CHANGED				(B_DEVICE_ERROR_BASE + 13)
29706b79f55SAugustin Cavalier#define B_DEV_MEDIA_CHANGE_REQUESTED	(B_DEVICE_ERROR_BASE + 14)
29806b79f55SAugustin Cavalier#define B_DEV_RESOURCE_CONFLICT			(B_DEVICE_ERROR_BASE + 15)
29906b79f55SAugustin Cavalier#define B_DEV_CONFIGURATION_ERROR		(B_DEVICE_ERROR_BASE + 16)
30006b79f55SAugustin Cavalier#define B_DEV_DISABLED_BY_USER			(B_DEVICE_ERROR_BASE + 17)
30106b79f55SAugustin Cavalier#define B_DEV_DOOR_OPEN					(B_DEVICE_ERROR_BASE + 18)
30206b79f55SAugustin Cavalier
30306b79f55SAugustin Cavalier#define B_DEV_INVALID_PIPE				(B_DEVICE_ERROR_BASE + 19)
30406b79f55SAugustin Cavalier#define B_DEV_CRC_ERROR					(B_DEVICE_ERROR_BASE + 20)
30506b79f55SAugustin Cavalier#define B_DEV_STALLED					(B_DEVICE_ERROR_BASE + 21)
30606b79f55SAugustin Cavalier#define B_DEV_BAD_PID					(B_DEVICE_ERROR_BASE + 22)
30706b79f55SAugustin Cavalier#define B_DEV_UNEXPECTED_PID			(B_DEVICE_ERROR_BASE + 23)
30806b79f55SAugustin Cavalier#define B_DEV_DATA_OVERRUN				(B_DEVICE_ERROR_BASE + 24)
30906b79f55SAugustin Cavalier#define B_DEV_DATA_UNDERRUN				(B_DEVICE_ERROR_BASE + 25)
31006b79f55SAugustin Cavalier#define B_DEV_FIFO_OVERRUN				(B_DEVICE_ERROR_BASE + 26)
31106b79f55SAugustin Cavalier#define B_DEV_FIFO_UNDERRUN				(B_DEVICE_ERROR_BASE + 27)
31206b79f55SAugustin Cavalier#define B_DEV_PENDING					(B_DEVICE_ERROR_BASE + 28)
31306b79f55SAugustin Cavalier#define B_DEV_MULTIPLE_ERRORS			(B_DEVICE_ERROR_BASE + 29)
31406b79f55SAugustin Cavalier#define B_DEV_TOO_LATE					(B_DEVICE_ERROR_BASE + 30)
31506b79f55SAugustin Cavalier
31606b79f55SAugustin Cavalier/* Translation Kit Errors */
31706b79f55SAugustin Cavalier#define B_TRANSLATION_BASE_ERROR		(B_TRANSLATION_ERROR_BASE + 0)
31806b79f55SAugustin Cavalier#define B_NO_TRANSLATOR					(B_TRANSLATION_ERROR_BASE + 1)
31906b79f55SAugustin Cavalier#define B_ILLEGAL_DATA					(B_TRANSLATION_ERROR_BASE + 2)
32006b79f55SAugustin Cavalier
32106b79f55SAugustin Cavalier
32206b79f55SAugustin Cavalier/* build-specific code */
323338b8dc3SIngo Weinhold#ifndef BUILDING_HAIKU_ERROR_MAPPER
324338b8dc3SIngo Weinhold	#undef E2BIG
325338b8dc3SIngo Weinhold	#undef ECHILD
326338b8dc3SIngo Weinhold	#undef EDEADLK
327338b8dc3SIngo Weinhold	#undef EFBIG
328338b8dc3SIngo Weinhold	#undef EMLINK
329338b8dc3SIngo Weinhold	#undef ENFILE
330338b8dc3SIngo Weinhold	#undef ENODEV
331338b8dc3SIngo Weinhold	#undef ENOLCK
332338b8dc3SIngo Weinhold	#undef ENOSYS
333338b8dc3SIngo Weinhold	#undef ENOTTY
334338b8dc3SIngo Weinhold	#undef ENXIO
335338b8dc3SIngo Weinhold	#undef ESPIPE
336338b8dc3SIngo Weinhold	#undef ESRCH
337338b8dc3SIngo Weinhold	#undef EFPOS
338338b8dc3SIngo Weinhold	#undef ESIGPARM
339338b8dc3SIngo Weinhold	#undef EDOM
340338b8dc3SIngo Weinhold	#undef ERANGE
341338b8dc3SIngo Weinhold	#undef EPROTOTYPE
342338b8dc3SIngo Weinhold	#undef EPROTONOSUPPORT
343338b8dc3SIngo Weinhold	#undef EPFNOSUPPORT
344338b8dc3SIngo Weinhold	#undef EAFNOSUPPORT
345338b8dc3SIngo Weinhold	#undef EADDRINUSE
346338b8dc3SIngo Weinhold	#undef EADDRNOTAVAIL
347338b8dc3SIngo Weinhold	#undef ENETDOWN
348338b8dc3SIngo Weinhold	#undef ENETUNREACH
349338b8dc3SIngo Weinhold	#undef ENETRESET
350338b8dc3SIngo Weinhold	#undef ECONNABORTED
351338b8dc3SIngo Weinhold	#undef ECONNRESET
352338b8dc3SIngo Weinhold	#undef EISCONN
353338b8dc3SIngo Weinhold	#undef ENOTCONN
354338b8dc3SIngo Weinhold	#undef ESHUTDOWN
355338b8dc3SIngo Weinhold	#undef ECONNREFUSED
356338b8dc3SIngo Weinhold	#undef EHOSTUNREACH
357338b8dc3SIngo Weinhold	#undef ENOPROTOOPT
358338b8dc3SIngo Weinhold	#undef ENOBUFS
359338b8dc3SIngo Weinhold	#undef EINPROGRESS
360338b8dc3SIngo Weinhold	#undef EALREADY
361338b8dc3SIngo Weinhold	#undef EILSEQ
362338b8dc3SIngo Weinhold	#undef ENOMSG
363338b8dc3SIngo Weinhold	#undef ESTALE
364338b8dc3SIngo Weinhold	#undef EOVERFLOW
365338b8dc3SIngo Weinhold	#undef EMSGSIZE
366338b8dc3SIngo Weinhold	#undef EOPNOTSUPP
367338b8dc3SIngo Weinhold	#undef ENOTSOCK
368338b8dc3SIngo Weinhold	#undef EHOSTDOWN
369338b8dc3SIngo Weinhold	#undef EBADMSG
370338b8dc3SIngo Weinhold	#undef ECANCELED
371338b8dc3SIngo Weinhold	#undef EDESTADDRREQ
372338b8dc3SIngo Weinhold	#undef EDQUOT
373338b8dc3SIngo Weinhold	#undef EIDRM
374338b8dc3SIngo Weinhold	#undef EMULTIHOP
375338b8dc3SIngo Weinhold	#undef ENODATA
376338b8dc3SIngo Weinhold	#undef ENOLINK
377338b8dc3SIngo Weinhold	#undef ENOSR
378338b8dc3SIngo Weinhold	#undef ENOSTR
379338b8dc3SIngo Weinhold	#undef ENOTSUP
380338b8dc3SIngo Weinhold	#undef EPROTO
381338b8dc3SIngo Weinhold	#undef ETIME
382338b8dc3SIngo Weinhold	#undef ETXTBSY
383338b8dc3SIngo Weinhold	#undef ENOMEM
384338b8dc3SIngo Weinhold	#undef EACCES
385338b8dc3SIngo Weinhold	#undef EINTR
386338b8dc3SIngo Weinhold	#undef EIO
387338b8dc3SIngo Weinhold	#undef EBUSY
388338b8dc3SIngo Weinhold	#undef EFAULT
389338b8dc3SIngo Weinhold	#undef ETIMEDOUT
390338b8dc3SIngo Weinhold	#undef EAGAIN
391338b8dc3SIngo Weinhold	#undef EWOULDBLOCK
392338b8dc3SIngo Weinhold	#undef EBADF
393338b8dc3SIngo Weinhold	#undef EEXIST
394338b8dc3SIngo Weinhold	#undef EINVAL
395338b8dc3SIngo Weinhold	#undef ENAMETOOLONG
396338b8dc3SIngo Weinhold	#undef ENOENT
397338b8dc3SIngo Weinhold	#undef EPERM
398338b8dc3SIngo Weinhold	#undef ENOTDIR
399338b8dc3SIngo Weinhold	#undef EISDIR
400338b8dc3SIngo Weinhold	#undef ENOTEMPTY
401338b8dc3SIngo Weinhold	#undef ENOSPC
402338b8dc3SIngo Weinhold	#undef EROFS
403338b8dc3SIngo Weinhold	#undef EMFILE
404338b8dc3SIngo Weinhold	#undef EXDEV
405338b8dc3SIngo Weinhold	#undef ELOOP
406338b8dc3SIngo Weinhold	#undef ENOEXEC
407338b8dc3SIngo Weinhold	#undef EPIPE
408d1e58a8aSIngo Weinhold	#undef ENOATTR
4097c447600SIngo Weinhold
410338b8dc3SIngo Weinhold	#define E2BIG HAIKU_E2BIG
411338b8dc3SIngo Weinhold	#define ECHILD HAIKU_ECHILD
412338b8dc3SIngo Weinhold	#define EDEADLK HAIKU_EDEADLK
413338b8dc3SIngo Weinhold	#define EFBIG HAIKU_EFBIG
414338b8dc3SIngo Weinhold	#define EMLINK HAIKU_EMLINK
415338b8dc3SIngo Weinhold	#define ENFILE HAIKU_ENFILE
416338b8dc3SIngo Weinhold	#define ENODEV HAIKU_ENODEV
417338b8dc3SIngo Weinhold	#define ENOLCK HAIKU_ENOLCK
418338b8dc3SIngo Weinhold	#define ENOSYS HAIKU_ENOSYS
419338b8dc3SIngo Weinhold	#define ENOTTY HAIKU_ENOTTY
420338b8dc3SIngo Weinhold	#define ENXIO HAIKU_ENXIO
421338b8dc3SIngo Weinhold	#define ESPIPE HAIKU_ESPIPE
422338b8dc3SIngo Weinhold	#define ESRCH HAIKU_ESRCH
423338b8dc3SIngo Weinhold	#define EFPOS HAIKU_EFPOS
424338b8dc3SIngo Weinhold	#define ESIGPARM HAIKU_ESIGPARM
425338b8dc3SIngo Weinhold	#define EDOM HAIKU_EDOM
426338b8dc3SIngo Weinhold	#define ERANGE HAIKU_ERANGE
427338b8dc3SIngo Weinhold	#define EPROTOTYPE HAIKU_EPROTOTYPE
428338b8dc3SIngo Weinhold	#define EPROTONOSUPPORT HAIKU_EPROTONOSUPPORT
429338b8dc3SIngo Weinhold	#define EPFNOSUPPORT HAIKU_EPFNOSUPPORT
430338b8dc3SIngo Weinhold	#define EAFNOSUPPORT HAIKU_EAFNOSUPPORT
431338b8dc3SIngo Weinhold	#define EADDRINUSE HAIKU_EADDRINUSE
432338b8dc3SIngo Weinhold	#define EADDRNOTAVAIL HAIKU_EADDRNOTAVAIL
433338b8dc3SIngo Weinhold	#define ENETDOWN HAIKU_ENETDOWN
434338b8dc3SIngo Weinhold	#define ENETUNREACH HAIKU_ENETUNREACH
435338b8dc3SIngo Weinhold	#define ENETRESET HAIKU_ENETRESET
436338b8dc3SIngo Weinhold	#define ECONNABORTED HAIKU_ECONNABORTED
437338b8dc3SIngo Weinhold	#define ECONNRESET HAIKU_ECONNRESET
438338b8dc3SIngo Weinhold	#define EISCONN HAIKU_EISCONN
439338b8dc3SIngo Weinhold	#define ENOTCONN HAIKU_ENOTCONN
440338b8dc3SIngo Weinhold	#define ESHUTDOWN HAIKU_ESHUTDOWN
441338b8dc3SIngo Weinhold	#define ECONNREFUSED HAIKU_ECONNREFUSED
442338b8dc3SIngo Weinhold	#define EHOSTUNREACH HAIKU_EHOSTUNREACH
443338b8dc3SIngo Weinhold	#define ENOPROTOOPT HAIKU_ENOPROTOOPT
444338b8dc3SIngo Weinhold	#define ENOBUFS HAIKU_ENOBUFS
445338b8dc3SIngo Weinhold	#define EINPROGRESS HAIKU_EINPROGRESS
446338b8dc3SIngo Weinhold	#define EALREADY HAIKU_EALREADY
447338b8dc3SIngo Weinhold	#define EILSEQ HAIKU_EILSEQ
448338b8dc3SIngo Weinhold	#define ENOMSG HAIKU_ENOMSG
449338b8dc3SIngo Weinhold	#define ESTALE HAIKU_ESTALE
450338b8dc3SIngo Weinhold	#define EOVERFLOW HAIKU_EOVERFLOW
451338b8dc3SIngo Weinhold	#define EMSGSIZE HAIKU_EMSGSIZE
452338b8dc3SIngo Weinhold	#define EOPNOTSUPP HAIKU_EOPNOTSUPP
453338b8dc3SIngo Weinhold	#define ENOTSOCK HAIKU_ENOTSOCK
454338b8dc3SIngo Weinhold	#define EHOSTDOWN HAIKU_EHOSTDOWN
455338b8dc3SIngo Weinhold	#define	EBADMSG HAIKU_EBADMSG
456338b8dc3SIngo Weinhold	#define ECANCELED HAIKU_ECANCELED
457338b8dc3SIngo Weinhold	#define EDESTADDRREQ HAIKU_EDESTADDRREQ
458338b8dc3SIngo Weinhold	#define EDQUOT HAIKU_EDQUOT
459338b8dc3SIngo Weinhold	#define EIDRM HAIKU_EIDRM
460338b8dc3SIngo Weinhold	#define EMULTIHOP HAIKU_EMULTIHOP
461338b8dc3SIngo Weinhold	#define ENODATA HAIKU_ENODATA
462338b8dc3SIngo Weinhold	#define ENOLINK HAIKU_ENOLINK
463338b8dc3SIngo Weinhold	#define ENOSR HAIKU_ENOSR
464338b8dc3SIngo Weinhold	#define ENOSTR HAIKU_ENOSTR
465338b8dc3SIngo Weinhold	#define ENOTSUP HAIKU_ENOTSUP
466338b8dc3SIngo Weinhold	#define EPROTO HAIKU_EPROTO
467338b8dc3SIngo Weinhold	#define ETIME HAIKU_ETIME
468338b8dc3SIngo Weinhold	#define ETXTBSY HAIKU_ETXTBSY
469338b8dc3SIngo Weinhold	#define ENOMEM HAIKU_ENOMEM
470338b8dc3SIngo Weinhold	#define EACCES HAIKU_EACCES
471338b8dc3SIngo Weinhold	#define EINTR HAIKU_EINTR
472338b8dc3SIngo Weinhold	#define EIO HAIKU_EIO
473338b8dc3SIngo Weinhold	#define EBUSY HAIKU_EBUSY
474338b8dc3SIngo Weinhold	#define EFAULT HAIKU_EFAULT
475338b8dc3SIngo Weinhold	#define ETIMEDOUT HAIKU_ETIMEDOUT
476338b8dc3SIngo Weinhold	#define EAGAIN HAIKU_EAGAIN
477338b8dc3SIngo Weinhold	#define EWOULDBLOCK HAIKU_EWOULDBLOCK
478338b8dc3SIngo Weinhold	#define EBADF HAIKU_EBADF
479338b8dc3SIngo Weinhold	#define EEXIST HAIKU_EEXIST
480338b8dc3SIngo Weinhold	#define EINVAL HAIKU_EINVAL
481338b8dc3SIngo Weinhold	#define ENAMETOOLONG HAIKU_ENAMETOOLONG
482338b8dc3SIngo Weinhold	#define ENOENT HAIKU_ENOENT
483338b8dc3SIngo Weinhold	#define EPERM HAIKU_EPERM
484338b8dc3SIngo Weinhold	#define ENOTDIR HAIKU_ENOTDIR
485338b8dc3SIngo Weinhold	#define EISDIR HAIKU_EISDIR
486338b8dc3SIngo Weinhold	#define ENOTEMPTY HAIKU_ENOTEMPTY
487338b8dc3SIngo Weinhold	#define ENOSPC HAIKU_ENOSPC
488338b8dc3SIngo Weinhold	#define EROFS HAIKU_EROFS
489338b8dc3SIngo Weinhold	#define EMFILE HAIKU_EMFILE
490338b8dc3SIngo Weinhold	#define EXDEV HAIKU_EXDEV
491338b8dc3SIngo Weinhold	#define ELOOP HAIKU_ELOOP
492338b8dc3SIngo Weinhold	#define ENOEXEC HAIKU_ENOEXEC
493338b8dc3SIngo Weinhold	#define EPIPE HAIKU_EPIPE
494d307e812SIngo Weinhold	#define ENOATTR HAIKU_ENOATTR
495338b8dc3SIngo Weinhold
496338b8dc3SIngo Weinhold	#undef errno
497338b8dc3SIngo Weinhold	#define errno (*_haiku_build_errno())
4985e19679eSAugustin Cavalier#elif defined(HAIKU_HOST_PLATFORM_HAIKU)
4995e19679eSAugustin Cavalier#	include <../os/support/Errors.h>
500338b8dc3SIngo Weinhold#endif	// ! BUILDING_HAIKU_ERROR_MAPPER
501338b8dc3SIngo Weinhold
502338b8dc3SIngo Weinhold#ifdef __cplusplus
503338b8dc3SIngo Weinholdextern "C" {
504338b8dc3SIngo Weinhold#endif
505338b8dc3SIngo Weinhold
506338b8dc3SIngo Weinholdextern int *_haiku_build_errno();
5073b8715d8SIngo Weinholdextern int _haiku_to_host_error(int error);
508338b8dc3SIngo Weinhold
509338b8dc3SIngo Weinhold#ifdef __cplusplus
510338b8dc3SIngo Weinhold}
511338b8dc3SIngo Weinhold#endif
512338b8dc3SIngo Weinhold
513338b8dc3SIngo Weinhold
5145e19679eSAugustin Cavalier#endif	/* _BUILD_ERRORS_H */
515