[LTP] [PATCH V3 00/17] Syscalls: Add support for time64 variants

Viresh Kumar viresh.kumar@linaro.org
Tue May 19 11:42:01 CEST 2020


On 18-05-20, 11:21, Arnd Bergmann wrote:
> For msgctl/semctl/shmctl, the existing syscalls were extended in a
> compatible way, using an extended 'high' field for each 32-bit
> seconds value. I later learned that on some architectures, the
> 'compat' version of that failed to zero-initialize those fields, so I
> guess all we need is a test that ensures this was fixed correctly,
> by initializing the '*_high' to something nonzero before calling
> the syscall, and checking that it gets zero-filled by the syscall.

Okay, I see the new structure (struct semid64_ds) getting added to the
kernel. But I am not sure how to call the 'compat' version, can you
please help ?

Do I just need to call like this ?

	struct semid64_ds buf_ds = {
                .sem_otime_high = 1,
                .sem_ctime_high = 1
        };
	union semun arg;

	arg.buf = &buf_ds;
	semctl(semid, 0, IPC_STAT, arg);

?
-- 
viresh


More information about the ltp mailing list