Signed-off-by: Warner Losh <[email protected]>
---
 bsd-user/freebsd/os-syscall.c |  5 +++++
 bsd-user/freebsd/os-thread.h  | 11 +++++++++++
 2 files changed, 16 insertions(+)

diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
index eb510bcab9..f82fa381ce 100644
--- a/bsd-user/freebsd/os-syscall.c
+++ b/bsd-user/freebsd/os-syscall.c
@@ -97,6 +97,7 @@ safe_syscall3(ssize_t, sendmsg, int, s, const struct msghdr 
*, msg, int, flags);
 safe_syscall1(int, thr_suspend, struct timespec *, timeout);
 safe_syscall5(int, _umtx_op, void *, obj, int, op, unsigned long, val, void *,
     uaddr, void *, uaddr2);
+safe_syscall2(int, sigfastblock, int, cmd, void *, ptr);
 
 /* used in os-time */
 safe_syscall2(int, nanosleep, const struct timespec *, rqtp, struct timespec *,
@@ -1175,6 +1176,10 @@ static abi_long freebsd_syscall(CPUArchState *env, int 
num, abi_long arg1,
         ret = do_freebsd__umtx_op(arg1, arg2, arg3, arg4, arg5);
         break;
 
+    case TARGET_FREEBSD_NR_sigfastblock: /* internal */
+        ret = do_freebsd_sigfastblock(arg1, arg2);
+        break;
+
         /*
          * ioctl(2)
          */
diff --git a/bsd-user/freebsd/os-thread.h b/bsd-user/freebsd/os-thread.h
index 6552c60337..dfb22e7cc2 100644
--- a/bsd-user/freebsd/os-thread.h
+++ b/bsd-user/freebsd/os-thread.h
@@ -17,6 +17,7 @@
 
 int safe_thr_suspend(struct timespec *timeout);
 int safe__umtx_op(void *, int, unsigned long, void *, void *);
+int safe_sigfastblock(int, void *);
 
 #if HOST_BIG_ENDIAN == TARGET_BIG_ENDIAN && \
     (TARGET_ABI_BITS == HOST_LONG_BITS || defined(UMTX_OP__32BIT))
@@ -593,4 +594,14 @@ static inline abi_long do_freebsd__umtx_op(abi_ulong obj, 
int op, abi_ulong val,
     return ret;
 }
 
+static inline abi_long do_freebsd_sigfastblock(abi_long cmd, abi_long ptr)
+{
+    void *hostptr = g2h_untagged(ptr);
+
+    if (hostptr == NULL) {
+        return -TARGET_EFAULT;
+    }
+    return get_errno(safe_sigfastblock(cmd, hostptr));
+}
+
 #endif /* FREEBSD_OS_THREAD_H */

-- 
2.55.0


Reply via email to