@samitouri / QOSamiQemu / commits / d21201257a

bsd-user: Add call to do_bsd_ioctl and add bsd-ioctl.c to the build

Finally, connect do_bsd_ioctl to the build. Call bsd_ioctl_init() from syscall_init() Signed-off-by: Stacey Son <sson@FreeBSD.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Signed-off-by: Warner Losh <imp@bsdimp.com>

Stacey Son committed Apr 30, 2026 at 23:13 UTC d21201257aa736ed5f80732f59a60a8b2e8f567f
2 files changed +10
bsd-user/freebsd/os-syscall.c
+9
@@ -34,6 +34,7 @@
34
35 /* BSD independent syscall shims */
36 #include "bsd-file.h"
37 +#include "bsd-ioctl.h"
38 #include "bsd-mem.h"
39 #include "bsd-proc.h"
40 #include "bsd-misc.h"
@@ -689,6 +690,13 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1,
690 ret = do_bsd_undelete(arg1);
691 break;
692
693 + /*
694 + * ioctl(2)
695 + */
696 + case TARGET_FREEBSD_NR_ioctl: /* ioctl(2) */
697 + ret = do_bsd_ioctl(arg1, arg2, arg3);
698 + break;
699 +
700 /*
701 * stat system calls
702 */
@@ -993,4 +1001,5 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
1001
1002 void syscall_init(void)
1003 {
1004 + init_bsd_ioctl();
1005 }
bsd-user/meson.build
+1
@@ -7,6 +7,7 @@ bsd_user_ss = ss.source_set()
7 common_user_inc += include_directories('include')
8
9 bsd_user_ss.add(files(
10 + 'bsd-ioctl.c',
11 'bsd-mem.c',
12 'bsd-misc.c',
13 'bsd-proc.c',