Skip to content

Commit

Permalink
sys/socket: use __attribute__((packed)) to avoid changes in
Browse files Browse the repository at this point in the history
the size of struct sockaddr_storage due to struct alignment
  • Loading branch information
nuttxs authored and acassis committed Nov 1, 2024
1 parent a14b97b commit 3818ce8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/sys/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ struct sockaddr_storage

/* Following fields are implementation-defined */

struct
struct __attribute__((packed))
{
char ss_pad1[SS_PAD1SIZE]; /* 6-byte pad; this is to make implementation-defined
* pad up to alignment field that follows explicit in
Expand Down

0 comments on commit 3818ce8

Please sign in to comment.