10e98b08fSopenharmony_ci/* 20e98b08fSopenharmony_ci * Copyright (c) 2020 Huawei Device Co., Ltd. 30e98b08fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 40e98b08fSopenharmony_ci * you may not use this file except in compliance with the License. 50e98b08fSopenharmony_ci * You may obtain a copy of the License at 60e98b08fSopenharmony_ci * 70e98b08fSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 80e98b08fSopenharmony_ci * 90e98b08fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 100e98b08fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 110e98b08fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 120e98b08fSopenharmony_ci * See the License for the specific language governing permissions and 130e98b08fSopenharmony_ci * limitations under the License. 140e98b08fSopenharmony_ci */ 150e98b08fSopenharmony_ci#ifndef OHOS_ERRNO_H 160e98b08fSopenharmony_ci#define OHOS_ERRNO_H 170e98b08fSopenharmony_ci#ifdef __cplusplus 180e98b08fSopenharmony_ci#if __cplusplus 190e98b08fSopenharmony_ciextern "C" { 200e98b08fSopenharmony_ci#endif /* __cplusplus */ 210e98b08fSopenharmony_ci#endif /* __cplusplus */ 220e98b08fSopenharmony_ci/* --------------------------------------------------------------------------------------------* 230e98b08fSopenharmony_ci * Definition of error code. The error codes are applicable to both the application and kernel 240e98b08fSopenharmony_ci *-------------------------------------------------------------------------------------------- */ 250e98b08fSopenharmony_cienum OHOSLiteErrorCode { 260e98b08fSopenharmony_ci EC_SUCCESS = 0, /* OK or No error */ 270e98b08fSopenharmony_ci EC_FAILURE = -1, /* Execution failed */ 280e98b08fSopenharmony_ci EC_BADPTR = -2, /* Bad pointer value */ 290e98b08fSopenharmony_ci EC_NOMEMORY = -3, /* No enough memory */ 300e98b08fSopenharmony_ci EC_ADDRESS = -4, /* Memory or bus address error */ 310e98b08fSopenharmony_ci EC_IOERROR = -5, /* I/O error */ 320e98b08fSopenharmony_ci EC_BUSBUSY = -6, /* xxx bus busy */ 330e98b08fSopenharmony_ci EC_NORESPONCE = -7, /* Function is no response */ 340e98b08fSopenharmony_ci EC_NODEVICE = -8, /* No such device */ 350e98b08fSopenharmony_ci EC_INVALID = -9, /* Invalid argument */ 360e98b08fSopenharmony_ci EC_BUSY = -10, /* Device or resource busy */ 370e98b08fSopenharmony_ci EC_NOSERVICE = -11, /* No service */ 380e98b08fSopenharmony_ci EC_PERMISSION = -12, /* Permission denied */ 390e98b08fSopenharmony_ci EC_NOFILE = -13, /* No this file */ 400e98b08fSopenharmony_ci EC_NOSPACE = -14, /* No space left on device */ 410e98b08fSopenharmony_ci EC_NODIR = -15, /* Not a directory */ 420e98b08fSopenharmony_ci EC_ROFILE = -16, /* Read-only file system */ 430e98b08fSopenharmony_ci EC_NAMETOOLONG = -17, /* File name too long */ 440e98b08fSopenharmony_ci EC_OPBLOCK = -18, /* Operation would block */ 450e98b08fSopenharmony_ci EC_TIMEOUT = -19, /* Timer expired */ 460e98b08fSopenharmony_ci EC_COMMU = -20, /* Communication error on send */ 470e98b08fSopenharmony_ci EC_PROTOCOL = -21, /* Protocol error */ 480e98b08fSopenharmony_ci EC_CANCELED = -22, /* Operation Canceled */ 490e98b08fSopenharmony_ci EC_NOKEY = -23, /* Required key not available */ 500e98b08fSopenharmony_ci EC_NOHANDLER = -24, /* No handler to execute */ 510e98b08fSopenharmony_ci EC_FLOWCTRL = -25, /* Flow control */ 520e98b08fSopenharmony_ci EC_NOINIT = -26, /* device hasn't been initialized */ 530e98b08fSopenharmony_ci EC_NORESOURCE = -27, /* resource error */ 540e98b08fSopenharmony_ci EC_LLERRTOP = -127, /* Low level function error code max value */ 550e98b08fSopenharmony_ci EC_HLERRBASE = -128 /* High level function error code baseline */ 560e98b08fSopenharmony_ci}; 570e98b08fSopenharmony_ci 580e98b08fSopenharmony_ci#ifdef __cplusplus 590e98b08fSopenharmony_ci#if __cplusplus 600e98b08fSopenharmony_ci} 610e98b08fSopenharmony_ci#endif /* __cplusplus */ 620e98b08fSopenharmony_ci#endif /* __cplusplus */ 630e98b08fSopenharmony_ci#endif // OHOS_ERRNO_H 64