mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-02 16:11:41 +01:00
Allow VFS file descriptors in select()
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
|
||||
#if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include <sys/select.h>
|
||||
#include <stddef.h> /* for size_t */
|
||||
#include <string.h> /* for FD_ZERO */
|
||||
|
||||
@@ -591,8 +592,10 @@ static inline int sendto(int s,const void *dataptr,size_t size,int flags,const s
|
||||
{ return lwip_sendto_r(s,dataptr,size,flags,to,tolen); }
|
||||
static inline int socket(int domain,int type,int protocol)
|
||||
{ return lwip_socket(domain,type,protocol); }
|
||||
#ifndef ESP_VFS_SELECT
|
||||
static inline int select(int maxfdp1,fd_set *readset,fd_set *writeset,fd_set *exceptset,struct timeval *timeout)
|
||||
{ return lwip_select(maxfdp1,readset,writeset,exceptset,timeout); }
|
||||
#endif /* ESP_VFS_SELECT */
|
||||
static inline int ioctlsocket(int s,long cmd,void *argp)
|
||||
{ return lwip_ioctl_r(s,cmd,argp); }
|
||||
|
||||
@@ -645,8 +648,10 @@ static inline int sendto(int s,const void *dataptr,size_t size,int flags,const s
|
||||
{ return lwip_sendto(s,dataptr,size,flags,to,tolen); }
|
||||
static inline int socket(int domain,int type,int protocol)
|
||||
{ return lwip_socket(domain,type,protocol); }
|
||||
#ifndef ESP_VFS_SELECT
|
||||
static inline int select(int maxfdp1,fd_set t*readset,fd_set *writeset,fd_set *exceptset,struct timeval *timeout)
|
||||
{ return lwip_select(maxfdp1,readset,writeset,exceptset,timeout); }
|
||||
#endif /* ESP_VFS_SELECT */
|
||||
static inline int ioctlsocket(int s,long cmd,void *argp)
|
||||
{ return lwip_ioctl(s,cmd,argp); }
|
||||
|
||||
|
||||
@@ -148,6 +148,10 @@ err_t sys_sem_new(sys_sem_t *sem, u8_t count);
|
||||
/** Signals a semaphore
|
||||
* @param sem the semaphore to signal */
|
||||
void sys_sem_signal(sys_sem_t *sem);
|
||||
/** Signals a semaphore (ISR version)
|
||||
* @param sem the semaphore to signal
|
||||
* @return non-zero if a higher priority task has been woken */
|
||||
int sys_sem_signal_isr(sys_sem_t *sem);
|
||||
/** Wait for a semaphore for the specified timeout
|
||||
* @param sem the semaphore to wait for
|
||||
* @param timeout timeout in milliseconds to wait (0 = wait forever)
|
||||
|
||||
@@ -38,9 +38,11 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include "esp_task.h"
|
||||
#include "esp_system.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_vfs.h"
|
||||
|
||||
/* Enable all Espressif-only options */
|
||||
|
||||
@@ -726,6 +728,7 @@
|
||||
#define ESP_DHCP_TIMER 1
|
||||
#define ESP_LWIP_LOGI(...) ESP_LOGI("lwip", __VA_ARGS__)
|
||||
#define ESP_PING 1
|
||||
#define ESP_VFS_SELECT 1
|
||||
|
||||
#if CONFIG_LWIP_IRAM_OPTIMIZATION
|
||||
#define ESP_IRAM_ATTR IRAM_ATTR
|
||||
|
||||
Reference in New Issue
Block a user