1 /*
2  * Copyright (c) 2022 Meta
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include "_common.h"
8 
9 #ifdef CONFIG_POSIX_API
10 #include <sys/select.h>
11 #else
12 #include <zephyr/posix/sys/select.h>
13 #endif
14 
15 /**
16  * @brief existence test for `<sys/select.h>`
17  *
18  * @see <a href="https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_select.h.html">sys/select.h</a>
19  */
ZTEST(posix_headers,test_sys_select_h)20 ZTEST(posix_headers, test_sys_select_h)
21 {
22 	fd_set fds = {0};
23 
24 	zassert_not_equal(-1, FD_SETSIZE);
25 
26 	if (IS_ENABLED(CONFIG_POSIX_DEVICE_IO)) {
27 
28 		FD_CLR(0, &fds);
29 		FD_ISSET(0, &fds);
30 		FD_SET(0, &fds);
31 		FD_ZERO(&fds);
32 
33 		zassert_not_null(pselect);
34 		zassert_not_null(select);
35 	}
36 }
37