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 "system_mock.h"
17
18 using namespace OHOS::FileManagement::ModuleFileIO;
19
20 extern "C" {
setxattr(const char * path,const char * name,const void * value,size_t size,int flags)21 int setxattr(const char *path, const char *name, const void *value, size_t size, int flags)
22 {
23 return System::ins->setxattr(path, name, value, size, flags);
24 }
25
getxattr(const char * path,const char * name,void * value,size_t size)26 ssize_t getxattr(const char *path, const char *name, void *value, size_t size)
27 {
28 return System::ins->getxattr(path, name, value, size);
29 }
30
fgetxattr(int filedes,const char * name,void * value,size_t size)31 int fgetxattr(int filedes, const char *name, void *value, size_t size)
32 {
33 return System::ins->fgetxattr(filedes, name, value, size);
34 }
35
flock(int fd,int operation)36 int flock(int fd, int operation)
37 {
38 return System::ins->flock(fd, operation);
39 }
40 }