diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2018-06-07 16:22:57 +0100 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2018-06-07 16:22:57 +0100 |
| commit | a674da0ab7eae704c3f91749114ec6ca00c663d7 (patch) | |
| tree | 23f8503e8b1977f8dd1d41cfa74cc840ade5d691 /hw/9pfs/9p-util.c | |
| parent | 8e36d27c5a7b99a7adb40cfda2f92b1d97216e84 (diff) | |
| parent | aca6897fba149a2a650dcdf5a5e1ae828371f4aa (diff) | |
| download | focaccia-qemu-a674da0ab7eae704c3f91749114ec6ca00c663d7.tar.gz focaccia-qemu-a674da0ab7eae704c3f91749114ec6ca00c663d7.zip | |
Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging
Mostly bug fixes and code sanitization motivated by the upcoming support for Darwin hosts. Thanks to Keno Fischer. # gpg: Signature made Thu 07 Jun 2018 11:30:56 BST # gpg: using RSA key 71D4D5E5822F73D6 # gpg: Good signature from "Greg Kurz <groug@kaod.org>" # gpg: aka "Gregory Kurz <gregory.kurz@free.fr>" # gpg: aka "[jpeg image of size 3330]" # Primary key fingerprint: B482 8BAF 9431 40CE F2A3 4910 71D4 D5E5 822F 73D6 * remotes/gkurz/tags/for-upstream: 9p: xattr: Properly translate xattrcreate flags 9p: Properly check/translate flags in unlinkat 9p: local: Avoid warning if FS_IOC_GETVERSION is not defined 9p: xattr: Fix crashes due to free of uninitialized value 9p: Move a couple xattr functions to 9p-util 9p: local: Properly set errp in fstatfs error path 9p: proxy: Fix size passed to `connect` Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/9pfs/9p-util.c')
| -rw-r--r-- | hw/9pfs/9p-util.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/hw/9pfs/9p-util.c b/hw/9pfs/9p-util.c index f709c27a1f..614b7fc34d 100644 --- a/hw/9pfs/9p-util.c +++ b/hw/9pfs/9p-util.c @@ -24,3 +24,36 @@ ssize_t fgetxattrat_nofollow(int dirfd, const char *filename, const char *name, g_free(proc_path); return ret; } + +ssize_t flistxattrat_nofollow(int dirfd, const char *filename, + char *list, size_t size) +{ + char *proc_path = g_strdup_printf("/proc/self/fd/%d/%s", dirfd, filename); + int ret; + + ret = llistxattr(proc_path, list, size); + g_free(proc_path); + return ret; +} + +ssize_t fremovexattrat_nofollow(int dirfd, const char *filename, + const char *name) +{ + char *proc_path = g_strdup_printf("/proc/self/fd/%d/%s", dirfd, filename); + int ret; + + ret = lremovexattr(proc_path, name); + g_free(proc_path); + return ret; +} + +int fsetxattrat_nofollow(int dirfd, const char *filename, const char *name, + void *value, size_t size, int flags) +{ + char *proc_path = g_strdup_printf("/proc/self/fd/%d/%s", dirfd, filename); + int ret; + + ret = lsetxattr(proc_path, name, value, size, flags); + g_free(proc_path); + return ret; +} |