]> git.proxmox.com Git - ceph.git/blob - ceph/src/common/xattr.h
add subtree-ish sources for 12.0.3
[ceph.git] / 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 #include <sys/types.h>
16 #include <errno.h>
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 // Almost everyone defines ENOATTR, except for Linux,
23 // which does #define ENOATTR ENODATA. It seems that occasionally that
24 // isn't defined, though, so let's make sure.
25 #ifndef ENOATTR
26 # define ENOATTR ENODATA
27 #endif
28
29 int ceph_os_setxattr(const char *path, const char *name,
30 const void *value, size_t size);
31 int ceph_os_fsetxattr(int fd, const char *name, const void *value,
32 size_t size);
33 ssize_t ceph_os_getxattr(const char *path, const char *name,
34 void *value, size_t size);
35 ssize_t ceph_os_fgetxattr(int fd, const char *name, void *value,
36 size_t size);
37 ssize_t ceph_os_listxattr(const char *path, char *list, size_t size);
38 ssize_t ceph_os_flistxattr(int fd, char *list, size_t size);
39 int ceph_os_removexattr(const char *path, const char *name);
40 int ceph_os_fremovexattr(int fd, const char *name);
41
42 #ifdef __cplusplus
43 }
44 #endif
45
46 #endif /* !CEPH_EXTATTR_H */