2 * 9p utilities (Linux Implementation)
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.
14 * Not so fast! You might want to read the 9p developer docs first:
15 * https://wiki.qemu.org/Documentation/9p
18 #include "qemu/osdep.h"
19 #include "qemu/xattr.h"
22 ssize_t
fgetxattrat_nofollow(int dirfd
, const char *filename
, const char *name
,
23 void *value
, size_t size
)
25 char *proc_path
= g_strdup_printf("/proc/self/fd/%d/%s", dirfd
, filename
);
28 ret
= lgetxattr(proc_path
, name
, value
, size
);
33 ssize_t
flistxattrat_nofollow(int dirfd
, const char *filename
,
34 char *list
, size_t size
)
36 char *proc_path
= g_strdup_printf("/proc/self/fd/%d/%s", dirfd
, filename
);
39 ret
= llistxattr(proc_path
, list
, size
);
44 ssize_t
fremovexattrat_nofollow(int dirfd
, const char *filename
,
47 char *proc_path
= g_strdup_printf("/proc/self/fd/%d/%s", dirfd
, filename
);
50 ret
= lremovexattr(proc_path
, name
);
55 int fsetxattrat_nofollow(int dirfd
, const char *filename
, const char *name
,
56 void *value
, size_t size
, int flags
)
58 char *proc_path
= g_strdup_printf("/proc/self/fd/%d/%s", dirfd
, filename
);
61 ret
= lsetxattr(proc_path
, name
, value
, size
, flags
);
67 int qemu_mknodat(int dirfd
, const char *filename
, mode_t mode
, dev_t dev
)
69 return mknodat(dirfd
, filename
, mode
, dev
);