aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2022-02-10 21:26:53 +0000
committerWarner Losh <imp@FreeBSD.org>2022-02-10 21:32:20 +0000
commitd4f495fbf88fbc0391b221ce2315a820ad31236d (patch)
treee9769ff88d1e8b7e0010f86e9db4509fe33ba312
parent0c988f92dc47091498e4aad01a8505253c8e9111 (diff)
downloadsrc-d4f495fbf88fbc0391b221ce2315a820ad31236d.tar.gz
src-d4f495fbf88fbc0391b221ce2315a820ad31236d.zip
i386: Add static asssert for context size
Add a static assert for the siginfo_t, mcontext_t and ucontext_t sizes. These are de-facto ABI options and cannot change size ever. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D34211
-rw-r--r--sys/i386/i386/exec_machdep.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/i386/i386/exec_machdep.c b/sys/i386/i386/exec_machdep.c
index 01602e43733f..0463615d96d9 100644
--- a/sys/i386/i386/exec_machdep.c
+++ b/sys/i386/i386/exec_machdep.c
@@ -115,6 +115,10 @@ static void freebsd4_sendsig(sig_t catcher, ksiginfo_t *, sigset_t *mask);
extern struct sysentvec elf32_freebsd_sysvec;
+_Static_assert(sizeof(mcontext_t) == 640, "mcontext_t size incorrect");
+_Static_assert(sizeof(ucontext_t) == 704, "ucontext_t size incorrect");
+_Static_assert(sizeof(siginfo_t) == 64, "siginfo_t size incorrect");
+
/*
* Send an interrupt to process.
*