tasklwIP - A Lightweight TCP/IP stack - Tasks: task #11879, Add POSIX conformant header files

 
 

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

task #11879: Add POSIX conformant header files

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Wed 29 Feb 2012 04:51:49 PM UTC
   
 
Category:  None Should Start On:  Wed 29 Feb 2012 12:00:00 AM UTC
Should be Finished on:  Wed 29 Feb 2012 12:00:00 AM UTC Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Percent Complete:  0%
Open/Closed:  Closed Planned Release:  1.4.1
Effort:  0.00

Jump to the original submission

Sun 25 Mar 2012 01:18:07 PM UTC, comment #6: 


> Can you accept this patch for 1.4.1?


Done.

Added to both master and 1.4.1.

Simon Goldschmidt <goldsimon>
Group administrator
Fri 23 Mar 2012 11:52:05 AM UTC, comment #5: 


> Can you accept this patch for 1.4.1?


I'd say yes, as it's only 2 additional files which never get included unless the specific path is added to the include paths.

Simon Goldschmidt <goldsimon>
Group administrator
Fri 23 Mar 2012 11:20:46 AM UTC, comment #4: 

In fact, libcurl doesn't even need sys/select.h

src/include/posix/netdb.h and src/include/posix/sys/socket.h
are all we need :-)


diff -urN a/src/include/posix/netdb.h b/src/include/posix/netdb.h
--- a/src/include/posix/netdb.h 1970-01-01 01:00:00.000000000 +0100
+++ b/src/include/posix/netdb.h 2012-03-06 12:00:00.000000000 +0100
@@ -0,0 +1 @@
+#include "lwip/netdb.h"
diff -urN a/src/include/posix/sys/socket.h b/src/include/posix/sys/socket.h
--- a/src/include/posix/sys/socket.h    1970-01-01 01:00:00.000000000 +0100
+++ b/src/include/posix/sys/socket.h    2012-03-06 12:00:00.000000000 +0100
@@ -0,0 +1 @@
+#include "lwip/sockets.h"


Trivial, right?

Mason <mason>
Fri 23 Mar 2012 10:59:09 AM UTC, comment #3: 

Simon Goldschmidt wrote:

> I'd add a new folder "posix" under "src/include" so that ports can
> control whether or not the makefile finds lwIP's posix files (e.g.
> putting socket.h under "src/include/sys/socket.h" would make it
> impossible to use LWIP_COMPAT_SOCKETS==0 and include the original
> system's <sys/socket.h>).
>
> That would mean adding the files mentioned in the previous post
> would just include "src/include/lwip/socket.h" (or netdb.h/inet.h
> respectively).


Surprisingly enough, the following (trivial) patch was enough to
satisfy the libcurl configure script. (Basically, I just created
src/include/posix/netdb.h, src/include/posix/sys/select.h, and
src/include/posix/sys/socket.h wrappers)

--- a/src/include/posix/netdb.h        1970-01-01 01:00:00.000000000 +0100
+++ b/src/include/posix/netdb.h        2012-03-06 12:00:00.000000000 +0100
@@ -0,0 +1 @@
+#include "lwip/netdb.h"
--- a/src/include/posix/sys/select.h        1970-01-01 01:00:00.000000000 +0100
+++ b/src/include/posix/sys/select.h        2012-03-06 12:00:00.000000000 +0100
@@ -0,0 +1 @@
+#include "lwip/sockets.h"
--- a/src/include/posix/sys/socket.h        1970-01-01 01:00:00.000000000 +0100
+++ b/src/include/posix/sys/socket.h        2012-03-06 12:00:00.000000000 +0100
@@ -0,0 +1 @@
+#include "lwip/sockets.h"


The libcurl configure script can then be invoked with the
following definitions.

LWIP_INC="$LWIP_DIR/src/include"
LWIP_CPPFLAGS="-I $LWIP_INC -I $LWIP_INC/ipv4 -I $LWIP_INC/posix -I $LWIP_PORT_DIR"
export CPPFLAGS="$LWIP_CPPFLAGS -D USE_LWIPSOCK"

Can you accept this patch for 1.4.1?


(file #25453)

Mason <mason>
Thu 22 Mar 2012 06:11:00 PM UTC, comment #2: 

I'd add a new folder "posix" under "src/include" so that ports can control wether or not the makefile finds lwIP's posix files (e.g. putting socket.h under "src/include/sys/socket.h" would make it impossible to use LWIP_COMPAT_SOCKETS==0 and include the original system's <sys/socket.h>).

That would mean adding the files mentioned in the previous post would just include "src/include/lwip/socket.h" (or netdb.h/inet.h respectively).

Simon Goldschmidt <goldsimon>
Group administrator
Tue 06 Mar 2012 10:40:56 AM UTC, comment #1: 

Below is a list of relevant header files, as defined by POSIX.

sys/socket.h - main sockets header
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html

sys/select.h - select types
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_select.h.html

netdb.h - definitions for network database operations
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netdb.h.html

arpa/inet.h - definitions for internet operations
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/arpa_inet.h.html

netinet/in.h - Internet address family
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html

See also System Interfaces - Section 2.10 Sockets
http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_10

Mason <mason>
Wed 29 Feb 2012 04:51:49 PM UTC, original submission:  

e.g. sockets, netdb

Simon Goldschmidt <goldsimon>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #25453:  patch_posix_dir.txt added by mason (767B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-03-25 goldsimon StatusNone Done
        Open/ClosedOpen Closed
    2012-03-23 goldsimon Assigned toNone goldsimon
        Planned ReleaseNone 1.4.1
    2012-03-23 mason Attached File- Added patch_posix_dir.txt, #25453

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code