qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 04/10] bsd-user: Implement freebsd11_mknod, freebsd11_mknodat


From: Richard Henderson
Subject: Re: [PATCH 04/10] bsd-user: Implement freebsd11_mknod, freebsd11_mknodat and mknodat
Date: Mon, 20 Jun 2022 12:13:35 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 6/20/22 10:42, Warner Losh wrote:
These implement both the old-pre INO64 mknod variations, as well as the
now current INO64 variant. To implement the old stuff, we use some
linker magic to bind to the old versions of these functions.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Michal Meloun <mmel@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
  bsd-user/bsd-file.h           | 59 +++++++++++++++++++++++++++++++++++
  bsd-user/freebsd/os-syscall.c | 15 +++++++++
  2 files changed, 74 insertions(+)

diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h
index 0585f6a2a40..3be832b2a74 100644
--- a/bsd-user/bsd-file.h
+++ b/bsd-user/bsd-file.h
@@ -51,6 +51,16 @@ do {                                        \
      unlock_user(p1, arg1, 0);               \
  } while (0)
+#ifndef BSD_HAVE_INO64
+#define freebsd11_mknod         mknod
+#define freebsd11_mknodat       mknodat
+#else
+int freebsd11_mknod(char *path, mode_t mode, uint32_t dev);
+__sym_compat(mknod, freebsd11_mknod, FBSD_1.0);
+int freebsd11_mknodat(int fd, char *path, mode_t mode, uint32_t dev);
+__sym_compat(mknodat, freebsd11_mknodat, FBSD_1.1);
+#endif

Where does BSD_HAVE_INO64 come from?  I can't find it defined in freebsd git.

You should probably avoid the linker tricks and use direct syscalls of SYS_freebsd11_mknodat etc.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]