1 /* 2 * Copyright (c) 2021 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 STORAGE_SERVICE_UTILS_ERRNO_H 16 #define STORAGE_SERVICE_UTILS_ERRNO_H 17 18 #include <sys/types.h> 19 20 namespace OHOS { 21 constexpr int32_t E_ERR = -1; 22 23 enum ErrNo { 24 E_OK = 0, 25 E_PERMISSION_DENIED = 1, // no permission 26 E_IPC_ERROR = 2, // ipc error 27 E_EXIST = 3, // exist 28 E_WRONG_TYPE = 4, // wrong file type 29 E_USER_STATE = 5, // wrong user state 30 E_NON_EXIST = 6, // no such item 31 E_PREPARE_DIR = 7, // failed to prepare dir 32 E_DESTROY_DIR = 8, // failed to destroy dir 33 E_MOUNT, // mount error 34 E_UMOUNT, // umount error 35 E_SET_POLICY, // set policy error 36 E_USERID_RANGE, // id out or range 37 E_VOL_STATE, // volume state check fail 38 E_WAIT, // wait 39 E_NOT_SUPPORT, // not support 40 E_SYS_CALL, // syscall error 41 E_NO_CHILD, // child not exist 42 }; 43 } 44 45 #endif // STORAGE_SERVICE_UTILS_ERRNO_H