Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / common / xattr.h
1 /*
2  * Ceph - scalable distributed file system
3  *
4  * Copyright (C) 2011 Stanislav Sedov <stas@FreeBSD.org>
5  *
6  * This is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License version 2.1, as published by the Free Software
9  * Foundation.  See file COPYING.
10  */
11
12 #ifndef CEPH_EXTATTR_H
13 #define CEPH_EXTATTR_H
14
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 // Almost everyone defines ENOATTR, except for Linux,
21 // which does #define ENOATTR ENODATA.  It seems that occasionally that
22 // isn't defined, though, so let's make sure.
23 #ifndef ENOATTR
24 # define ENOATTR ENODATA
25 #endif
26
27 int ceph_os_setxattr(const char *path, const char *name,
28                   const void *value, size_t size);
29 int ceph_os_fsetxattr(int fd, const char *name, const void *value,
30                    size_t size);
31 ssize_t ceph_os_getxattr(const char *path, const char *name,
32                          void *value, size_t size);
33 ssize_t ceph_os_fgetxattr(int fd, const char *name, void *value,
34                           size_t size);
35 ssize_t ceph_os_listxattr(const char *path, char *list, size_t size);
36 ssize_t ceph_os_flistxattr(int fd, char *list, size_t size);
37 int ceph_os_removexattr(const char *path, const char *name);
38 int ceph_os_fremovexattr(int fd, const char *name);
39
40 #ifdef __cplusplus
41 }
42 #endif
43
44 #endif /* !CEPH_EXTATTR_H */