4 * Copyright IBM, Corp. 2017
7 * Greg Kurz <groug@kaod.org>
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
13 #include "qemu/osdep.h"
14 #include "qemu/xattr.h"
17 ssize_t
fgetxattrat_nofollow(int dirfd
, const char *filename
, const char *name
,
18 void *value
, size_t size
)
20 char *proc_path
= g_strdup_printf("/proc/self/fd/%d/%s", dirfd
, filename
);
23 ret
= lgetxattr(proc_path
, name
, value
, size
);
28 ssize_t
flistxattrat_nofollow(int dirfd
, const char *filename
,
29 char *list
, size_t size
)
31 char *proc_path
= g_strdup_printf("/proc/self/fd/%d/%s", dirfd
, filename
);
34 ret
= llistxattr(proc_path
, list
, size
);
39 ssize_t
fremovexattrat_nofollow(int dirfd
, const char *filename
,
42 char *proc_path
= g_strdup_printf("/proc/self/fd/%d/%s", dirfd
, filename
);
45 ret
= lremovexattr(proc_path
, name
);
50 int fsetxattrat_nofollow(int dirfd
, const char *filename
, const char *name
,
51 void *value
, size_t size
, int flags
)
53 char *proc_path
= g_strdup_printf("/proc/self/fd/%d/%s", dirfd
, filename
);
56 ret
= lsetxattr(proc_path
, name
, value
, size
, flags
);