lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] lwip_getsockopt_impl() return type


From: address@hidden
Subject: Re: [lwip-users] lwip_getsockopt_impl() return type
Date: Thu, 16 Feb 2017 20:51:09 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

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
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]