summary refs log tree commit diff stats
path: root/bsd-user/freebsd/os-syscall.c
diff options
context:
space:
mode:
authorKarim Taha <kariem.taha2.7@gmail.com>2023-09-25 21:26:51 +0300
committerWarner Losh <imp@bsdimp.com>2023-10-03 17:14:06 -0600
commit0c3529888a427cefe248227423f7a89c8f665fab (patch)
tree0ee85931a523ce1bc242212b6951f206a0c85f2f /bsd-user/freebsd/os-syscall.c
parent137d963cfb1c9f0d9e76a40229df2996809b746b (diff)
downloadfocaccia-qemu-0c3529888a427cefe248227423f7a89c8f665fab.tar.gz
focaccia-qemu-0c3529888a427cefe248227423f7a89c8f665fab.zip
bsd-user: Implement shm_open2(2) system call
Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-6-kariem.taha2.7@gmail.com>
Diffstat (limited to 'bsd-user/freebsd/os-syscall.c')
-rw-r--r--bsd-user/freebsd/os-syscall.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
index d04712f0a7..122e186b50 100644
--- a/bsd-user/freebsd/os-syscall.c
+++ b/bsd-user/freebsd/os-syscall.c
@@ -33,18 +33,14 @@
 #include "signal-common.h"
 #include "user/syscall-trace.h"
 
+/* BSD independent syscall shims */
 #include "bsd-file.h"
 #include "bsd-proc.h"
 
 /* BSD dependent syscall shims */
 #include "os-stat.h"
 #include "os-proc.h"
-
-/* used in os-proc */
-safe_syscall4(pid_t, wait4, pid_t, wpid, int *, status, int, options,
-    struct rusage *, rusage);
-safe_syscall6(pid_t, wait6, idtype_t, idtype, id_t, id, int *, status, int,
-    options, struct __wrusage *, wrusage, siginfo_t *, infop);
+#include "os-misc.h"
 
 /* I/O */
 safe_syscall3(int, open, const char *, path, int, flags, mode_t, mode);
@@ -65,6 +61,12 @@ safe_syscall3(ssize_t, writev, int, fd, const struct iovec *, iov, int, iovcnt);
 safe_syscall4(ssize_t, pwritev, int, fd, const struct iovec *, iov, int, iovcnt,
     off_t, offset);
 
+/* used in os-proc */
+safe_syscall4(pid_t, wait4, pid_t, wpid, int *, status, int, options,
+    struct rusage *, rusage);
+safe_syscall6(pid_t, wait6, idtype_t, idtype, id_t, id, int *, status, int,
+    options, struct __wrusage *, wrusage, siginfo_t *, infop);
+
 void target_set_brk(abi_ulong new_brk)
 {
 }
@@ -796,6 +798,14 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1,
         ret = do_freebsd_fcntl(arg1, arg2, arg3);
         break;
 
+        /*
+         * Memory management system calls.
+         */
+#if defined(__FreeBSD_version) && __FreeBSD_version >= 1300048
+    case TARGET_FREEBSD_NR_shm_open2: /* shm_open2(2) */
+        ret = do_freebsd_shm_open2(arg1, arg2, arg3, arg4, arg5);
+        break;
+#endif
 
         /*
          * sys{ctl, arch, call}