qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] bsd-user/signal.c: Only copy the _capsicum for FreeBSD_versi


From: Richard Henderson
Subject: Re: [PATCH] bsd-user/signal.c: Only copy the _capsicum for FreeBSD_version > 1400026
Date: Wed, 2 Feb 2022 08:06:37 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 2/2/22 07:52, Warner Losh wrote:
The capsicum signal stuff is new with FreeBSD 14, rev 1400026, so only
copy them on a new enough system.

Signed-off-by: Warner Losh <imp@bsdimp.com>
---
  bsd-user/signal.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/bsd-user/signal.c b/bsd-user/signal.c
index ad22ba9d90d..b43266e6e06 100644
--- a/bsd-user/signal.c
+++ b/bsd-user/signal.c
@@ -242,8 +242,10 @@ static inline void 
host_to_target_siginfo_noswap(target_siginfo_t *tinfo,
           * one, then we know what to save.
           */
          if (sig == TARGET_SIGTRAP) {
+#if defined(__FreeBSD_version) && __FreeBSD_version >= 1400026
              tinfo->_reason._capsicum._syscall =
                  info->_reason._capsicum._syscall;
+#endif
              si_type = QEMU_SI_CAPSICUM;
          }

Do you really want the entire IF inside the ifdef?
Setting QEMU_SI_CAPSICUM doesn't make sense for earlier versions...


r~

          break;
@@ -296,8 +298,10 @@ static void tswap_siginfo(target_siginfo_t *tinfo, const 
target_siginfo_t *info)
          __put_user(info->_reason._poll._band, &tinfo->_reason._poll._band);
          break;
      case QEMU_SI_CAPSICUM:
+#if defined(__FreeBSD_version) && __FreeBSD_version >= 1400026
          __put_user(info->_reason._capsicum._syscall,
                     &tinfo->_reason._capsicum._syscall);
+#endif
          break;
      default:
          g_assert_not_reached();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]