aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2025-11-08 21:20:09 +0100
committerLaytan Laats <laytanlaats@hotmail.com>2025-11-08 21:20:09 +0100
commit0a091063ce8062171197967ba4c72eea2a17123f (patch)
treeeeeb644f06f38105822388cdc6e4ababef1b3612 /tests
parentfb50a548f75a835d0edeccc57f28df62b059d481 (diff)
debug offsets
Diffstat (limited to 'tests')
-rw-r--r--tests/core/sys/posix/structs/structs.c5
-rw-r--r--tests/core/sys/posix/structs/structs.odin5
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/core/sys/posix/structs/structs.c b/tests/core/sys/posix/structs/structs.c
index 995c1a8c0..ac771057e 100644
--- a/tests/core/sys/posix/structs/structs.c
+++ b/tests/core/sys/posix/structs/structs.c
@@ -102,6 +102,11 @@ int main(int argc, char *argv[])
printf("iovec %zu %zu\n", sizeof(struct iovec), _Alignof(struct iovec));
printf("semid_ds %zu %zu\n", sizeof(struct semid_ds), _Alignof(struct semid_ds));
+ printf("semid_ds.sem_perm %zu\n", offsetof(struct semid_ds, sem_perm));
+ printf("semid_ds.sem_otime %zu\n", offsetof(struct semid_ds, sem_otime));
+ printf("semid_ds.sem_ctime %zu\n", offsetof(struct semid_ds, sem_ctime));
+ printf("semid_ds.sem_nsems %zu\n", offsetof(struct semid_ds, sem_nsems));
+
printf("sembuf %zu %zu\n", sizeof(struct sembuf), _Alignof(struct sembuf));
printf("itimerval %zu %zu\n", sizeof(struct itimerval), _Alignof(struct itimerval));
diff --git a/tests/core/sys/posix/structs/structs.odin b/tests/core/sys/posix/structs/structs.odin
index f2bead5ba..55369e386 100644
--- a/tests/core/sys/posix/structs/structs.odin
+++ b/tests/core/sys/posix/structs/structs.odin
@@ -68,6 +68,11 @@ main :: proc() {
fmt.println("iovec", size_of(posix.iovec), align_of(posix.iovec))
fmt.println("semid_ds", size_of(posix.semid_ds), align_of(posix.semid_ds))
+ fmt.println("semid_ds.sem_perm", offset_of(posix.semid_ds, sem_perm))
+ fmt.println("semid_ds.sem_otime", offset_of(posix.semid_ds, sem_otime))
+ fmt.println("semid_ds.sem_ctime", offset_of(posix.semid_ds, sem_ctime))
+ fmt.println("semid_ds.sem_nsems", offset_of(posix.semid_ds, sem_nsems))
+
fmt.println("sembuf", size_of(posix.sembuf), align_of(posix.sembuf))
fmt.println("itimerval", size_of(posix.itimerval), align_of(posix.itimerval))