-
Notifications
You must be signed in to change notification settings - Fork 8k
net: socket: Change socklen_t to be 4 bytes long #96903
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
base: main
Are you sure you want to change the base?
Conversation
Discussion about the issue is here #96815 |
CI isn't happy with this change.. |
There is an issue when zephyr is compiled with native_sim_64 where size_t is 8 bytes. The socklen_t in specified as 4 bytes in Linux even for 64 bit builds so we have a conflict between Linux and Zephyr. To make things work properly, define socklen_t as uint32_t in order to align with Linux. Four bytes is enough for socket address length anyway. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
4f74b4c
to
9e5f175
Compare
This does modify public APIs, do we need some notes? |
The various socket option APIs in |
Add information that the socklen_t was changed from size_t, which can be either 32 or 64 bit long depending on system configuration, to always be 32 bit long. This is now aligned to way Linux is defining socklen_t. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
There was extra parameter when calling zassert_ok() which caused compilation warning. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
There was extra parameter when calling zassert_not_equal() which caused compilation warning. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Printing long int requires %ld when priting error. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
8555b65
to
2f3628a
Compare
|
|
There is an issue when zephyr is compiled with native_sim_64 where size_t is 8 bytes. The socklen_t in specified as 4 bytes in Linux even for 64 bit builds so we have a conflict between Linux and Zephyr. To make things work properly, define socklen_t as uint32_t in order to align with Linux. Four bytes is enough for socket address length anyway.