buglwIP - A Lightweight TCP/IP stack - Bugs: bug #52684, Should read() return ETIMEDOUT on...


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

bug #52684: Should read() return ETIMEDOUT on a timeout?

Submitted by:  Douglas <ourairquality>
Submitted on:  Sun 17 Dec 2017 12:27:41 PM UTC  
Category:  sockets/netconn Severity:  3 - Normal
Item Group:  Change Request Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Sun 17 Dec 2017 09:21:43 PM UTC, comment #2: 

>  Looking at the Linux man pages it appears that it should
> return ETIMEDOUT if blocked

Where did you read that? It says we should return ETIMEDOUT on a transmission timeout. This mixes RX with TX, and is not what you seemed to indicate?

Anyway, closing as requested :-)

Simon Goldschmidt <goldsimon>
Project Administrator
Sun 17 Dec 2017 12:36:30 PM UTC, comment #1: 

Sorry, this seems to been considered before see https://savannah.nongnu.org/bugs/?28968 so there appears to be no issue here. Please close.

Douglas <ourairquality>
Sun 17 Dec 2017 12:27:41 PM UTC, original submission:  

Noticed that read() does not return ETIMEDOUT on a blocked read timeout, rather EWOULDBLOCK. Looking at the Linux man pages it appears that it should return ETIMEDOUT if blocked, and that EWOULDBLOCK has a meaning for non-blocking reads. This appears to make writing portable code a little more difficult. There is a note in the changelog about not using ETIMEDOUT, and perhaps there is a good reason?

A possible change to src/api/err.c

static const int err_to_errno_table[] = {
-  EWOULDBLOCK,   /* ERR_TIMEOUT    -3      Timeout                  */
+  ETIMEDOUT,     /* ERR_TIMEOUT    -3      Timeout                  */

Douglas <ourairquality>


No files currently attached


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 ourairquality (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-17 goldsimon StatusNone => Invalid
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.5