diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-03-27 14:48:36 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-03-27 14:48:36 -0400 |
commit | ccfc70a1ccca27a1481ae5dae11d8ea9f5fc8ef9 (patch) | |
tree | 6815ae9bb6f2c7e2befca6d9ca4bb68a669708ac /src/dir.c | |
parent | cef0869f62487b7a729b005f345e5ecd9a9bbfc7 (diff) | |
download | bfs-ccfc70a1ccca27a1481ae5dae11d8ea9f5fc8ef9.tar.xz |
dir: Explicitly align struct bfs_dir for the trailing dirent buffer
Diffstat (limited to 'src/dir.c')
-rw-r--r-- | src/dir.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -7,6 +7,7 @@ #include <dirent.h> #include <errno.h> #include <fcntl.h> +#include <stdalign.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> @@ -105,9 +106,10 @@ enum bfs_type bfs_mode_to_type(mode_t mode) { struct bfs_dir { #if BFS_GETDENTS - int fd; + alignas(sys_dirent) int fd; unsigned short pos; unsigned short size; + // sys_dirent buf[]; #else DIR *dir; struct dirent *de; |