Typedef for __kernel_sa_family_t in linux/socket.h#578
Merged
eliben merged 1 commit intoeliben:mainfrom Aug 18, 2025
Merged
Conversation
eliben
reviewed
Aug 18, 2025
| #include "_fake_defines.h" | ||
| #include "_fake_typedefs.h" | ||
|
|
||
| typedef unsigned short __kernel_sa_family_t; |
Owner
There was a problem hiding this comment.
typedefs typically go into _fake_defines.h
Contributor
Author
There was a problem hiding this comment.
It can be moved to _fake_defines.h, no problem.
| @@ -1,2 +1,9 @@ | |||
| #ifndef _LINUX_SOCKET_H | |||
Owner
There was a problem hiding this comment.
Why are these needed? All fake includes share a single ifndef guard
Contributor
Author
There was a problem hiding this comment.
They won't be needed if the typedef goes to _fake_defines.h
ced7b02 to
bb74d6b
Compare
eliben
reviewed
Aug 18, 2025
| memory_order_acq_rel, | ||
| memory_order_seq_cst | ||
| } memory_order; | ||
| typedef unsigned short __kernel_sa_family_t; |
Owner
There was a problem hiding this comment.
Nit: could you please move next to other socket typedefs (search for "socket" in this file)? Thanks
This typedef that exists in the real `linux/socket.h` is masked by the `fake_libc_include` hierarchy. Having it in place allows to successfully parse a large number of Linux kernel headers necessary for netlink operations. This is very useful for Python projects that communicate with the kernel over netlink socket. In particular, this project: https://github.com/ionos-cloud/netlinklib/tree/main/netlinklib plans to use pyparser for parsing strcts defined in the kernel headers. Signed-off-by: Eugene Crosser <crosser@average.org>
bb74d6b to
359212b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This typedef that exists in the real
linux/socket.his masked by thefake_libc_includehierarchy. Having it in place allows to successfully parse a large number of Linux kernel headers necessary for netlink operations. This is very useful for Python projects that communicate with the kernel over netlink socket. In particular, this project:https://github.com/ionos-cloud/netlinklib/tree/main/netlinklib
plans to use pyparser for parsing strcts defined in the kernel headers.