summaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2021-09-09 02:42:25 +0200
committerThomas Voss <mail@thomasvoss.com> 2021-09-09 02:42:25 +0200
commit00974c325bfdb24c6027a87ce391cfda0ab58fcb (patch)
tree5d6de4e857a4adbcb7ff5a4e154bf7075e763c86 /extras
Genesis commit
Diffstat (limited to 'extras')
-rw-r--r--extras/sizeof_struct_stat.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/extras/sizeof_struct_stat.c b/extras/sizeof_struct_stat.c
new file mode 100644
index 0000000..67b6b9c
--- /dev/null
+++ b/extras/sizeof_struct_stat.c
@@ -0,0 +1,12 @@
+#include <sys/stat.h>
+
+#include <stddef.h>
+#include <stdio.h>
+
+int
+main(void)
+{
+ printf("Size of stat struct:\t%zu bytes\nOffset of st_size:\t%zu\n", sizeof(struct stat),
+ offsetof(struct stat, st_size));
+ return 0;
+}