summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_gpt.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2002-05-30 06:33:07 +0000
committermarcel <marcel@FreeBSD.org>2002-05-30 06:33:07 +0000
commit05e39ee52e7bba6274be13a20194812cca7afb48 (patch)
treef1e402744eded5421688c1d78d25e723a14e63a2 /sys/geom/geom_gpt.c
parent4898ea0542aae35dc9394097ca29f9215d1f28a6 (diff)
downloadFreeBSD-src-05e39ee52e7bba6274be13a20194812cca7afb48.zip
FreeBSD-src-05e39ee52e7bba6274be13a20194812cca7afb48.tar.gz
Add compile time asserts for the size of struct gpt_hdr and struct
gpt_ent. Use offsetof() for struct gpt_hdr to exclude padding.
Diffstat (limited to 'sys/geom/geom_gpt.c')
-rw-r--r--sys/geom/geom_gpt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/geom/geom_gpt.c b/sys/geom/geom_gpt.c
index a127ed0..568420d 100644
--- a/sys/geom/geom_gpt.c
+++ b/sys/geom/geom_gpt.c
@@ -57,6 +57,9 @@
#include <geom/geom.h>
#include <geom/geom_slice.h>
+CTASSERT(offsetof(struct gpt_hdr, padding) == 92);
+CTASSERT(sizeof(struct gpt_ent) == 128);
+
/*
* XXX: GEOM is not dynamic enough. We are forced to use a compile-time
* limit. The minimum number of partitions (128) as required by EFI is
OpenPOWER on IntegriCloud