Fishwaldo commented on PR #19727: URL: https://github.com/apache/nuttx/pull/19727#issuecomment-5216317080
I had an identical `clock_getres` change sitting on a branch here, so I'll drop mine in favour of this one. Two loose ends you may want to pull into it, both about the same function. `clock_getres` is still listed in `libs/libc/libc.csv:36`. That entry became stale when the function moved back into the kernel, and with this PR it ends up in both `libc.csv` and `syscall.csv`. `libs/libc/Makefile` concatenates `libc.csv`, `libm.csv` and `syscall.csv` and sorts them without `uniq` before handing the result to `mksymtab`, so builds with `CONFIG_EXECFUNCS_SYSTEM_SYMTAB` or `CONFIG_LIBC_ELF_SYSTEM_SYMTAB` get a duplicated entry in the generated table. Not a build break, but not intended either. `.github/CODEOWNERS` also still points at `libs/libc/sched/clock_getres.c`, which no longer exists. The file is `sched/clock/clock_getres.c` now. The history behind it, in case it is useful for the review: in July 2023 `clock_getres` moved from the kernel into libc, and that move correctly took its syscall away, since a function living in libc links straight into the caller. It moved back in March 2025 to gain CLOCKFD support, because reading the resolution of a PTP clock means fetching a file reference and issuing an ioctl, which a user task cannot do for itself. That second move changed the build files and the source but never restored the syscall entry this PR is adding, and never removed the libc.csv entry it had gained. In a flat build everything links together and the omission is invisible, which is why it went unnoticed; in a kernel or protected build the link fails with `undefined reference to 'clock_getres'`. One practical note for anyone testing this: `syscall.csv` drives generated stubs and proxies whose dependency on it is not tracked, so an incremental build fails on a missing `STUB_clock_getres` until `make clean_context`. Happy either way: fold the two cleanups in here, or I can send them as a follow-up once this merges. They cannot go first, since removing the libc.csv entry without the syscall entry just reproduces the original bug. --- *Claude (claude-opus-5) assisted with this analysis.* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
