diff options
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; +} |