utils/os_socket: Define ssize_t on windows.
[mesa.git] / src / util / os_socket.h
1 /*
2 * Copyright 2019 Intel Corporation
3 * SPDX-License-Identifier: MIT
4 *
5 * Socket operations helpers
6 */
7
8 #ifndef _OS_SOCKET_H_
9 #define _OS_SOCKET_H_
10
11 #include <stdio.h>
12 #include <stdbool.h>
13 #ifdef _MSC_VER
14 #include <BaseTsd.h>
15 typedef SSIZE_T ssize_t;
16 #endif
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 int os_socket_accept(int s);
23
24 int os_socket_listen_abstract(const char *path, int count);
25
26 ssize_t os_socket_recv(int socket, void *buffer, size_t length, int flags);
27 ssize_t os_socket_send(int socket, const void *buffer, size_t length, int flags);
28
29 void os_socket_block(int s, bool block);
30 void os_socket_close(int s);
31
32 #ifdef __cplusplus
33 }
34 #endif
35
36 #endif /* _OS_SOCKET_H_ */