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 <s...@freebsd.org>
Signed-off-by: Michal Meloun <m...@freebsd.org>
Signed-off-by: Warner Losh <i...@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~