1 /* 2 * Copyright (c) 2024 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 16 #include "library_func_mock.h" 17 18 using namespace OHOS::AppFileService; fseeko(FILE * stream,off_t offset,int whence)19 int fseeko(FILE *stream, off_t offset, int whence) 20 { 21 if (LibraryFunc::libraryFunc_ == nullptr) { 22 return -1; 23 } 24 return LibraryFunc::libraryFunc_->fseeko(stream, offset, whence); 25 } 26 ftello(FILE * stream)27 off_t ftello(FILE *stream) 28 { 29 if (LibraryFunc::libraryFunc_ == nullptr) { 30 return -1; 31 } 32 return LibraryFunc::libraryFunc_->ftello(stream); 33 } 34 access(const char * pathname,int mode)35 int access(const char *pathname, int mode) 36 { 37 if (LibraryFunc::libraryFunc_ == nullptr) { 38 return -1; 39 } 40 return LibraryFunc::libraryFunc_->access(pathname, mode); 41 } 42 mkdir(const char * pathname,mode_t mode)43 int mkdir(const char *pathname, mode_t mode) 44 { 45 if (LibraryFunc::libraryFunc_ == nullptr) { 46 return -1; 47 } 48 return LibraryFunc::libraryFunc_->mkdir(pathname, mode); 49 }