summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-10 06:30:52 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-10 06:30:52 +0000
commit83f3a059b90af6b7164a1d20bf6e8bf99fee19b2 (patch)
tree40db15657a21509a63cdf25e726c4d7f2155d447 /util
parent6ad7eaef3291d0fb177a2ffabba0b2b5ac1a2ed2 (diff)
util/nvmutil: add assert for off_t
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index d86b5822..77aa5d9a 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -55,6 +55,13 @@ typedef char static_assert_uint16_is_2[(sizeof(uint16_t) == 2) ? 1 : -1];
typedef char static_assert_uint32_is_4[(sizeof(uint32_t) == 4) ? 1 : -1];
/*
+ * We set _FILE_OFFSET_BITS 64, but we only handle
+ * files that are 128KB in size at a maximum, so we
+ * realistically only need 32-bit at a minimum.
+ */
+typedef char static_assert_off_t_is_64[(sizeof(off_t) >= 4) ? 1 : -1];
+
+/*
* The BSD versions that could realistically build
* nvmutil almost certainly have arc4random (first
* introduced in 1990s to early 2000s).