1 /**
2  * \file
3  * Error codes.
4  */
5 /*
6  * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
7  *               Alexander Warg <warg@os.inf.tu-dresden.de>
8  *     economic rights: Technische Universität Dresden (Germany)
9  *
10  * This file is part of TUD:OS and distributed under the terms of the
11  * GNU General Public License 2.
12  * Please see the COPYING-GPL-2 file for details.
13  *
14  * As a special exception, you may use this file as part of a free software
15  * library without restriction.  Specifically, if other files instantiate
16  * templates or use macros or inline functions from this file, or you compile
17  * this file and link it with other files to produce an executable, this
18  * file does not by itself cause the resulting executable to be covered by
19  * the GNU General Public License.  This exception does not however
20  * invalidate any other reasons why the executable file might be covered by
21  * the GNU General Public License.
22  */
23 #pragma once
24 
25 #include <l4/sys/compiler.h>
26 
27 /**
28  * \defgroup l4_error_api Error codes
29  * Common error codes.
30  * \ingroup l4_api
31  *
32  * \includefile{l4/sys/err.h}
33  */
34 
35 /**
36  * L4 error codes.
37  * \ingroup l4_error_api
38  *
39  * Those error codes are used by both the kernel and the user programs.
40  */
41 enum l4_error_code_t
42 {
43   L4_EOK           =  0,     /**< Ok. */
44   L4_EPERM         =  1,     /**< No permission. */
45   L4_ENOENT        =  2,     /**< No such entity. */
46   L4_EIO           =  5,     /**< I/O error. */
47   L4_ENXIO         =  6,     /**< No such device or address */
48   L4_E2BIG         =  7,     /**< Argument value too big */
49   L4_EAGAIN        = 11,     /**< Try again. */
50   L4_ENOMEM        = 12,     /**< No memory. */
51   L4_EACCESS       = 13,     /**< Permission denied. */
52   L4_EFAULT        = 14,     /**< Invalid memory address. */
53   L4_EBUSY         = 16,     /**< Object currently busy, try later. */
54   L4_EEXIST        = 17,     /**< Already exists. */
55   L4_ENODEV        = 19,     /**< No such thing. */
56   L4_EINVAL        = 22,     /**< Invalid argument. */
57   L4_ENOSPC        = 28,     /**< No space left on device */
58   L4_ERANGE        = 34,     /**< Range error. */
59   L4_ENAMETOOLONG  = 36,     /**< Name too long. */
60   L4_ENOSYS        = 38,     /**< No sys. */
61   L4_EBADPROTO     = 39,     /**< Unsupported protocol. */
62   L4_EADDRNOTAVAIL = 99,     /**< Address not available. */
63   L4_ERRNOMAX      = 100,    /**< Maximum error value. */
64 
65   L4_ENOREPLY      = 1000,   /**< No reply. */
66   L4_EMSGTOOSHORT  = 1001,   /**< Message too short. */
67   L4_EMSGTOOLONG   = 1002,   /**< Message too long. */
68   L4_EMSGMISSARG   = 1003,   /**< Message has invalid capability. */
69 
70   L4_EIPC_LO       = 2000,   /**< Communication error-range low. */
71   L4_EIPC_HI       = 2000 + 0x1f,   /**< Communication error-range high. */
72 };
73 
74 __BEGIN_DECLS
75 L4_CV char const *l4sys_errtostr(long err) L4_NOTHROW;
76 __END_DECLS
77 
78 
79