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:
Our Air Quality 2017-10-19 03:33:32 +10:00 committed by Johan Kanflo
parent 87a3503f93
commit ebdd2f983b
12 changed files with 102 additions and 13 deletions

View file

@ -21,6 +21,7 @@
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <espressif/esp_common.h>
#include <espressif/user_interface.h>
@ -1722,9 +1723,9 @@ static void dns_task(void *pvParameters)
const struct ifreq ifreq0 = { "en0" };
const struct ifreq ifreq1 = { "en1" };
lwip_setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE,
sdk_wifi_get_opmode() == STATIONAP_MODE ? &ifreq1 : &ifreq0,
sizeof(ifreq0));
setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE,
sdk_wifi_get_opmode() == STATIONAP_MODE ? &ifreq1 : &ifreq0,
sizeof(ifreq0));
for (;;) {
char buffer[96];