1/*
2 * Copyright (c) 2020 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef OHOS_ERRNO_H
16#define OHOS_ERRNO_H
17#ifdef __cplusplus
18#if __cplusplus
19extern "C" {
20#endif /* __cplusplus */
21#endif /* __cplusplus */
22/* --------------------------------------------------------------------------------------------*
23 * Definition of error code. The error codes are applicable to both the application and kernel
24 *-------------------------------------------------------------------------------------------- */
25enum OHOSLiteErrorCode {
26    EC_SUCCESS = 0,     /* OK or No error */
27    EC_FAILURE = -1,  /* Execution failed */
28    EC_BADPTR = -2,  /* Bad pointer value */
29    EC_NOMEMORY = -3,  /* No enough memory */
30    EC_ADDRESS = -4,  /* Memory or bus address error */
31    EC_IOERROR = -5,  /* I/O error */
32    EC_BUSBUSY = -6,  /* xxx bus busy */
33    EC_NORESPONCE = -7,  /* Function is no response */
34    EC_NODEVICE = -8,  /* No such device */
35    EC_INVALID = -9,  /* Invalid argument */
36    EC_BUSY = -10, /* Device or resource busy */
37    EC_NOSERVICE = -11, /* No service */
38    EC_PERMISSION = -12, /* Permission denied */
39    EC_NOFILE = -13, /* No this file */
40    EC_NOSPACE = -14, /* No space left on device */
41    EC_NODIR = -15, /* Not a directory */
42    EC_ROFILE = -16, /* Read-only file system */
43    EC_NAMETOOLONG = -17, /* File name too long */
44    EC_OPBLOCK = -18, /* Operation would block */
45    EC_TIMEOUT = -19, /* Timer expired */
46    EC_COMMU = -20, /* Communication error on send */
47    EC_PROTOCOL = -21, /* Protocol error */
48    EC_CANCELED = -22, /* Operation Canceled */
49    EC_NOKEY = -23, /* Required key not available */
50    EC_NOHANDLER = -24, /* No handler to execute */
51    EC_FLOWCTRL = -25, /* Flow control */
52    EC_NOINIT = -26, /* device hasn't been initialized */
53    EC_NORESOURCE = -27, /* resource error */
54    EC_LLERRTOP = -127, /* Low level function error code max value */
55    EC_HLERRBASE = -128 /* High level function error code baseline */
56};
57
58#ifdef __cplusplus
59#if __cplusplus
60}
61#endif /* __cplusplus */
62#endif /* __cplusplus */
63#endif // OHOS_ERRNO_H
64