#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);
safe_syscall4(ssize_t, pwritev, int, fd, const struct iovec *, iov, int, iovcnt,
off_t, offset);
-void target_set_brk(abi_ulong new_brk)
-{
-}
+/* 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);
/*
* errno conversion.
/*
* process system calls
*/
+ case TARGET_FREEBSD_NR_fork: /* fork(2) */
+ ret = do_freebsd_fork(cpu_env);
+ break;
+
+ case TARGET_FREEBSD_NR_vfork: /* vfork(2) */
+ ret = do_freebsd_vfork(cpu_env);
+ break;
+
+ case TARGET_FREEBSD_NR_rfork: /* rfork(2) */
+ ret = do_freebsd_rfork(cpu_env, arg1);
+ break;
+
+ case TARGET_FREEBSD_NR_pdfork: /* pdfork(2) */
+ ret = do_freebsd_pdfork(cpu_env, arg1, arg2);
+ break;
+
case TARGET_FREEBSD_NR_execve: /* execve(2) */
ret = do_freebsd_execve(arg1, arg2, arg3);
break;
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
+
+#if defined(__FreeBSD_version) && __FreeBSD_version >= 1300049
+ case TARGET_FREEBSD_NR_shm_rename: /* shm_rename(2) */
+ ret = do_freebsd_shm_rename(arg1, arg2, arg3);
+ break;
+#endif
/*
* sys{ctl, arch, call}