aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/9p-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/9pfs/9p-util.h')
-rw-r--r--hw/9pfs/9p-util.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h
index ccfc8b1..c314cf3 100644
--- a/hw/9pfs/9p-util.h
+++ b/hw/9pfs/9p-util.h
@@ -94,6 +94,13 @@ static inline int errno_to_dotl(int err) {
#define qemu_fgetxattr fgetxattr
#endif
+#define qemu_openat openat
+#define qemu_fstatat fstatat
+#define qemu_mkdirat mkdirat
+#define qemu_renameat renameat
+#define qemu_utimensat utimensat
+#define qemu_unlinkat unlinkat
+
static inline void close_preserve_errno(int fd)
{
int serrno = errno;
@@ -103,8 +110,8 @@ static inline void close_preserve_errno(int fd)
static inline int openat_dir(int dirfd, const char *name)
{
- return openat(dirfd, name,
- O_DIRECTORY | O_RDONLY | O_NOFOLLOW | O_PATH_9P_UTIL);
+ return qemu_openat(dirfd, name,
+ O_DIRECTORY | O_RDONLY | O_NOFOLLOW | O_PATH_9P_UTIL);
}
static inline int openat_file(int dirfd, const char *name, int flags,
@@ -115,8 +122,8 @@ static inline int openat_file(int dirfd, const char *name, int flags,
#ifndef CONFIG_DARWIN
again:
#endif
- fd = openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK,
- mode);
+ fd = qemu_openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK,
+ mode);
if (fd == -1) {
#ifndef CONFIG_DARWIN
if (errno == EPERM && (flags & O_NOATIME)) {