util/os_socket: Include unistd.h to fix build error
authorBernd Kuhls <bernd.kuhls@t-online.de>
Fri, 31 Jan 2020 17:48:06 +0000 (18:48 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 3 Feb 2020 10:55:44 +0000 (10:55 +0000)
Fixes

In file included from ../src/util/os_socket.c:8:
../src/util/os_socket.h:26:1: error: unknown type name ‘ssize_t’; did you mean ‘size_t’?
 ssize_t os_socket_recv(int socket, void *buffer, size_t length, int flags);

seen with gcc version 8.3.0 (Buildroot 2019.11) and uClibc 1.0.32.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Fixes: ef5266ebd50e7fa65c56 ("util/os_socket: Add socket related functions.")
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3659>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3659>

src/util/os_socket.h

index 0d6f8749176d0b25a3bdaed809efac882d98eabf..db0dc905a2b4c1f7868958d78f5326fb6fb6e809 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <stdio.h>
 #include <stdbool.h>
+#include <unistd.h>
 #ifdef _MSC_VER
 #include <BaseTsd.h>
 typedef SSIZE_T ssize_t;