mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
cgroup-util: enforce alignment of f_handle
The change in4d2e61211dbroke armv7 where uintptr_t is 4 bytes: /* test_id */ Assertion '((uintptr_t) _p) % alignof(uint64_t) == 0' failed at src/basic/cgroup-util.c:108, function cg_get_cgroupid_at(). Aborting. (gdb) p (uintptr_t)fh.file_handle.f_handle % _Alignof(uint64_t) $9 = 4 Enforce that the structure is aligned as expected Follow-up for4d2e61211d
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
typedef union {
|
||||
struct file_handle file_handle;
|
||||
uint8_t space[offsetof(struct file_handle, f_handle) + sizeof(uint64_t)];
|
||||
} cg_file_handle;
|
||||
} _alignas_(uint64_t) cg_file_handle;
|
||||
|
||||
#define CG_FILE_HANDLE_INIT \
|
||||
(cg_file_handle) { \
|
||||
|
||||
Reference in New Issue
Block a user