[LTP] [PATCH] syscalls/stime: Fix Time Overflow for 2038 Problem on 32-bit Systems

Song, Jiaying (CN) Jiaying.Song.CN@windriver.com
Wed May 7 09:55:50 CEST 2025


Dear Andrea Cervesato,

If the goal of stime01 (with tst_variant=2) is specifically to test the settimeofday syscall directly, then my patch is not appropriate.

After further investigation, I found that the failure on 32-bit Y2038 systems is mainly due to the fact that the kernel's syscall implementation:

SYSCALL_DEFINE2(settimeofday, struct __kernel_old_timeval __user *, tv,
                struct timezone __user *, tz)

does not support Y2038, since it relies on __kernel_old_timeval.

So the test case fails for expected reasons. Please feel free to disregard my patch.

Kind regards,
Jiaying.

-----Original Message-----
From: Andrea Cervesato <andrea.cervesato@suse.com> 
Sent: Wednesday, April 30, 2025 3:29 PM
To: Song, Jiaying (CN) <Jiaying.Song.CN@windriver.com>; ltp@lists.linux.it
Cc: Cyril Hrubis <chrubis@suse.cz>; Petr Vorel <pvorel@suse.cz>
Subject: Re: [LTP] [PATCH] syscalls/stime: Fix Time Overflow for 2038 Problem on 32-bit Systems

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hi!

I noticed that stime01 is equivalent to settimeofday01 when tst_variant=2. So I'm wondering if it makes sense to keep that variant, considering that it creates issues in 32bit systems. In my opinion, we should probably remove the usage of settimeofday inside stime01 and to keep settimeofday01 instead.

@Petr @Cyril WDYT?

Kind regards,
Andrea Cervesato



More information about the ltp mailing list