diff options
author | Thomas Voss <mail@thomasvoss.com> | 2021-09-09 02:42:25 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2021-09-09 02:42:25 +0200 |
commit | 00974c325bfdb24c6027a87ce391cfda0ab58fcb (patch) | |
tree | 5d6de4e857a4adbcb7ff5a4e154bf7075e763c86 /extras |
Genesis commit
Diffstat (limited to 'extras')
-rw-r--r-- | extras/sizeof_struct_stat.c | 12 |
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; +} |