[parisc-linux] semid64_ds compiled on a 32-bit system has wrong expected size for sem_ctime

Carlos O'Donell carlos at baldric.uwo.ca
Mon Jan 26 13:34:30 MST 2004


On Mon, Jan 26, 2004 at 02:44:00PM -0500, Carlos O'Donell wrote:
> > struct semid64_ds {
> >         struct ipc64_perm sem_perm;             /* permissions .. see ipc.h */
> > #ifndef __LP64__
> >         unsigned int    __pad1; 
> > #endif
> >         __kernel_time_t sem_otime;              /* last semop time */
> > #ifndef __LP64__
> >         unsigned int    __pad2; 
> > #endif
> >         __kernel_time_t sem_ctime;              /* last change time */
> >         unsigned int    sem_nsems;              /* no. of semaphores in array */
> >         unsigned int    __unused1;
> >         unsigned int    __unused2;
> > };
> 
> Our 32-bit userspace will see different values for this depending on
> running a 32-bit kernel or 64-bit. That last sem_ctime should probably
> have a padding so our 32-bit userspace sees the right thing all the
> time.

Sorry, I got confused with sem_perm, __pad2 is the padding for ctime,
thanks for pointing that out Matthew. Changing the base posix type for
32-bit builds to "long" fixes all the compiler complaints.

False alarm :)

c.


More information about the parisc-linux mailing list