From d28d7a67f2fff9426078db1a9f050c49284b6076 Mon Sep 17 00:00:00 2001
From: Alexander Alashkin <alexander.alashkin@cesanta.com>
Date: Tue, 10 Jan 2017 20:20:35 +0200
Subject: [PATCH] c_hello/stm32-cube, part 2

PUBLISHED_FROM=fe7230811b7f12286c5ac6de1ef8fb068cd61145
---
 mongoose.h | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/mongoose.h b/mongoose.h
index 84e2fcfd5..bc5336bd2 100644
--- a/mongoose.h
+++ b/mongoose.h
@@ -1545,13 +1545,14 @@ char* inet_ntoa(struct in_addr in);
 
 typedef int sock_t;
 
-struct sockaddr {
-};
-
 struct in_addr{
   int s_addr;
 };
 
+struct sockaddr {
+  int sa_family;
+};
+
 struct sockaddr_in {
   int sin_family;
   int sin_port;
@@ -1573,6 +1574,28 @@ struct sockaddr_in {
 #define ntohs(x) (x)
 #define ntohl(x) (x)
 
+#define F_GETFL -1
+#define F_SETFL -1
+#define O_NONBLOCK -1
+#define fcntl(x1, x2, x3) (-1)
+#define socket(x1, x2, x3) (-1)
+#define connect(x1, x2, x3) (-1)
+#define setsockopt(x1, x2, x3, x4, x5) (-1)
+#define closesocket(x)
+typedef int socklen_t;
+#define accept(x1, x2, x3) (-1)
+#define SOMAXCONN -1
+#define listen(x1, x2) (-1)
+#define bind(x1, x2, x3) (-1)
+#define getsockname(x1, x2, x3) (-1)
+#define sendto(x1, x2, x3, x4, x5, x6) (-1)
+#define send(x1, x2, x3, x4) (-1)
+#define recvfrom(x1, x2, x3, x4, x5, x6) (-1)
+#define getsockopt(x1, x2, x3, x4, x5) (-1)
+#define getpeername(x1, x2, x3) (-1)
+#define recv(s, b, l, f) (-1)
+#define select(x1, x2, x3, x4, x5) (0)
+
 const char *inet_ntop(int af, const void *src, char *dst, int size);
 
 #endif /* CS_PLATFORM == CS_P_STM32 */
-- 
GitLab