]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-sizeof: print size socklen_t
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 2 Mar 2020 14:52:28 +0000 (15:52 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 2 Mar 2020 14:54:57 +0000 (15:54 +0100)
It returns 32 bits, unsigned on amd64, so it's probably similar everywhere
with glibc. But let's make the code generic, without assuming specific size
or signedness.

src/test/test-sizeof.c

index 7fc16a62b656c5d497cecdd6c47fc88192dc7972..1020e0cb3153594bcd7f8781e129b82404afc8f2 100644 (file)
@@ -3,6 +3,8 @@
 #include <sched.h>
 #include <stdio.h>
 #include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
 
 #define __STDC_WANT_IEC_60559_TYPES_EXT__
 #include <float.h>
@@ -65,6 +67,7 @@ int main(void) {
         info(pid_t);
         info(uid_t);
         info(gid_t);
+        info(socklen_t);
 
         info(__cpu_mask);