2 ms·
Must have been supported for a while because this stuff is even used in Linux: #define __packed2__ __attribute__((packed, aligned(2))) /* * Syste
by qb45 10y ago
Must have been supported for a while because this stuff is even used in Linux:
#define __packed2__ __attribute__((packed, aligned(2)))
/*
* SystemV FS comes in two variants:
* sysv2: System V Release 2 (e.g. Microport), structure elements aligned(2).
* sysv4: System V Release 4 (e.g. Consensys), structure elements aligned(4).
*/
struct sysv2_super_block {
__fs16 s_isize; /* index of first data zone */
__fs32 s_fsize __packed2__; /* total number of zones of this fs */
http://lxr.free-electrons.com/source/include/linux/sysv_fs.h#L98 http://lxr.free-electrons.com/source/include/linux/sysv_fs.h...
- codys 10y agoNote the use of `packed`. `packed` causes the alignment to be set as small as possible (1 byte). The aligned(2) that follows then increases the alignment from 1 byte to 2 bytes.
- qb45 10y agoYeah, you're right. Add packed then if you want but I swear the code I posted works on 5.4 as it is.