Skip to content

Conversation

yuwata
Copy link
Member

@yuwata yuwata commented Jun 19, 2025

Continuation of #37960.

The same concern as expalined in #37960 exists also in missing_syscall.h. If we use enough new glibc, a function we want to use may be already provided by glibc, but our baseline glibc may not. And it is hard to detect in our daily development.

This moves all prototypes of syscalls to relevant headers, and missing syscall functions are defined in relevant .c files of libc wrapper. This way, we can use usual header as is, e.g. when we want to write code with move_mount(), we can simply use sys/mount.h without checking if it is supported by our baseline glibc.

@YHNdnzj
Copy link
Member

YHNdnzj commented Jun 19, 2025

I'm not a fan of splitting missing_syscall.h. having a uniform location for trivial syscall wrappers makes sense, whereas they don't really fit into *-util owned by us. Also I'd really like those to remain static inline.

@yuwata yuwata force-pushed the cleanup-missing-headers branch from 7e49f0e to 14ad02f Compare June 19, 2025 17:01
@yuwata
Copy link
Member Author

yuwata commented Jun 19, 2025

I'm not a fan of splitting missing_syscall.h. having a uniform location for trivial syscall wrappers makes sense, whereas they don't really fit into *-util owned by us. Also I'd really like those to remain static inline.

That introduces many unnecessary header inclusion. E.g. when we want to use move_mount() in a .c file, then it needed to include many irrelevant headers for defining syscalls that are not used in the .c file.

@yuwata yuwata force-pushed the cleanup-missing-headers branch 2 times, most recently from d6e2519 to c27bfba Compare June 19, 2025 17:37
@yuwata yuwata force-pushed the cleanup-missing-headers branch from c27bfba to 86a379a Compare June 19, 2025 17:49
@keszybz keszybz added the ci-fails/needs-rework 🔥 Please rework this, the CI noticed an issue with the PR label Jul 10, 2025
@keszybz keszybz modified the milestones: v258, v259 Jul 10, 2025
@yuwata yuwata force-pushed the cleanup-missing-headers branch from 4d841a5 to 6a0e5ef Compare July 10, 2025 23:31
@github-actions github-actions bot added please-review PR is ready for (re-)review by a maintainer and removed ci-fails/needs-rework 🔥 Please rework this, the CI noticed an issue with the PR labels Jul 10, 2025
@yuwata
Copy link
Member Author

yuwata commented Jul 10, 2025

Re-rebased to fix the conflict with bpf-delegate generator.
Setting the green label based on the two approvals.

@yuwata yuwata added good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed and removed please-review PR is ready for (re-)review by a maintainer labels Jul 10, 2025
@yuwata yuwata force-pushed the cleanup-missing-headers branch 3 times, most recently from ad6590d to 732094e Compare July 11, 2025 03:30
…el headers to src/include/uapi/

Preparation for later changes.
@yuwata yuwata force-pushed the cleanup-missing-headers branch from 732094e to 53f279b Compare July 11, 2025 03:44
yuwata added 8 commits July 11, 2025 13:05
- pass our system include directories to make generators use our libc
  wrappers and latest kernel headers,
- include relevant headers in generated gperf file,
- use files() rather than find_program(), as the result of
  find_program() cannot be passed to 'input' of custom_target(),
- move generate-bpf-delegate-configs.py to src/core/, as it is only used
  by libcore.
…all.h

This also moves syscall tables and generators to the same directory.

Note, inclusion of asm/sgidefs.h is dropped, as it is already included
by unistd.h and sys/syscall.h.
Then, move syscall definitions to the wrapper, and prototypes are moved
to relevant headers.

This also adds checks for add_key() and request_key(), as one day
glibc may be going to add some of them separatedly.

The check for fspick in meson.build is dropped, as it is currently
unused in our code.

This also moves
- basic/missing_bpf.h -> include/override/linux/bpf.h,
- basic/missing_keyctl.h -> include/override/linux/keyctl.h.
To emphasize it is an array of bytes.
This also align variables.
No functional changes. Just refactoring.
The header raw-reboot.h is only used with reboot-util. Let's merge them.
Then, we can decrease the number of headers to be indirectly included
by including raw-clone.h. No functional change.
@yuwata yuwata force-pushed the cleanup-missing-headers branch from 53f279b to 531e6a2 Compare July 11, 2025 04:07
@yuwata yuwata merged commit 4d78513 into systemd:main Jul 11, 2025
46 of 51 checks passed
@yuwata yuwata deleted the cleanup-missing-headers branch July 11, 2025 06:20
@github-actions github-actions bot removed the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Jul 11, 2025
yuwata added a commit to yuwata/systemd that referenced this pull request Jul 11, 2025
This also renames relevant files in the same way.

Addresses systemd#37904 (comment)
yuwata added a commit that referenced this pull request Jul 11, 2025
This also renames relevant files in the same way.

Addresses #37904 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants