Skip to content

Commit 0fbd7d6

Browse files
committed
fix broken struct shmid_ds on powerpc (32-bit)
the kernel structure has padding of the shm_segsz member up to 64 bits, as well as 2 unused longs at the end. somehow that was overlooked when the powerpc port was added, and it has been broken ever since; applications compiled with the wrong definition do not correctly see the shm_segsz, shm_cpid, and shm_lpid members. fixing the definition just by adding the missing padding would break the ABI size of the structure as well as the position of the time64 shm_atime and shm_dtime members we added at the end. instead, just move one of the unused padding members from the original end (before time64) of the structure to the position of the missing padding. this preserves size and preserves correct behavior of any compiled code that was already working. programs affected by the wrong definition need to be recompiled with the correct one.
1 parent 4f3d346 commit 0fbd7d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/bits/shm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ struct shmid_ds {
88
unsigned long __shm_dtime_lo;
99
unsigned long __shm_ctime_hi;
1010
unsigned long __shm_ctime_lo;
11+
unsigned long __pad1;
1112
size_t shm_segsz;
1213
pid_t shm_cpid;
1314
pid_t shm_lpid;
1415
unsigned long shm_nattch;
15-
unsigned long __pad1;
1616
unsigned long __pad2;
1717
time_t shm_atime;
1818
time_t shm_dtime;

0 commit comments

Comments
 (0)