2 * libwebsockets - small server side websockets and web server implementation
4 * Copyright (C) 2010 - 2018 Andy Green <andy@warmcat.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation:
9 * version 2.1 of the License.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21 * Included from lib/core/private.h if LWS_WITH_OPTEE
25 #include <sys/types.h>
27 #define LWS_ERRNO errno
28 #define LWS_EAGAIN EAGAIN
29 #define LWS_EALREADY EALREADY
30 #define LWS_EINPROGRESS EINPROGRESS
31 #define LWS_EINTR EINTR
32 #define LWS_EISCONN EISCONN
33 #define LWS_ENOTCONN ENOTCONN
34 #define LWS_EWOULDBLOCK EWOULDBLOCK
35 #define LWS_EADDRINUSE EADDRINUSE
37 #define lws_set_blocking_send(wsi)
39 #define compatible_close(x) close(x)
40 #define lws_plat_socket_offset() (0)
41 #define wsi_from_fd(A,B) A->lws_lookup[B - lws_plat_socket_offset()]
42 #define insert_wsi(A,B) assert(A->lws_lookup[B->desc.sockfd - \
43 lws_plat_socket_offset()] == 0); \
44 A->lws_lookup[B->desc.sockfd - \
45 lws_plat_socket_offset()] = B
46 #define delete_from_fd(A,B) A->lws_lookup[B - lws_plat_socket_offset()] = 0