Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
socket_types.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_NET_SOCKET_TYPES_H_
8#define ZEPHYR_INCLUDE_NET_SOCKET_TYPES_H_
9
17#include <zephyr/types.h>
18
19#ifdef CONFIG_POSIX_API
20#ifdef __NEWLIB__
21#include <sys/_timeval.h>
22#else
23#include <sys/types.h>
24#endif /* __NEWLIB__ */
25#endif /* CONFIG_POSIX_API */
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#ifdef CONFIG_POSIX_API
32/* Rely on the underlying libc definition */
33#ifdef __NEWLIB__
34#define zsock_timeval timeval
35#else
36/* workaround for older Newlib 2.x, as it lacks sys/_timeval.h */
37struct zsock_timeval {
40};
41#endif /* __NEWLIB__ */
42#else
44 /* Using longs, as many (?) implementations seem to use it. */
45 long tv_sec;
46 long tv_usec;
47};
48#endif /* CONFIG_POSIX_API */
49
50#ifdef __cplusplus
51}
52#endif
53
58#endif /* ZEPHYR_INCLUDE_NET_SOCKET_TYPES_H_ */
_TIME_T_ time_t
Definition: _timespec.h:14
_SUSECONDS_T_ suseconds_t
Definition: _timespec.h:19
Definition: socket_types.h:43
long tv_usec
Definition: socket_types.h:46
long tv_sec
Definition: socket_types.h:45