Rust libc use repr(packed) as shown here for struct which will be then passed to system libc. For example, utsname is repr(packed) and then used in fn uname
As per the doc mentioned here,
repr(packed) forces Rust to strip any padding, and only align the type to a byte. This may improve the memory footprint, but will likely have other negative side-effects.
In particular, most architectures strongly prefer values to be aligned. This may mean the unaligned loads are penalized (x86),
Then why does rust libc use repr(packed) and not repr(C) for passing struct to system libc?