-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Cleanups for missing_xyz.h headers #37904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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. |
7e49f0e
to
14ad02f
Compare
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. |
d6e2519
to
c27bfba
Compare
c27bfba
to
86a379a
Compare
4d841a5
to
6a0e5ef
Compare
Re-rebased to fix the conflict with bpf-delegate generator. |
ad6590d
to
732094e
Compare
…el headers to src/include/uapi/ Preparation for later changes.
732094e
to
53f279b
Compare
- 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.
53f279b
to
531e6a2
Compare
This also renames relevant files in the same way. Addresses systemd#37904 (comment)
This also renames relevant files in the same way. Addresses #37904 (comment)
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.