@samitouri / QOSamiQemu / commits / 75f6b9bcad

bsd-user: Add do_bsd_quotactl, do_bsd_reboot and do_bsd_getdtablesize

Add some trivial misc system calls: stub implementations for quotactl(2) and reboot(2) syscall; a trivial do_bsd_getdtablesize that calls getdtablesize(2). Signed-off-by: Stacey Son <sson@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>

Stacey Son committed Feb 2, 2026 at 16:39 UTC 75f6b9bcadd7be140a6f1f49ce89893fb4d2dbe2
1 file changed +41
bsd-user/bsd-misc.h new
+41
@@ -0,0 +1,41 @@
1 +/*
2 + * miscellaneous BSD system call shims
3 + *
4 + * Copyright (c) 2013 Stacey D. Son
5 + *
6 + * SPDX-License-Identifier: GPL-2.0-or-later
7 + */
8 +
9 +#ifndef BSD_MISC_H
10 +#define BSD_MISC_H
11 +
12 +#include <sys/types.h>
13 +#include <sys/ipc.h>
14 +#include <sys/msg.h>
15 +#include <sys/sem.h>
16 +#include <sys/uuid.h>
17 +
18 +#include "qemu-bsd.h"
19 +
20 +/* quotactl(2) */
21 +static inline abi_long do_bsd_quotactl(abi_ulong path, abi_long cmd,
22 + __unused abi_ulong target_addr)
23 +{
24 + qemu_log("qemu: Unsupported syscall quotactl()\n");
25 + return -TARGET_ENOSYS;
26 +}
27 +
28 +/* reboot(2) */
29 +static inline abi_long do_bsd_reboot(abi_long how)
30 +{
31 + qemu_log("qemu: Unsupported syscall reboot()\n");
32 + return -TARGET_ENOSYS;
33 +}
34 +
35 +/* getdtablesize(2) */
36 +static inline abi_long do_bsd_getdtablesize(void)
37 +{
38 + return get_errno(getdtablesize());
39 +}
40 +
41 +#endif /* BSD_MISC_H */