-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add socklen_t #62
Comments
I actually think that we should just redefine everything to socklen_t (signed int) to be POSIX compatible on the source level. I don’t think that these length fields are expected to carry values more than 2^31-1 in the TCP/IP stack code anyway so we should end up binary level compatible too. |
just to give your brain a little boost :) this is done here already https://github.com/bitwiseworks/libcx/blob/master/src/net/libcx/net.h |
This seems more appropriate on OS/2. Needed for #62.
Needed for bitwiseworks/libc#62 to avoid typedef conflicts.
Note that I also added Note however that I did not change the socket function prototypes to use |
This is to reflect LIBC change, see bitwiseworks/libc#62 and bitwiseworks/libc#63.
This is missing since long. We have __socklen_t which is an unsigned 32-bit integer (__uint32_t) and in place of socklen_t our headers use u_int in structs (eg and cmsghdr) and int in function calls. Ie for structs it’s completely safe to replace u_int with socklen_t while for functions some thinking is needed because of the difference in signedness.
As POSIX suggests, socklen_t should not be larger than 2^31-1 which is a 32 bit signed integer. And this is what TCP/IP for OS/2 (which LIBC internally uses) implies too. For msghdr it’s a terrible mess there though, according to the TCP/IP 4.21 Programming Reference at least. Ie msg_namelen is int (which matches socklen_t) but msg_controllen is u_int (should be socklen_t too in POSIX). The OS/2 Toolkit headers define both as u_int though. Even more messy.
The text was updated successfully, but these errors were encountered: