lwip: define LWIP_POSIX_SOCKETS_IO_NAMES as zero (#457)
This patch gets the newlib standard stream descriptors playing well with the lwip socket descriptors and the spiffs file descriptors. The LWIP_SOCKET_OFFSET is now defined to be 3, rather than zero, to avoid clashing with the standard stream descriptors, and the SPIFFS_FILEHDL_OFFSET is bumped up to start after the lwip descriptors.
This commit is contained in:
parent
87a3503f93
commit
ebdd2f983b
12 changed files with 102 additions and 13 deletions
|
@ -39,6 +39,7 @@
|
|||
#include <sys/time.h>
|
||||
#include <sys/errno.h>
|
||||
#include <esp/hwrand.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
struct ip4_addr;
|
||||
struct esf_buf;
|
||||
|
|
|
@ -144,6 +144,15 @@
|
|||
------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* MEMP_NUM_NETCONN: the number of struct netconns.
|
||||
* (only needed if you use the sequential API, like api_lib.c)
|
||||
* This also sets the number of lwip socket descriptors.
|
||||
*/
|
||||
#ifndef MEMP_NUM_NETCONN
|
||||
#define MEMP_NUM_NETCONN 12
|
||||
#endif
|
||||
|
||||
/*
|
||||
--------------------------------
|
||||
---------- ARP options -------
|
||||
|
@ -549,6 +558,25 @@
|
|||
---------- Socket options ----------
|
||||
------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names.
|
||||
* Disable this option if you use a POSIX operating system that uses the same
|
||||
* names (read, write & close). (only used if you use sockets.c)
|
||||
*/
|
||||
#define LWIP_POSIX_SOCKETS_IO_NAMES 0
|
||||
|
||||
/**
|
||||
* LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n.
|
||||
* This can be useful when there are multiple APIs which create file descriptors.
|
||||
* When they all start with a different offset and you won't make them overlap you can
|
||||
* re implement read/write/close/ioctl/fnctl to send the requested action to the right
|
||||
* library (sharing select will need more work though).
|
||||
*/
|
||||
#ifndef LWIP_SOCKET_OFFSET
|
||||
#define LWIP_SOCKET_OFFSET 3
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and
|
||||
* SO_SNDTIMEO processing.
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 74676d46f0bc5ed82515f8e247008b7c45ec6cf6
|
||||
Subproject commit f372198834caf642c4b2d29d98fc1e120e3ce2b2
|
Loading…
Add table
Add a link
Reference in a new issue