7#ifndef __STDC_WANT_LIB_EXT1__
11 #define __STDC_WANT_LIB_EXT1__ 1
35 ssize_t
lwip_recv(
int s,
void *mem,
size_t len,
int flags);
46 ssize_t
lwip_send(
int s,
const void *dataptr,
size_t size,
int flags);
60#ifndef LWIP_SOCKET_OFFSET
64 #define LWIP_SOCKET_OFFSET 0
71 #define FD_SETSIZE MEMP_NUM_NETCONN
85 #define FD_SET(n, p) ((p)->fd_bits[((n) - LWIP_SOCKET_OFFSET) / 8] = (unsigned char) ((p)->fd_bits[((n) - LWIP_SOCKET_OFFSET) / 8] | (1u << (((n) - LWIP_SOCKET_OFFSET) & 7))))
90 #define FD_CLR(n, p) ((p)->fd_bits[((n) - LWIP_SOCKET_OFFSET) / 8] = (unsigned char) ((p)->fd_bits[((n) - LWIP_SOCKET_OFFSET) / 8] & ~(1u << (((n) - LWIP_SOCKET_OFFSET) & 7))))
95 #define FD_ISSET(n, p) (((p)->fd_bits[((n) - LWIP_SOCKET_OFFSET) / 8] & (1u << (((n) - LWIP_SOCKET_OFFSET) & 7))) != 0)
100 #define FD_ZERO(p) memset((void *) (p), 0, sizeof(*(p)))
107 #define select(maxfdp1, readset, writeset, exceptset, timeout) lwip_select(maxfdp1, readset, writeset, exceptset, timeout)
146#define access moonlight_nxdk_openssl_access
148#define fileno moonlight_nxdk_openssl_fileno
150#define read moonlight_nxdk_openssl_read
152#define write moonlight_nxdk_openssl_write
154#define close moonlight_nxdk_openssl_close
156#define _close moonlight_nxdk_openssl__close
158#define open moonlight_nxdk_openssl_open
160#define _open moonlight_nxdk_openssl__open
162#define fdopen moonlight_nxdk_openssl_fdopen
164#define _fdopen moonlight_nxdk_openssl__fdopen
166#define _unlink moonlight_nxdk_openssl__unlink
168#define chmod moonlight_nxdk_openssl_chmod
170#define getuid moonlight_nxdk_openssl_getuid
172#define geteuid moonlight_nxdk_openssl_geteuid
174#define getgid moonlight_nxdk_openssl_getgid
176#define getegid moonlight_nxdk_openssl_getegid
181 static inline int moonlight_nxdk_openssl_access(
const char *path,
int mode) {
190 static inline int moonlight_nxdk_openssl_fileno(FILE *stream) {
198 static inline ssize_t moonlight_nxdk_openssl_read(
int fd,
void *buffer,
size_t count) {
205 static inline ssize_t moonlight_nxdk_openssl_write(
int fd,
const void *buffer,
size_t count) {
212 static inline int moonlight_nxdk_openssl_close(
int fd) {
220 static inline int moonlight_nxdk_openssl__close(
int fd) {
221 return moonlight_nxdk_openssl_close(fd);
227 static inline int moonlight_nxdk_openssl_open(
const char *path,
int flags, ...) {
236 static inline int moonlight_nxdk_openssl__open(
const char *path,
int flags, ...) {
245 static inline FILE *moonlight_nxdk_openssl_fdopen(
int fd,
const char *mode) {
254 static inline FILE *moonlight_nxdk_openssl__fdopen(
int fd,
const char *mode) {
255 return moonlight_nxdk_openssl_fdopen(fd, mode);
261 static inline int moonlight_nxdk_openssl__unlink(
const char *path) {
269 static inline int moonlight_nxdk_openssl_chmod(
const char *path,
int mode) {
278 static inline unsigned int moonlight_nxdk_openssl_getuid(
void) {
285 static inline unsigned int moonlight_nxdk_openssl_geteuid(
void) {
292 static inline unsigned int moonlight_nxdk_openssl_getgid(
void) {
299 static inline unsigned int moonlight_nxdk_openssl_getegid(
void) {
306 static inline int moonlight_nxdk_openssl_gmtime_s(
struct tm *result,
const time_t *timer) {
311#define gmtime_s moonlight_nxdk_openssl_gmtime_s
ssize_t lwip_send(int s, const void *dataptr, size_t size, int flags)
Send bytes through the lwIP socket backend.
#define FD_SETSIZE
Maximum number of sockets tracked by the compatibility fd_set.
Definition openssl_compat.h:71
struct fd_set fd_set
Minimal socket descriptor set used by the lwIP-backed select shim.
ssize_t lwip_recv(int s, void *mem, size_t len, int flags)
Receive bytes through the lwIP socket backend.
#define gmtime_s
Redirect gmtime_s to the nxdk OpenSSL compatibility shim.
Definition openssl_compat.h:311
int lwip_select(int maxfdp1, struct fd_set *readset, struct fd_set *writeset, struct fd_set *exceptset, struct timeval *timeout)
Wait for lwIP socket readiness using the nxdk select implementation.
Minimal socket descriptor set used by the lwIP-backed select shim.
Definition openssl_compat.h:78
unsigned char fd_bits[(MEMP_NUM_NETCONN+7)/8]
Bitset storing tracked socket descriptors relative to LWIP_SOCKET_OFFSET.
Definition openssl_compat.h:79