1 /*
2 * Copyright (c) 2025 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 "lib_func_mock.h"
17
18 using namespace OHOS::AppSpawn;
Fseeko(FILE * stream,off_t offset,int whence)19 int Fseeko(FILE *stream, off_t offset, int whence)
20 {
21 return LibraryFunc::libraryFunc_->fseeko(stream, offset, whence);
22 }
23
Ftello(FILE * stream)24 off_t Ftello(FILE *stream)
25 {
26 return LibraryFunc::libraryFunc_->ftello(stream);
27 }
28
Access(const char * pathname,int mode)29 int Access(const char *pathname, int mode)
30 {
31 return LibraryFunc::libraryFunc_->access(pathname, mode);
32 }
33
Mkdir(const char * pathname,mode_t mode)34 int Mkdir(const char *pathname, mode_t mode)
35 {
36 return LibraryFunc::libraryFunc_->mkdir(pathname, mode);
37 }
38
Fread(void * ptr,size_t size,size_t nmemb,FILE * stream)39 size_t Fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
40 {
41 return LibraryFunc::libraryFunc_->fread(ptr, size, nmemb, stream);
42 }
43
Fwrite(const void * ptr,size_t size,size_t nmemb,FILE * stream)44 size_t Fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
45 {
46 return LibraryFunc::libraryFunc_->fwrite(ptr, size, nmemb, stream);
47 }
48
Realpath(const char * path,char * resolved_path)49 char *Realpath(const char *path, char *resolved_path)
50 {
51 return LibraryFunc::libraryFunc_->realpath(path, resolved_path);
52 }
53
Fopen(const char * pathname,const char * mode)54 FILE *Fopen(const char *pathname, const char *mode)
55 {
56 return LibraryFunc::libraryFunc_->fopen(pathname, mode);
57 }
58
Fclose(FILE * stream)59 int Fclose(FILE *stream)
60 {
61 return LibraryFunc::libraryFunc_->fclose(stream);
62 }
63
Chmod(const char * pathname,mode_t mode)64 int Chmod(const char *pathname, mode_t mode)
65 {
66 return LibraryFunc::libraryFunc_->chmod(pathname, mode);
67 }
68
Stat(const char * pathname,struct stat * statbuf)69 int Stat(const char *pathname, struct stat *statbuf)
70 {
71 return LibraryFunc::libraryFunc_->stat(pathname, statbuf);
72 }
73
Utime(const char * filename,const struct utimbuf * times)74 int Utime(const char *filename, const struct utimbuf *times)
75 {
76 return LibraryFunc::libraryFunc_->utime(filename, times);
77 }
78
Ferror(FILE * f)79 int Ferror(FILE *f)
80 {
81 return LibraryFunc::libraryFunc_->ferror(f);
82 }
83
Fflush(FILE * f)84 int Fflush(FILE *f)
85 {
86 return LibraryFunc::libraryFunc_->fflush(f);
87 }
88
Remove(const char * path)89 int Remove(const char *path)
90 {
91 return LibraryFunc::libraryFunc_->remove(path);
92 }
93
Getpwuid(uid_t uid)94 struct passwd *Getpwuid(uid_t uid)
95 {
96 return LibraryFunc::libraryFunc_->getpwuid(uid);
97 }
98
Getgrgid(gid_t gid)99 struct group *Getgrgid(gid_t gid)
100 {
101 return LibraryFunc::libraryFunc_->getgrgid(gid);
102 }
103
Open(const char * filename,int flags,...)104 int Open(const char *filename, int flags, ...)
105 {
106 return LibraryFunc::libraryFunc_->open(filename, flags);
107 }
108
Read(int fd,void * buf,size_t count)109 ssize_t Read(int fd, void *buf, size_t count)
110 {
111 return LibraryFunc::libraryFunc_->read(fd, buf, count);
112 }
113
Write(int fd,const void * buf,size_t count)114 ssize_t Write(int fd, const void *buf, size_t count)
115 {
116 return LibraryFunc::libraryFunc_->write(fd, buf, count);
117 }
118
Close(int fd)119 int Close(int fd)
120 {
121 return LibraryFunc::libraryFunc_->close(fd);
122 }
123
Umount2(const char * file,int flag)124 int Umount2(const char *file, int flag)
125 {
126 return LibraryFunc::libraryFunc_->umount2(file, flag);
127 }
128
Rmdir(const char * file)129 int Rmdir(const char *file)
130 {
131 return LibraryFunc::libraryFunc_->rmdir(file);
132 }