!sched: drop CONFIG_SYSTEM_TIME64 / CONFIG_HAVE_LONG_LONG / CONFIG_LIBC_LONG_LONG and sclock_t#3468
Conversation
c41e647 to
fbb77e3
Compare
linguini1
left a comment
There was a problem hiding this comment.
Marking change request here for testing
fbb77e3 to
1f33dfd
Compare
1f33dfd to
2bfddba
Compare
e91a84a to
677d340
Compare
update with the test and log. |
Tests provided; although maybe others can help test some of the other changed apps/on smaller devices.
|
Thank you @xiaoxiang781216, I am for this change, please lets mark it with |
677d340 to
2bc1a0c
Compare
Done. |
The matching nuttx commit removes CONFIG_HAVE_LONG_LONG; clean up the
remaining users in nuttx-apps so that "long long" is always assumed:
- examples/noteprintf, examples/nxscope:
unconditionally exercise the %lld / long long branch.
- fsutils/mkfatfs/configfat.c:
drop the 32-bit fall-back paths in mkfatfs_nfatsect12/16/32;
always use uint64_t for the FAT-size arithmetic.
- logging/nxscope/nxscope_chan.c:
drop the CONFIG_HAVE_LONG_LONG guard around the 64-bit
sample helpers.
- netutils/ftpd, netutils/ntpclient:
always emit the 64-bit format strings.
- testing/fs/fstest/fstest_main.c:
drop the parallel 32-bit verification path; keep only the
64-bit (long long) random pattern generator.
- system/zmodem/host/nuttx/compiler.h:
remove the host-side CONFIG_HAVE_LONG_LONG stub macro.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
CONFIG_LIBC_LONG_LONG has been removed; long long support is now unconditional. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
NuttX always uses a 64-bit system clock now (time_t/clock_t are
always 64-bit). Remove the obsolete CONFIG_SYSTEM_TIME64 #ifdef
branches and Kconfig dependency.
- examples/dronecan: drop SYSTEM_TIME64 dependency
- examples/netlink_route: always use PRIx64
- netutils/netinit: always use the 1-hour LONG_TIME_SEC
- netutils/ptpd: always pack the 48-bit seconds field and apply
the 64-bit overflow guard in timespec_delta_ns()
- testing/ostest/semtimed: always validate tv_sec >= 0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
…casts
Align with the upstream nuttx change that drops the sclock_t alias now
that clock_t is itself a signed 64-bit type (int64_t). Beyond the pure
sclock_t -> clock_t rename, this commit also removes the
now-unnecessary (time_t)-1 / (time_t)0 / (off_t)-1 casts that were
papering over the previously-unsigned time_t.
Files touched:
- examples/alarm/alarm_main.c: sclock_t -> clock_t
- netutils/dhcpd/dhcpd.c: sclock_t -> clock_t
- netutils/ftpd/ftpd.c: sclock_t -> clock_t
- netutils/thttpd/libhttpd.c,
netutils/thttpd/tdate_parse.c: drop (time_t)-1 / (time_t)0 /
(off_t)-1 sentinel casts
- system/resmonitor/filldisk.c,
system/zmodem/zm_receive.c: sclock_t -> clock_t
- testing/ostest/wdog.c: sclock_t -> clock_t (the bulk
of the rename, 30 sites)
- testing/testsuites/kernel/syscall/cases/{clock_nanosleep_test,
fsync_test,time_test}.c: drop (time_t)-1 casts in the
new signed-time_t world
No behavioural change.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2bc1a0c to
18c4678
Compare
cederom
left a comment
There was a problem hiding this comment.
Thank you @xiaoxiang781216 :-)
lupyuen
left a comment
There was a problem hiding this comment.
Tested OK on Arm64 + RISC-V 64-bit SBCs: Avaota-A1, StarPro64, Oz64. Thanks :-)
$ git clone https://github.com/xiaoxiang781216/incubator-nuttx nuttx --branch sched/remove-system-time64
HEAD is now at 9d4ea3aa21 arch/esp32: Fix conflicting types for '_times_r'
$ git clone https://github.com/xiaoxiang781216/incubator-nuttx-apps apps --branch sched/remove-system-time64
HEAD is now at 18c467857 !apps: replace sclock_t with clock_t and drop redundant time_t/off_t casts
...
nsh> uname -a
NuttX 3.6.1 9d4ea3aa21 May 6 2026 10:28:57 ...
nsh> ostest
ostest_main: Exiting with status 0|
I suggest we wait first for these to be merged, otherwise we might have nuttx vs nuttx-apps conflicts: |
Summary
Companion to apache/nuttx#18840. The NuttX core now unconditionally
uses 64-bit
time_t/clock_t, dropsCONFIG_SYSTEM_TIME64,CONFIG_HAVE_LONG_LONGandCONFIG_LIBC_LONG_LONG, and removes thesclock_talias. This PR aligns nuttx-apps with those changes:purges the obsolete
#ifdefs, the Kconfig dependencies, and thesclock_treferences.Changes
apps: drop CONFIG_SYSTEM_TIME64 conditionalsexamples/dronecan: dropSYSTEM_TIME64Kconfig dependency.examples/netlink_route: always usePRIx64fornb->ne_time.netutils/netinit: always use the one-hourLONG_TIME_SECvalue.netutils/ptpd: always pack the upper 16 bits of the 48-bit PTPseconds field, and always apply the 64-bit overflow guard in
timespec_delta_ns().testing/ostest/semtimed: always validatetv_sec >= 0.compiler: drop CONFIG_HAVE_LONG_LONG and require long long support#ifdef CONFIG_HAVE_LONG_LONGguards inexamples/noteprintf,examples/nxscope,fsutils/mkfatfs/configfat.c,logging/nxscope/nxscope_chan.c,netutils/ftpd,netutils/ntpclient, andtesting/fs/fstest/fstest_main.c.system/zmodem/host/nuttx/compiler.h.testing/ostest/wdog: replace sclock_t with clock_tsclock_t->clock_tintesting/ostest/wdog.c,netutils/thttpd(libhttpd.c,tdate_parse.c), andtesting/testsuites/kernel/syscall/cases(fsync_test.c,time_test.c). No behavioural change.testing/libc/scanftest: drop CONFIG_LIBC_LONG_LONG from help textCONFIG_LIBC_LONG_LONGmention from theTESTING_SCANFTESTKconfig help (companion tolibs/libc/stdio/Kconfigremoving the option).Testing
tools/checkpatch.sh -fclean on all 19 changed files.Built and ran
osteston bothsim:nsh(host x86_64) andrv-virt:nsh64(qemu-system-riscv64), against the matching nuttx PRapache/nuttx#18840. All tests including
wdog_testpass.sim:nsh
rv-virt:nsh64