Joan,

the return type is related to the type of  struct lwip_sock's 'err' member.
reading the comment /** last error that occurred on this socket (in fact, all our errnos fit into an u8_t) */ makes it clear this is just a size improvement which holds for our error definitions but might not hold for all errnos assigned.

It should be safe to change (and I think we could do better than just using u8_t here, in terms of portability).

However, I'd really be interested where your problem comes from. We only assign known error numbers to sock->err, so are you using E* defines that don't fit into an u8_t?

Simon


Joan Lledó wrote:
Hello,

lwip_getsockopt_impl() in api/sockets.c returns u8_t, which is enough for most errno implementations, but some implementations need all 32 bits. Please, take a look at this thread:

https://lists.debian.org/debian-hurd/2002/01/msg00022.html

I've changed return type to u32_t and have also needed to mask the value when converting it to u8_t in sockets.c:302. Is it safe to do this?

Thank you.


_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to