net: derive socket timeval from target ABI - #459
Open
xuchang-vivo wants to merge 3 commits into
Open
Conversation
Contributor
Author
|
build_prs |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/32939596118. |
|
❌ Job failed. Failed jobs: build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/32939596118. |
Contributor
Author
|
build_prs |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/32942264528. |
|
✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/32942264528. |
Contributor
Author
|
build_prs |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/32949206198. |
|
✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/32949206198. |
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.
Summary
timevalsyscall layout directly from the BlueOS target data model.i32fields on ILP32 targets and twoi64fields on LP64 targets.time_t,suseconds_t, ortimevaldefinitions.Durationnanoseconds.Motivation
Socket options cross a syscall ABI boundary. Their binary layout must be determined by the supported BlueOS target ABI, not inferred from libc Rust type aliases that can change independently or disagree with the prebuilt Rust standard library.
BlueOS currently supports ILP32 and LP64 target data models:
timeval { i32 tv_sec; i32 tv_usec; }timeval { i64 tv_sec; i64 tv_usec; }The kernel now accepts only the layout for the active target and converts it into an internal
i64seconds/microseconds representation. This keeps the syscall ABI explicit and independent of libc implementation details.References
setsockopt()getsockopt()timevalTesting
rustfmt --check kernel/src/net/types.rs kernel/src/net/syscalls.rsgit diff --check