patchlwIP - A Lightweight TCP/IP stack - Patches: patch #9262, Support for 32bit errno codes

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9262: Support for 32bit errno codes

Submitted by:  Joan Lledó <jllledo>
Submitted on:  Fri 17 Feb 2017 09:52:22 AM UTC  
 
Category:  sockets/netconn Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  Simon Goldschmidt <goldsimon> Open/Closed:  Closed
Planned Release:  None

( Jump to the original submission)

Mon 20 Feb 2017 08:02:45 PM UTC, comment #7: 

Because we already have too many defines that keep breaking the source code when changes are made (as your patch broke the !CORE_LOCKING case). And since sockets are rather used for bigger systems, I felt the 4 bytes per socket aren't worth it. Especially when seeing that the standard defines the error codes as int...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 20 Feb 2017 04:50:21 PM UTC, comment #6: 

Your last change seems a good idea, why have you reverted it? Thanks for your time.

Joan Lledó <jllledo>
Mon 20 Feb 2017 12:30:56 PM UTC, comment #5: 

And reverted the last mentioned change: Let's stay with the standard and accept the 4-bytes-per-socket memory increase...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 20 Feb 2017 11:54:42 AM UTC, comment #4: 

I've changed it again so that the default type is now 's8_t' for LWIP_PROVIDE_ERRNO and 'int' for the external errno.h case (which is what you're using).

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Mon 20 Feb 2017 11:44:41 AM UTC, comment #3: 

Still needed more fixes, but this should be done now. Thanks for the patch.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 17 Feb 2017 03:01:42 PM UTC, comment #2: 

Sorry for the lack of description.

Attached is a new patch with the requested changes.

(file #39775)

Joan Lledó <jllledo>
Fri 17 Feb 2017 11:18:36 AM UTC, comment #1: 

It would have helped to include a description in the original submission.

Excerpt from lwip-users:
"I was trying to compile LwIP in the Hurd and many warnings like this
one raised when compiling sockets.c:

./api/sockets.c: In function 'lwip_getsockopt_impl':
./api/sockets.c:1892:12: warning: large integer implicitly truncated
to unsigned type [-Woverflow]
return EBADF;
^~~~~

EBADF macro is defined in the Hurd's errno.h:"

Essentially, Hurd's errnos are defined in an enum (which is of type 'int' by the standard) and include "(0x10 << 26)", which is of course way out of our u8_t.

However, there are two things wrong with the patch:
a) struct sock -> err must be changed, too
b) you'd want to use 'int' instead of 'u32_t' to stay portable

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 17 Feb 2017 09:52:22 AM UTC, original submission:  
Joan Lledó <jllledo>

 

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by jllledo (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-20 goldsimon StatusNone => Done
        Assigned toNone => goldsimon
        Open/ClosedOpen => Closed
    2017-02-17 jllledo Attached File- => Added 0001-Support-for-32bit-errno-codes.patch, #39775
    2017-02-17 jllledo Attached File- => Added 0001-Support-for-32bit-errno-codes.patch, #39771

    Back to the top


    Powered by Savane 3.5