@samitouri / QOSamiQemu / commits / 810ccafa57

bsd-user: Create os-syscall.h

Create os-syscall.h. The purpose of this file is to define anything that's different among the BSDs, like system call numbers and time_t. While there's a lot more different between the BSDs, this is at least a start at capturing it. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Signed-off-by: Warner Losh <imp@bsdimp.com>

Warner Losh committed Apr 13, 2026 at 08:54 UTC 810ccafa57305f531104373f0d37ab43c72c4ea3
1 file changed +21
bsd-user/freebsd/os-syscall.h new
+21
@@ -0,0 +1,21 @@
1 +/*
2 + * Copyright (c) 2023 Warner Losh <imp@bsdimp.com>
3 + *
4 + * SPDX-License-Identifier: GPL-2.0-or-later
5 + *
6 + * OS-Specific portion of syscall_defs.h
7 + */
8 +
9 +#include "syscall_nr.h"
10 +
11 +/*
12 + * FreeBSD uses a 64bits time_t except on i386 so we have to add a special case
13 + * here.
14 + */
15 +#if defined(TARGET_I386) && !defined(TARGET_X86_64)
16 +typedef int32_t target_time_t;
17 +#else
18 +typedef int64_t target_time_t;
19 +#endif
20 +
21 +typedef abi_long target_suseconds_t;