• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef SYS_XATTR_H
18 #define SYS_XATTR_H
19 
20 #include <errno.h>
21 #include <sys/cdefs.h>
22 
23 __BEGIN_DECLS
24 
25 #ifndef ENOATTR
26 #define ENOATTR ENODATA
27 #endif
28 
29 /*
30  * Fuchsia does not support extended attirbutes on inodes (yet?), so
31  * any getxattr implementation will not make much sense. Simply report
32  * that the requested attribute does not exist and return.
33  */
getxattr(const char * path __UNUSED,const char * name __UNUSED,void * value __UNUSED,size_t size __UNUSED)34 inline ssize_t getxattr(const char* path __UNUSED, const char* name __UNUSED, void* value __UNUSED, size_t size __UNUSED) {
35   errno = ENOTSUP;
36   return -1;
37 }
38 
listxattr(const char * path __UNUSED,char * list __UNUSED,size_t size __UNUSED)39 inline ssize_t listxattr(const char *path __UNUSED, char *list __UNUSED, size_t size __UNUSED) {
40   errno = ENOTSUP;
41   return -1;
42 }
43 
setxattr(const char * path __UNUSED,const char * name __UNUSED,const void * value __UNUSED,size_t size __UNUSED,int flags __UNUSED)44 inline int setxattr(const char *path __UNUSED, const char *name __UNUSED, const void *value __UNUSED, size_t size __UNUSED, int flags __UNUSED) {
45   errno = ENOTSUP;
46   return -1;
47 }
48 
removexattr(const char * path __UNUSED,const char * name __UNUSED)49 inline int removexattr(const char *path __UNUSED, const char *name __UNUSED) {
50   errno = ENOTSUP;
51   return -1;
52 }
53 
54 __END_DECLS
55 
56 #endif  // SYS_XATTR_H
57