[PATCH v4 3/3] sysv: linux: Pass 64-bit version of semctl syscall
Alistair Francis
alistair23@gmail.com
Thu Mar 26 22:11:18 GMT 2020
On Thu, Mar 26, 2020 at 12:01 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Thu, 26 Mar 2020, Alistair Francis via Libc-alpha wrote:
>
> > +#if __WORDSIZE == 32
> > +/* This is the "new" y2038 types defined after the 5.1 kernel. It allows
> > + * the kernel to use {o,c}time{_high} values to support a 64-bit time_t. */
> > +struct __semid_ds32 {
> > + struct ipc_perm sem_perm; /* operation permission struct */
> > + __syscall_ulong_t sem_otime; /* last semop() time */
> > + __syscall_ulong_t sem_otime_high; /* last semop() time high */
> > + __syscall_ulong_t sem_ctime; /* last time changed by semctl() */
> > + __syscall_ulong_t sem_ctime_high; /* last time changed by semctl() high */
> > + __syscall_ulong_t sem_nsems; /* number of semaphores in set */
> > + __syscall_ulong_t __glibc_reserved3;
> > + __syscall_ulong_t __glibc_reserved4;
> > +};
> > +#endif
>
> As far as I can see, this type is not used in any public interface, just
> internally in the implementation. Thus it should be defined in an
> internal header, not a bits/ installed header.
It is only user internally.
The problem is I couldn't find a place to put it where architectures
can override it. Is there a place I'm missing where I could put it?
>
> > + arg.buf->sem_nsems = arg.buf32->sem_nsems;
> > + arg.buf->sem_otime = arg.buf32->sem_otime |
> > + ((time_t) arg.buf32->sem_otime_high << 32);
> > + arg.buf->sem_ctime = arg.buf32->sem_ctime |
> > + ((time_t) arg.buf32->sem_ctime_high << 32);
>
> Split lines before not after operators, and make sure to include
> parentheses in such a case to ensure the operator at the start of the next
> line automatically goes in the correct column (see the GNU Coding
> Standards).
Fixed.
Alistair
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
More information about the Libc-alpha
mailing list