diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index 740270d4e8c6..54d092884ef7 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -952,9 +952,16 @@ struct ifreq { #define SO_KEEPALIVE 9 /** sockopt: Place out-of-band data into receive stream (ignored, for compatibility) */ #define SO_OOBINLINE 10 +/** sockopt: Socket lingers on close (ignored, for compatibility) */ +#define SO_LINGER 13 /** sockopt: Allow multiple sockets to reuse a single port (ignored, for compatibility) */ #define SO_REUSEPORT 15 +/** sockopt: Receive low watermark (ignored, for compatibility) */ +#define SO_RCVLOWAT 18 +/** sockopt: Send low watermark (ignored, for compatibility) */ +#define SO_SNDLOWAT 19 + /** * sockopt: Receive timeout * Applies to receive functions like recv(), but not to connect() @@ -1005,6 +1012,9 @@ struct ifreq { /** sockopt: Enable SOCKS5 for Socket */ #define SO_SOCKS5 60 +/** listen: The maximum backlog queue length (ignored, for compatibility) */ +#define SOMAXCONN 128 + /** @cond INTERNAL_HIDDEN */ /** * @brief Registration information for a given BSD socket family. diff --git a/include/zephyr/posix/arpa/inet.h b/include/zephyr/posix/arpa/inet.h index 4ae926c0a4eb..244b98b24fc8 100644 --- a/include/zephyr/posix/arpa/inet.h +++ b/include/zephyr/posix/arpa/inet.h @@ -6,12 +6,19 @@ #ifndef ZEPHYR_INCLUDE_POSIX_ARPA_INET_H_ #define ZEPHYR_INCLUDE_POSIX_ARPA_INET_H_ +#include + +#include +#include + #include #ifdef __cplusplus extern "C" { #endif +#ifndef CONFIG_NET_SOCKETS_POSIX_NAMES + static inline char *inet_ntop(sa_family_t family, const void *src, char *dst, size_t size) { @@ -23,6 +30,8 @@ static inline int inet_pton(sa_family_t family, const char *src, void *dst) return zsock_inet_pton(family, src, dst); } +#endif /* CONFIG_NET_SOCKETS_POSIX_NAMES */ + #ifdef __cplusplus } #endif diff --git a/include/zephyr/posix/fcntl.h b/include/zephyr/posix/fcntl.h index 874f3ee08f8d..9689d1ae8c3f 100644 --- a/include/zephyr/posix/fcntl.h +++ b/include/zephyr/posix/fcntl.h @@ -27,7 +27,15 @@ #define F_GETFL 3 #define F_SETFL 4 +#ifdef __cplusplus +extern "C" { +#endif + int open(const char *name, int flags, ...); int fcntl(int fildes, int cmd, ...); +#ifdef __cplusplus +} +#endif + #endif /* ZEPHYR_POSIX_FCNTL_H_ */ diff --git a/include/zephyr/posix/mqueue.h b/include/zephyr/posix/mqueue.h index ed42bee88114..29f67607e2c6 100644 --- a/include/zephyr/posix/mqueue.h +++ b/include/zephyr/posix/mqueue.h @@ -9,9 +9,9 @@ #include #include -#include +#include +#include #include "posix_types.h" -#include "sys/stat.h" #ifdef __cplusplus extern "C" { @@ -19,12 +19,12 @@ extern "C" { typedef void *mqd_t; -typedef struct mq_attr { +struct mq_attr { long mq_flags; long mq_maxmsg; long mq_msgsize; long mq_curmsgs; /* Number of messages currently queued. */ -} mq_attr; +}; mqd_t mq_open(const char *name, int oflags, ...); int mq_close(mqd_t mqdes); diff --git a/include/zephyr/posix/net/if.h b/include/zephyr/posix/net/if.h index 67d42800225f..a8d6183cf804 100644 --- a/include/zephyr/posix/net/if.h +++ b/include/zephyr/posix/net/if.h @@ -8,4 +8,12 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + #endif /* ZEPHYR_INCLUDE_POSIX_NET_IF_H_ */ diff --git a/include/zephyr/posix/netdb.h b/include/zephyr/posix/netdb.h index 90637de24af3..6006a6368845 100644 --- a/include/zephyr/posix/netdb.h +++ b/include/zephyr/posix/netdb.h @@ -8,10 +8,29 @@ #include +#ifndef NI_MAXSERV +/** Provide a reasonable size for apps using getnameinfo */ +#define NI_MAXSERV 32 +#endif + +#define EAI_BADFLAGS DNS_EAI_BADFLAGS +#define EAI_NONAME DNS_EAI_NONAME +#define EAI_AGAIN DNS_EAI_AGAIN +#define EAI_FAIL DNS_EAI_FAIL +#define EAI_NODATA DNS_EAI_NODATA +#define EAI_MEMORY DNS_EAI_MEMORY +#define EAI_SYSTEM DNS_EAI_SYSTEM +#define EAI_SERVICE DNS_EAI_SERVICE +#define EAI_SOCKTYPE DNS_EAI_SOCKTYPE +#define EAI_FAMILY DNS_EAI_FAMILY +#define EAI_OVERFLOW DNS_EAI_OVERFLOW + #ifdef __cplusplus extern "C" { #endif +#ifndef CONFIG_NET_SOCKETS_POSIX_NAMES + #define addrinfo zsock_addrinfo static inline int getaddrinfo(const char *host, const char *service, @@ -39,6 +58,8 @@ static inline int getnameinfo(const struct sockaddr *addr, socklen_t addrlen, serv, servlen, flags); } +#endif /* CONFIG_NET_SOCKETS_POSIX_NAMES */ + #ifdef __cplusplus } #endif diff --git a/include/zephyr/posix/netinet/in.h b/include/zephyr/posix/netinet/in.h index 17933c06d02a..1134aaac123a 100644 --- a/include/zephyr/posix/netinet/in.h +++ b/include/zephyr/posix/netinet/in.h @@ -6,6 +6,19 @@ #ifndef ZEPHYR_INCLUDE_POSIX_NETINET_IN_H_ #define ZEPHYR_INCLUDE_POSIX_NETINET_IN_H_ +#include + #include +#ifdef __cplusplus +extern "C" { +#endif + +typedef uint16_t in_port_t; +typedef uint32_t in_addr_t; + +#ifdef __cplusplus +} +#endif + #endif /* ZEPHYR_INCLUDE_POSIX_NETINET_IN_H_ */ diff --git a/include/zephyr/posix/netinet/tcp.h b/include/zephyr/posix/netinet/tcp.h index a5f50ab74124..775fe992b02e 100644 --- a/include/zephyr/posix/netinet/tcp.h +++ b/include/zephyr/posix/netinet/tcp.h @@ -8,4 +8,12 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + #endif /* ZEPHYR_INCLUDE_POSIX_NETINET_TCP_H_ */ diff --git a/include/zephyr/posix/poll.h b/include/zephyr/posix/poll.h index 4dae57235319..a1f90333c42d 100644 --- a/include/zephyr/posix/poll.h +++ b/include/zephyr/posix/poll.h @@ -12,6 +12,8 @@ extern "C" { #endif +#ifndef CONFIG_NET_SOCKETS_POSIX_NAMES + #define pollfd zsock_pollfd #define POLLIN ZSOCK_POLLIN @@ -25,6 +27,8 @@ static inline int poll(struct pollfd *fds, int nfds, int timeout) return zsock_poll(fds, nfds, timeout); } +#endif /* CONFIG_NET_SOCKETS_POSIX_NAMES */ + #ifdef __cplusplus } #endif diff --git a/include/zephyr/posix/pthread.h b/include/zephyr/posix/pthread.h index 07958e57f80f..c3e5f3755a53 100644 --- a/include/zephyr/posix/pthread.h +++ b/include/zephyr/posix/pthread.h @@ -12,8 +12,8 @@ #include #include #include "posix_types.h" -#include "posix_sched.h" -#include +#include +#include "pthread_key.h" #include #include diff --git a/include/zephyr/posix/posix_sched.h b/include/zephyr/posix/sched.h similarity index 81% rename from include/zephyr/posix/posix_sched.h rename to include/zephyr/posix/sched.h index 4552658f3663..f168fd528dac 100644 --- a/include/zephyr/posix/posix_sched.h +++ b/include/zephyr/posix/sched.h @@ -3,8 +3,8 @@ * * SPDX-License-Identifier: Apache-2.0 */ -#ifndef ZEPHYR_INCLUDE_POSIX_POSIX_SCHED_H_ -#define ZEPHYR_INCLUDE_POSIX_POSIX_SCHED_H_ +#ifndef ZEPHYR_INCLUDE_POSIX_SCHED_H_ +#define ZEPHYR_INCLUDE_POSIX_SCHED_H_ #ifdef __cplusplus extern "C" { @@ -40,4 +40,4 @@ int sched_get_priority_max(int policy); } #endif -#endif /* ZEPHYR_INCLUDE_POSIX_POSIX_SCHED_H_ */ +#endif /* ZEPHYR_INCLUDE_POSIX_SCHED_H_ */ diff --git a/include/zephyr/posix/sys/ioctl.h b/include/zephyr/posix/sys/ioctl.h index 35e046ab8d26..34d7ce9a34d4 100644 --- a/include/zephyr/posix/sys/ioctl.h +++ b/include/zephyr/posix/sys/ioctl.h @@ -7,5 +7,16 @@ #define ZEPHYR_INCLUDE_POSIX_SYS_IOCTL_H_ #define FIONBIO 0x5421 +#define FIONREAD 0x541B + +#ifdef __cplusplus +extern "C" { +#endif + +int ioctl(int fd, unsigned long request, ...); + +#ifdef __cplusplus +} +#endif #endif /* ZEPHYR_INCLUDE_POSIX_SYS_IOCTL_H_ */ diff --git a/include/zephyr/posix/sys/select.h b/include/zephyr/posix/sys/select.h index b195c468e77f..0fd2b5de9e69 100644 --- a/include/zephyr/posix/sys/select.h +++ b/include/zephyr/posix/sys/select.h @@ -9,6 +9,12 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef CONFIG_NET_SOCKETS_POSIX_NAMES + #define fd_set zsock_fd_set #define FD_SETSIZE ZSOCK_FD_SETSIZE #define FD_ZERO ZSOCK_FD_ZERO @@ -26,4 +32,10 @@ static inline int select(int nfds, fd_set *readfds, (struct zsock_timeval *)timeout); } +#endif /* CONFIG_NET_SOCKETS_POSIX_NAMES */ + +#ifdef __cplusplus +} +#endif + #endif /* ZEPHYR_INCLUDE_POSIX_SYS_SELECT_H_ */ diff --git a/include/zephyr/posix/sys/socket.h b/include/zephyr/posix/sys/socket.h index 4a5979857fc3..af4f48e3907a 100644 --- a/include/zephyr/posix/sys/socket.h +++ b/include/zephyr/posix/sys/socket.h @@ -13,6 +13,13 @@ extern "C" { #endif +struct linger { + int l_onoff; + int l_linger; +}; + +#ifndef CONFIG_NET_SOCKETS_POSIX_NAMES + static inline int socket(int family, int type, int proto) { return zsock_socket(family, type, proto); @@ -111,6 +118,8 @@ static inline int getsockname(int sock, struct sockaddr *addr, return zsock_getsockname(sock, addr, addrlen); } +#endif /* CONFIG_NET_SOCKETS_POSIX_NAMES */ + #ifdef __cplusplus } #endif diff --git a/include/zephyr/posix/unistd.h b/include/zephyr/posix/unistd.h index 7a7ab4a0ce4e..ec8bf7e6adb1 100644 --- a/include/zephyr/posix/unistd.h +++ b/include/zephyr/posix/unistd.h @@ -34,6 +34,8 @@ extern int unlink(const char *path); extern int stat(const char *path, struct stat *buf); extern int mkdir(const char *path, mode_t mode); +FUNC_NORETURN void _exit(int status); + #ifdef CONFIG_NETWORKING static inline int gethostname(char *buf, size_t len) { diff --git a/lib/posix/CMakeLists.txt b/lib/posix/CMakeLists.txt index 1e7638ccdb22..defdb805378e 100644 --- a/lib/posix/CMakeLists.txt +++ b/lib/posix/CMakeLists.txt @@ -4,7 +4,7 @@ zephyr_interface_library_named(posix_subsys) if(CONFIG_POSIX_API) - target_include_directories(posix_subsys INTERFACE ${ZEPHYR_BASE}/include/zephyr/posix) + zephyr_include_directories(${ZEPHYR_BASE}/include/zephyr/posix) endif() if(CONFIG_POSIX_API OR CONFIG_PTHREAD_IPC OR CONFIG_POSIX_CLOCK OR diff --git a/lib/posix/Kconfig b/lib/posix/Kconfig index 6f300941a7e6..309da1d8fad2 100644 --- a/lib/posix/Kconfig +++ b/lib/posix/Kconfig @@ -143,6 +143,7 @@ config APP_LINK_WITH_POSIX_SUBSYS config EVENTFD bool "Support for eventfd" depends on !ARCH_POSIX + default y if POSIX_API help Enable support for event file descriptors, eventfd. An eventfd can be used as an event wait/notify mechanism together with POSIX calls diff --git a/lib/posix/fs.c b/lib/posix/fs.c index f0cd51d0d960..bc48ee7fbc6d 100644 --- a/lib/posix/fs.c +++ b/lib/posix/fs.c @@ -123,7 +123,9 @@ int open(const char *name, int flags, ...) return fd; } +#if !defined(CONFIG_NEWLIB_LIBC) && !defined(CONFIG_PICOLIBC) FUNC_ALIAS(open, _open, int); +#endif static int fs_close_vmeth(void *obj) { diff --git a/lib/posix/getopt/Kconfig b/lib/posix/getopt/Kconfig index fc0055cf6922..72c9961fb904 100644 --- a/lib/posix/getopt/Kconfig +++ b/lib/posix/getopt/Kconfig @@ -4,6 +4,7 @@ menuconfig GETOPT bool "Getopt library support" + default y if POSIX_API help This option adds support of getopt. Different shell backends are use their own instance of getopt to diff --git a/lib/posix/mqueue.c b/lib/posix/mqueue.c index 7be5dc50dce0..5c3d5e5e5d9a 100644 --- a/lib/posix/mqueue.c +++ b/lib/posix/mqueue.c @@ -61,7 +61,7 @@ mqd_t mq_open(const char *name, int oflags, ...) { va_list va; mode_t mode; - mq_attr *attrs = NULL; + struct mq_attr *attrs = NULL; long msg_size = 0U, max_msgs = 0U; mqueue_object *msg_queue; mqueue_desc *msg_queue_desc = NULL, *mqd = (mqueue_desc *)(-1); @@ -70,7 +70,7 @@ mqd_t mq_open(const char *name, int oflags, ...) va_start(va, oflags); if ((oflags & O_CREAT) != 0) { mode = va_arg(va, PROMOTED_MODE_T); - attrs = va_arg(va, mq_attr*); + attrs = va_arg(va, struct mq_attr*); } va_end(va); diff --git a/lib/posix/pthread_sched.c b/lib/posix/pthread_sched.c index 6c126bce6be9..eb59a2ea1a8c 100644 --- a/lib/posix/pthread_sched.c +++ b/lib/posix/pthread_sched.c @@ -5,7 +5,7 @@ */ #include -#include +#include static bool valid_posix_policy(int policy) { diff --git a/subsys/net/lib/sockets/sockets.c b/subsys/net/lib/sockets/sockets.c index 2a87a5f54e2f..b72c0751b3c4 100644 --- a/subsys/net/lib/sockets/sockets.c +++ b/subsys/net/lib/sockets/sockets.c @@ -5,9 +5,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* libc headers */ -#include - /* Zephyr headers */ #include LOG_MODULE_REGISTER(net_sock, CONFIG_NET_SOCKETS_LOG_LEVEL); @@ -17,6 +14,11 @@ LOG_MODULE_REGISTER(net_sock, CONFIG_NET_SOCKETS_LOG_LEVEL); #include #include #include +#ifdef CONFIG_ARCH_POSIX +#include +#else +#include +#endif #include #include #include @@ -2167,6 +2169,9 @@ int zsock_setsockopt_ctx(struct net_context *ctx, int level, int optname, return 0; } + case SO_LINGER: + /* ignored. for compatibility purposes only */ + return 0; } break; diff --git a/tests/posix/headers/CMakeLists.txt b/tests/posix/headers/CMakeLists.txt new file mode 100644 index 000000000000..16616d5885fb --- /dev/null +++ b/tests/posix/headers/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(posix_headers) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/posix/headers/prj.conf b/tests/posix/headers/prj.conf new file mode 100644 index 000000000000..43b6bc147c46 --- /dev/null +++ b/tests/posix/headers/prj.conf @@ -0,0 +1,20 @@ +CONFIG_POSIX_API=y +CONFIG_ZTEST=y +CONFIG_ZTEST_NEW_API=y + +# for POSIX_FS +CONFIG_FILE_SYSTEM=y + +# for select to work +CONFIG_NET_TEST=y +CONFIG_TEST_RANDOM_GENERATOR=y +CONFIG_NET_SOCKETS=y +CONFIG_NETWORKING=y + +# for when CONFIG_POSIX_API is not selected +CONFIG_PTHREAD_IPC=y +CONFIG_POSIX_FS=y +CONFIG_POSIX_CLOCK=y +CONFIG_POSIX_MQUEUE=y +CONFIG_EVENTFD=y +CONFIG_GETOPT=y diff --git a/tests/posix/headers/src/_common.h b/tests/posix/headers/src/_common.h new file mode 100644 index 000000000000..47325c054735 --- /dev/null +++ b/tests/posix/headers/src/_common.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include +#include + +#include diff --git a/tests/posix/headers/src/_main.c b/tests/posix/headers/src/_main.c new file mode 100644 index 000000000000..87e634f9b8ed --- /dev/null +++ b/tests/posix/headers/src/_main.c @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +ZTEST_SUITE(posix_headers, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/posix/headers/src/arpa_inet_h.c b/tests/posix/headers/src/arpa_inet_h.c new file mode 100644 index 000000000000..06541e1cd7b6 --- /dev/null +++ b/tests/posix/headers/src/arpa_inet_h.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see arpa/inet.h + */ +ZTEST(posix_headers, test_arpa_inet_h) +{ + zassert_not_equal(-1, htonl(0)); + zassert_not_equal(-1, htons(0)); + zassert_not_equal(-1, ntohl(0)); + zassert_not_equal(-1, ntohs(0)); + + if (IS_ENABLED(CONFIG_POSIX_API)) { + /* zassert_not_null(inet_addr); */ /* not implemented */ + /* zassert_not_null(inet_ntoa); */ /* not implemented */ + zassert_not_null(inet_ntop); + zassert_not_null(inet_pton); + } +} diff --git a/tests/posix/headers/src/dirent_h.c b/tests/posix/headers/src/dirent_h.c new file mode 100644 index 000000000000..ca5527603c03 --- /dev/null +++ b/tests/posix/headers/src/dirent_h.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see dirent.h + */ +ZTEST(posix_headers, test_dirent_h) +{ + zassert_not_equal((DIR *)-1, (DIR *)NULL); + + zassert_not_equal(-1, offsetof(struct dirent, d_ino)); + zassert_not_equal(-1, offsetof(struct dirent, d_name)); + + if (IS_ENABLED(CONFIG_POSIX_API)) { + /* zassert_not_null(alphasort); */ /* not implemented */ + zassert_not_null(closedir); + /* zassert_not_null(dirfd); */ /* not implemented */ + /* zassert_not_null(fdopendir); */ /* not implemented */ + zassert_not_null(opendir); + zassert_not_null(readdir); + /* zassert_not_null(readdir_r); */ /* not implemented */ + /* zassert_not_null(rewinddir); */ /* not implemented */ + /* zassert_not_null(scandir); */ /* not implemented */ + /* zassert_not_null(seekdir); */ /* not implemented */ + /* zassert_not_null(telldir); */ /* not implemented */ + } +} diff --git a/tests/posix/headers/src/mqueue_h.c b/tests/posix/headers/src/mqueue_h.c new file mode 100644 index 000000000000..4a1209fe539f --- /dev/null +++ b/tests/posix/headers/src/mqueue_h.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see mqueue.h + */ +ZTEST(posix_headers, test_mqueue_h) +{ + zassert_not_equal((mqd_t)-1, (mqd_t)NULL); + + zassert_not_equal(-1, offsetof(struct mq_attr, mq_flags)); + zassert_not_equal(-1, offsetof(struct mq_attr, mq_maxmsg)); + zassert_not_equal(-1, offsetof(struct mq_attr, mq_msgsize)); + zassert_not_equal(-1, offsetof(struct mq_attr, mq_curmsgs)); + + if (IS_ENABLED(CONFIG_POSIX_API)) { + zassert_not_null(mq_close); + zassert_not_null(mq_getattr); + /* zassert_not_null(mq_notify); */ /* not implemented */ + zassert_not_null(mq_open); + zassert_not_null(mq_receive); + zassert_not_null(mq_send); + zassert_not_null(mq_setattr); + zassert_not_null(mq_timedreceive); + zassert_not_null(mq_timedsend); + zassert_not_null(mq_unlink); + } +} diff --git a/tests/posix/headers/src/net_if_h.c b/tests/posix/headers/src/net_if_h.c new file mode 100644 index 000000000000..f3e3cb77ac69 --- /dev/null +++ b/tests/posix/headers/src/net_if_h.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see net/if.h + */ +ZTEST(posix_headers, test_net_if_h) +{ + /* zassert_not_equal(-1, offsetof(struct if_nameindex, if_index)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(struct if_nameindex, if_name)); */ /* not implemented */ + + /* zassert_not_equal(-1, IF_NAMESIZE); */ /* not implemented */ + + if (IS_ENABLED(CONFIG_POSIX_API)) { + /* zassert_not_null(if_freenameindex); */ /* not implemented */ + /* zassert_not_null(if_indextoname); */ /* not implemented */ + /* zassert_not_null(if_nameindex); */ /* not implemented */ + /* zassert_not_null(if_nametoindex); */ /* not implemented */ + } +} diff --git a/tests/posix/headers/src/netdb_h.c b/tests/posix/headers/src/netdb_h.c new file mode 100644 index 000000000000..3d6240fbfced --- /dev/null +++ b/tests/posix/headers/src/netdb_h.c @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see +#else +#include +#endif + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +/** + * @brief existence test for `` + * + * @see netinet/in.h + */ +ZTEST(posix_headers, test_netinet_in_h) +{ + zassert_equal(sizeof(in_port_t), sizeof(uint16_t)); + zassert_equal(sizeof(in_addr_t), sizeof(uint32_t)); + + zassert_not_equal(-1, offsetof(struct in_addr, s_addr)); + + zassert_not_equal(-1, offsetof(struct sockaddr_in, sin_family)); + zassert_not_equal(-1, offsetof(struct sockaddr_in, sin_port)); + zassert_not_equal(-1, offsetof(struct sockaddr_in, sin_addr)); + + zassert_not_equal(-1, offsetof(struct in6_addr, s6_addr)); + zassert_equal(sizeof(((struct in6_addr *)NULL)->s6_addr), 16 * sizeof(uint8_t)); + + zassert_not_equal(-1, offsetof(struct sockaddr_in6, sin6_family)); + zassert_not_equal(-1, offsetof(struct sockaddr_in6, sin6_port)); + /* not implemented */ + /* zassert_not_equal(-1, offsetof(struct sockaddr_in6, sin6_flowinfo)); */ + zassert_not_equal(-1, offsetof(struct sockaddr_in6, sin6_addr)); + /* not implemented */ + /* zassert_not_equal(-1, offsetof(struct sockaddr_in6, scope_id)); */ + + zassert_not_null(&in6addr_loopback); + struct in6_addr any6 = IN6ADDR_ANY_INIT; + struct in6_addr lo6 = IN6ADDR_LOOPBACK_INIT; + + /* not implemented */ + /* zassert_not_equal(-1, offsetof(struct ipv6_mreq, ipv6mr_multiaddr)); */ + /* not implemented */ + /* zassert_not_equal(-1, offsetof(struct ipv6_mreq, ipv6mr_interface)); */ + + zassert_not_equal(-1, IPPROTO_IP); + zassert_not_equal(-1, IPPROTO_IPV6); + zassert_not_equal(-1, IPPROTO_ICMP); + zassert_not_equal(-1, IPPROTO_RAW); + zassert_not_equal(-1, IPPROTO_TCP); + zassert_not_equal(-1, IPPROTO_UDP); + + zassert_not_equal(-1, INADDR_ANY); + /* zassert_not_equal(-1, INADDR_BROADCAST); */ /* not implemented */ + + zassert_equal(INET_ADDRSTRLEN, 16); + zassert_equal(INET6_ADDRSTRLEN, 46); + + /* zassert_not_equal(-1, IPV6_JOIN_GROUP); */ /* not implemented */ + /* zassert_not_equal(-1, IPV6_LEAVE_GROUP); */ /* not implemented */ + /* zassert_not_equal(-1, IPV6_MULTICAST_HOPS); */ /* not implemented */ + /* zassert_not_equal(-1, IPV6_MULTICAST_IF); */ /* not implemented */ + /* zassert_not_equal(-1, IPV6_MULTICAST_LOOP); */ /* not implemented */ + /* zassert_not_equal(-1, IPV6_UNICAST_HOPS); */ /* not implemented */ + zassert_not_equal(-1, IPV6_V6ONLY); + + /* IN6_IS_ADDR_UNSPECIFIED(&any6); */ /* not implemented */ + /* IN6_IS_ADDR_LOOPBACK(&lo6); */ /* not implemented */ + + /* IN6_IS_ADDR_MULTICAST(&lo6); */ /* not implemented */ + /* IN6_IS_ADDR_LINKLOCAL(&lo6); */ /* not implemented */ + /* IN6_IS_ADDR_SITELOCAL(&lo6); */ /* not implemented */ + /* IN6_IS_ADDR_V4MAPPED(&lo6); */ /* not implemented */ + /* IN6_IS_ADDR_V4COMPAT(&lo6); */ /* not implemented */ + /* IN6_IS_ADDR_MC_NODELOCAL(&lo6); */ /* not implemented */ + /* IN6_IS_ADDR_MC_LINKLOCAL(&lo6); */ /* not implemented */ + /* IN6_IS_ADDR_MC_SITELOCAL(&lo6); */ /* not implemented */ + /* IN6_IS_ADDR_MC_ORGLOCAL(&lo6); */ /* not implemented */ + /* IN6_IS_ADDR_MC_GLOBAL(&lo6); */ /* not implemented */ +} +#pragma GCC diagnostic pop diff --git a/tests/posix/headers/src/netinet_tcp_h.c b/tests/posix/headers/src/netinet_tcp_h.c new file mode 100644 index 000000000000..e476b4cbcd8d --- /dev/null +++ b/tests/posix/headers/src/netinet_tcp_h.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see netinet/tcp.h + */ +ZTEST(posix_headers, test_netinet_tcp_h) +{ + zassert_not_equal(-1, TCP_NODELAY); +} diff --git a/tests/posix/headers/src/poll_h.c b/tests/posix/headers/src/poll_h.c new file mode 100644 index 000000000000..ff4257939ddf --- /dev/null +++ b/tests/posix/headers/src/poll_h.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see poll.h + */ +ZTEST(posix_headers, test_poll_h) +{ + zassert_not_equal(-1, offsetof(struct pollfd, fd)); + zassert_not_equal(-1, offsetof(struct pollfd, events)); + zassert_not_equal(-1, offsetof(struct pollfd, revents)); + + /* zassert_true(sizeof(nfds_t) <= sizeof(long)); */ /* not implemented */ + + zassert_not_equal(-1, POLLIN); + /* zassert_not_equal(-1, POLLRDNORM); */ /* not implemented */ + /* zassert_not_equal(-1, POLLRDBAND); */ /* not implemented */ + /* zassert_not_equal(-1, POLLPRI); */ /* not implemented */ + zassert_not_equal(-1, POLLOUT); + /* zassert_not_equal(-1, POLLWRNORM); */ /* not implemented */ + /* zassert_not_equal(-1, POLLWRBAND); */ /* not implemented */ + zassert_not_equal(-1, POLLERR); + zassert_not_equal(-1, POLLHUP); + zassert_not_equal(-1, POLLNVAL); + + if (IS_ENABLED(CONFIG_POSIX_API)) { + zassert_not_null(poll); + } +} diff --git a/tests/posix/headers/src/pthread_h.c b/tests/posix/headers/src/pthread_h.c new file mode 100644 index 000000000000..d535a134693b --- /dev/null +++ b/tests/posix/headers/src/pthread_h.c @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +/** + * @brief existence test for `` + * + * @see pthread.h + */ +ZTEST(posix_headers, test_pthread_h) +{ + zassert_not_equal(-1, PTHREAD_BARRIER_SERIAL_THREAD); + + /* zassert_not_equal(-1, PTHREAD_CANCEL_ASYNCHRONOUS); */ /* not implemented */ + zassert_not_equal(-1, PTHREAD_CANCEL_ENABLE); + /* zassert_not_equal(-1, PTHREAD_CANCEL_DEFERRED); */ /* not implemented */ + zassert_not_equal(-1, PTHREAD_CANCEL_DISABLE); + + /* zassert_not_equal(-1, PTHREAD_CANCELED); */ /* not implemented */ + + zassert_not_equal(-1, PTHREAD_CREATE_DETACHED); + zassert_not_equal(-1, PTHREAD_CREATE_JOINABLE); + + /* zassert_not_equal(-1, PTHREAD_EXPLICIT_SCHED); */ /* not implemented */ + /* zassert_not_equal(-1, PTHREAD_INHERIT_SCHED); */ /* not implemented */ + + zassert_not_equal(-1, PTHREAD_MUTEX_DEFAULT); + zassert_not_equal(-1, PTHREAD_MUTEX_ERRORCHECK); + zassert_not_equal(-1, PTHREAD_MUTEX_ERRORCHECK); + zassert_not_equal(-1, PTHREAD_MUTEX_RECURSIVE); + /* zassert_not_equal(-1, PTHREAD_MUTEX_ROBUST); */ /* not implemented */ + /* zassert_not_equal(-1, PTHREAD_MUTEX_STALLED); */ /* not implemented */ + + pthread_once_t once = PTHREAD_ONCE_INIT; + + /* zassert_not_equal(-1, PTHREAD_PRIO_INHERIT); */ /* not implemented */ + zassert_not_equal(-1, PTHREAD_PRIO_NONE); + /* zassert_not_equal(-1, PTHREAD_PRIO_PROTECT); */ /* not implemented */ + + /* zassert_not_equal(-1, PTHREAD_PROCESS_SHARED); */ /* not implemented */ + /* zassert_not_equal(-1, PTHREAD_PROCESS_PRIVATE); */ /* not implemented */ + + /* zassert_not_equal(-1, PTHREAD_SCOPE_PROCESS); */ /* not implemented */ + /* zassert_not_equal(-1, PTHREAD_SCOPE_SYSTEM); */ /* not implemented */ + + /* pthread_cond_t cond = PTHREAD_COND_INITIALIZER; */ /* not implemented */ + /* pthread_mutex_t mu = PTHREAD_MUTEX_INITIALIZER; */ /* not implemented */ + /* pthread_rwlock_t lock = PTHREAD_RWLOCK_INITIALIZER; */ /* not implemented */ + + if (IS_ENABLED(CONFIG_POSIX_API)) { + /* zassert_not_null(pthread_atfork); */ /* not implemented */ + zassert_not_null(pthread_attr_destroy); + zassert_not_null(pthread_attr_getdetachstate); + /* zassert_not_null(pthread_attr_getguardsize); */ /* not implemented */ + /* zassert_not_null(pthread_attr_getinheritsched); */ /* not implemented */ + zassert_not_null(pthread_attr_getschedparam); + zassert_not_null(pthread_attr_getschedpolicy); + /* zassert_not_null(pthread_attr_getscope); */ /* not implemented */ + zassert_not_null(pthread_attr_getstack); + zassert_not_null(pthread_attr_getstacksize); + zassert_not_null(pthread_attr_init); + zassert_not_null(pthread_attr_setdetachstate); + /* zassert_not_null(pthread_attr_setguardsize); */ /* not implemented */ + /* zassert_not_null(pthread_attr_setinheritsched); */ /* not implemented */ + zassert_not_null(pthread_attr_setschedparam); + zassert_not_null(pthread_attr_setschedpolicy); + /* zassert_not_null(pthread_attr_setscope); */ /* not implemented */ + zassert_not_null(pthread_attr_setstack); + zassert_not_null(pthread_attr_setstacksize); + zassert_not_null(pthread_barrier_destroy); + zassert_not_null(pthread_barrier_init); + zassert_not_null(pthread_barrier_wait); + zassert_not_null(pthread_barrierattr_destroy); + /* zassert_not_null(pthread_barrierattr_getpshared); */ /* not implemented */ + zassert_not_null(pthread_barrierattr_init); + /* zassert_not_null(pthread_barrierattr_setpshared); */ /* not implemented */ + zassert_not_null(pthread_cancel); + zassert_not_null(pthread_cond_broadcast); + zassert_not_null(pthread_cond_destroy); + zassert_not_null(pthread_cond_init); + zassert_not_null(pthread_cond_signal); + zassert_not_null(pthread_cond_timedwait); + zassert_not_null(pthread_cond_wait); + zassert_not_null(pthread_condattr_destroy); + /* zassert_not_null(pthread_condattr_getclock); */ /* not implemented */ + /* zassert_not_null(pthread_condattr_getpshared); */ /* not implemented */ + zassert_not_null(pthread_condattr_init); + /* zassert_not_null(pthread_condattr_setclock); */ /* not implemented */ + /* zassert_not_null(pthread_condattr_setpshared); */ /* not implemented */ + zassert_not_null(pthread_create); + zassert_not_null(pthread_detach); + zassert_not_null(pthread_equal); + zassert_not_null(pthread_exit); + /* zassert_not_null(pthread_getconcurrency); */ /* not implemented */ + /* zassert_not_null(pthread_getcpuclockid); */ /* not implemented */ + zassert_not_null(pthread_getschedparam); + zassert_not_null(pthread_getspecific); + zassert_not_null(pthread_join); + zassert_not_null(pthread_key_create); + zassert_not_null(pthread_key_delete); + /* zassert_not_null(pthread_mutex_consistent); */ /* not implemented */ + zassert_not_null(pthread_mutex_destroy); + /* zassert_not_null(pthread_mutex_getprioceiling); */ /* not implemented */ + zassert_not_null(pthread_mutex_init); + zassert_not_null(pthread_mutex_lock); + /* zassert_not_null(pthread_mutex_setprioceiling); */ /* not implemented */ + zassert_not_null(pthread_mutex_timedlock); + zassert_not_null(pthread_mutex_trylock); + zassert_not_null(pthread_mutex_unlock); + zassert_not_null(pthread_mutexattr_destroy); + /* zassert_not_null(pthread_mutexattr_getprioceiling); */ /* not implemented */ + zassert_not_null(pthread_mutexattr_getprotocol); + /* zassert_not_null(pthread_mutexattr_getpshared); */ /* not implemented */ + /* zassert_not_null(pthread_mutexattr_getrobust); */ /* not implemented */ + zassert_not_null(pthread_mutexattr_gettype); + zassert_not_null(pthread_mutexattr_init); + /* zassert_not_null(pthread_mutexattr_setprioceiling); */ /* not implemented */ + /* zassert_not_null(pthread_mutexattr_setprotocol); */ /* not implemented */ + /* zassert_not_null(pthread_mutexattr_setpshared); */ /* not implemented */ + /* zassert_not_null(pthread_mutexattr_setrobust); */ /* not implemented */ + zassert_not_null(pthread_mutexattr_settype); + zassert_not_null(pthread_once); + zassert_not_null(pthread_rwlock_destroy); + zassert_not_null(pthread_rwlock_init); + zassert_not_null(pthread_rwlock_rdlock); + zassert_not_null(pthread_rwlock_timedrdlock); + zassert_not_null(pthread_rwlock_timedwrlock); + zassert_not_null(pthread_rwlock_tryrdlock); + zassert_not_null(pthread_rwlock_trywrlock); + zassert_not_null(pthread_rwlock_unlock); + zassert_not_null(pthread_rwlock_wrlock); + zassert_not_null(pthread_rwlockattr_destroy); + /* zassert_not_null(pthread_rwlockattr_getpshared); */ /* not implemented */ + zassert_not_null(pthread_rwlockattr_init); + /* zassert_not_null(pthread_rwlockattr_setpshared); */ /* not implemented */ + zassert_not_null(pthread_self); + /* zassert_not_null(pthread_setcancelstate); */ /* not implemented */ + /* zassert_not_null(pthread_setcanceltype); */ /* not implemented */ + /* zassert_not_null(pthread_setconcurrency); */ /* not implemented */ + zassert_not_null(pthread_setschedparam); + /* zassert_not_null(pthread_setschedprio); */ /* not implemented */ + zassert_not_null(pthread_setspecific); + /* zassert_not_null(pthread_spin_destroy); */ /* not implemented */ + /* zassert_not_null(pthread_spin_init); */ /* not implemented */ + /* zassert_not_null(pthread_spin_lock); */ /* not implemented */ + /* zassert_not_null(pthread_spin_unlock); */ /* not implemented */ + /* zassert_not_null(pthread_testcancel); */ /* not implemented */ + } +} +#pragma GCC diagnostic pop diff --git a/tests/posix/headers/src/sched_h.c b/tests/posix/headers/src/sched_h.c new file mode 100644 index 000000000000..fb4f2de26883 --- /dev/null +++ b/tests/posix/headers/src/sched_h.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see sched.h + */ +ZTEST(posix_headers, test_sched_h) +{ + zassert_not_equal(-1, offsetof(struct sched_param, sched_priority)); + + zassert_not_equal(-1, SCHED_FIFO); + zassert_not_equal(-1, SCHED_RR); + /* zassert_not_equal(-1, SCHED_SPORADIC); */ /* not implemented */ + /* zassert_not_equal(-1, SCHED_OTHER); */ /* not implemented */ + + if (IS_ENABLED(CONFIG_POSIX_API)) { + zassert_not_null(sched_get_priority_max); + zassert_not_null(sched_get_priority_min); + + /* zassert_not_null(sched_getparam); */ /* not implemented */ + /* zassert_not_null(sched_getscheduler); */ /* not implemented */ + + /* zassert_not_null(sched_rr_get_interval); */ /* not implemented */ + + /* zassert_not_null(sched_setparam); */ /* not implemented */ + /* zassert_not_null(sched_setscheduler); */ /* not implemented */ + + zassert_not_null(sched_yield); + } +} diff --git a/tests/posix/headers/src/semaphore_h.c b/tests/posix/headers/src/semaphore_h.c new file mode 100644 index 000000000000..0ac1de36f2eb --- /dev/null +++ b/tests/posix/headers/src/semaphore_h.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see semaphore.h + */ +ZTEST(posix_headers, test_semaphore_h) +{ + /* zassert_not_equal(SEM_FAILED, (sem_t *)42); */ /* not implemented */ + + if (IS_ENABLED(CONFIG_POSIX_API)) { + /* zassert_not_null(sem_close); */ /* not implemented */ + zassert_not_null(sem_destroy); + zassert_not_null(sem_getvalue); + zassert_not_null(sem_init); + /* zassert_not_null(sem_open); */ /* not implemented */ + zassert_not_null(sem_post); + zassert_not_null(sem_timedwait); + zassert_not_null(sem_trywait); + /* zassert_not_null(sem_unlink); */ /* not implemented */ + zassert_not_null(sem_wait); + } +} diff --git a/tests/posix/headers/src/signal_h.c b/tests/posix/headers/src/signal_h.c new file mode 100644 index 000000000000..9b8711e530e0 --- /dev/null +++ b/tests/posix/headers/src/signal_h.c @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see signal.h + */ +ZTEST(posix_headers, test_signal_h) +{ + /* zassert_not_equal(-1, SIG_DFL); */ /* not implemented */ + /* zassert_not_equal(-1, SIG_ERR); */ /* not implemented */ + /* zassert_not_equal(-1, SIG_HOLD); */ /* not implemented */ + /* zassert_not_equal(-1, SIG_IGN); */ /* not implemented */ + + /* zassert_not_equal((sig_atomic_t)-1, (sig_atomic_t)0); */ /* not implemented */ + /* zassert_not_equal((sigset_t)-1, (sigset_t)0); */ /* not implemented */ + /* zassert_not_equal((pid_t)-1, (pid_t)0); */ /* not implemented */ + + zassert_not_equal(-1, offsetof(struct sigevent, sigev_notify)); + zassert_not_equal(-1, offsetof(struct sigevent, sigev_signo)); + zassert_not_equal(-1, offsetof(struct sigevent, sigev_value)); + zassert_not_equal(-1, offsetof(struct sigevent, sigev_notify_function)); + zassert_not_equal(-1, offsetof(struct sigevent, sigev_notify_attributes)); + + zassert_not_equal(-1, SIGEV_NONE); + zassert_not_equal(-1, SIGEV_SIGNAL); + zassert_not_equal(-1, SIGEV_THREAD); + + zassert_not_equal(-1, offsetof(union sigval, sival_int)); + zassert_not_equal(-1, offsetof(union sigval, sival_ptr)); + + /* zassert_not_equal(-1, RTSIG_MAX); */ /* not implemented */ + /* zassert_true(SIGRTMIN >= 0); */ /* not implemented */ + /* zassert_true(SIGRTMAX >= SIGRTMIN); */ /* not implemented */ + /* zassert_true(SIGRTMAX - SIGRTMIN >= RTSIG_MAX); */ /* not implemented */ + + /* zassert_not_equal(-1, SIGABRT); */ /* not implemented */ + /* zassert_not_equal(-1, SIGALRM); */ /* not implemented */ + /* zassert_not_equal(-1, SIGBUS); */ /* not implemented */ + /* zassert_not_equal(-1, SIGCHLD); */ /* not implemented */ + /* zassert_not_equal(-1, SIGCONT); */ /* not implemented */ + /* zassert_not_equal(-1, SIGFPE); */ /* not implemented */ + /* zassert_not_equal(-1, SIGHUP); */ /* not implemented */ + /* zassert_not_equal(-1, SIGILL); */ /* not implemented */ + /* zassert_not_equal(-1, SIGINT); */ /* not implemented */ + /* zassert_not_equal(-1, SIGKILL); */ /* not implemented */ + /* zassert_not_equal(-1, SIGPIPE); */ /* not implemented */ + /* zassert_not_equal(-1, SIGQUIT); */ /* not implemented */ + /* zassert_not_equal(-1, SIGSEGV); */ /* not implemented */ + /* zassert_not_equal(-1, SIGSTOP); */ /* not implemented */ + /* zassert_not_equal(-1, SIGTERM); */ /* not implemented */ + /* zassert_not_equal(-1, SIGTSTP); */ /* not implemented */ + /* zassert_not_equal(-1, SIGTTIN); */ /* not implemented */ + /* zassert_not_equal(-1, SIGTTOU); */ /* not implemented */ + /* zassert_not_equal(-1, SIGUSR1); */ /* not implemented */ + /* zassert_not_equal(-1, SIGUSR2); */ /* not implemented */ + /* zassert_not_equal(-1, SIGTRAP); */ /* not implemented */ + /* zassert_not_equal(-1, SIGURG); */ /* not implemented */ + /* zassert_not_equal(-1, SIGXCPU); */ /* not implemented */ + /* zassert_not_equal(-1, SIGXFSZ); */ /* not implemented */ + + /* zassert_not_equal(-1, SIG_BLOCK); */ /* not implemented */ + /* zassert_not_equal(-1, SIG_UNBLOCK); */ /* not implemented */ + /* zassert_not_equal(-1, SIG_SETMASK); */ /* not implemented */ + + /* zassert_not_equal(-1, SA_NOCLDSTOP); */ /* not implemented */ + /* zassert_not_equal(-1, SA_ONSTACK); */ /* not implemented */ + /* zassert_not_equal(-1, SA_RESETHAND); */ /* not implemented */ + /* zassert_not_equal(-1, SA_RESTART); */ /* not implemented */ + /* zassert_not_equal(-1, SA_SIGINFO); */ /* not implemented */ + /* zassert_not_equal(-1, SA_NOCLDWAIT); */ /* not implemented */ + /* zassert_not_equal(-1, SA_NODEFER); */ /* not implemented */ + + /* zassert_not_equal(-1, SS_ONSTACK); */ /* not implemented */ + /* zassert_not_equal(-1, SS_DISABLE); */ /* not implemented */ + + /* zassert_not_equal(-1, MINSIGSTKSZ); */ /* not implemented */ + /* zassert_not_equal(-1, SIGSTKSZ); */ /* not implemented */ + + /* mcontext_t mctx = {0}; */ /* not implemented */ + + /* zassert_not_equal(-1, offsetof(ucontext_t, uc_link)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(ucontext_t, uc_sigmask)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(ucontext_t, uc_stack)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(ucontext_t, uc_mcontext)); */ /* not implemented */ + + /* zassert_not_equal(-1, offsetof(stack_t, ss_sp)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(stack_t, ss_size)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(stack_t, ss_flags)); */ /* not implemented */ + + /* zassert_not_equal(-1, offsetof(siginfo_t, si_signo)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(siginfo_t, si_code)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(siginfo_t, si_errno)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(siginfo_t, si_pid)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(siginfo_t, si_uid)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(siginfo_t, si_addr)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(siginfo_t, si_status)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(siginfo_t, si_band)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(siginfo_t, si_value)); */ /* not implemented */ + + /* zassert_not_equal(-1, ILL_ILLOPC); */ /* not implemented */ + /* zassert_not_equal(-1, ILL_ILLOPN); */ /* not implemented */ + /* zassert_not_equal(-1, ILL_ILLADR); */ /* not implemented */ + /* zassert_not_equal(-1, ILL_ILLTRP); */ /* not implemented */ + /* zassert_not_equal(-1, ILL_PRVOPC); */ /* not implemented */ + /* zassert_not_equal(-1, ILL_PRVREG); */ /* not implemented */ + /* zassert_not_equal(-1, ILL_COPROC); */ /* not implemented */ + /* zassert_not_equal(-1, ILL_BADSTK); */ /* not implemented */ + + /* zassert_not_equal(-1, FPE_INTDIV); */ /* not implemented */ + /* zassert_not_equal(-1, FPE_INTOVF); */ /* not implemented */ + /* zassert_not_equal(-1, FPE_FLTDIV); */ /* not implemented */ + /* zassert_not_equal(-1, FPE_FLTOVF); */ /* not implemented */ + /* zassert_not_equal(-1, FPE_FLTUND); */ /* not implemented */ + /* zassert_not_equal(-1, FPE_FLTRES); */ /* not implemented */ + /* zassert_not_equal(-1, FPE_FLTINV); */ /* not implemented */ + /* zassert_not_equal(-1, FPE_FLTSUB); */ /* not implemented */ + + /* zassert_not_equal(-1, SEGV_MAPERR); */ /* not implemented */ + /* zassert_not_equal(-1, SEGV_ACCERR); */ /* not implemented */ + + /* zassert_not_equal(-1, BUS_ADRALN); */ /* not implemented */ + /* zassert_not_equal(-1, BUS_ADRERR); */ /* not implemented */ + /* zassert_not_equal(-1, BUS_OBJERR); */ /* not implemented */ + + /* zassert_not_equal(-1, TRAP_BRKPT); */ /* not implemented */ + /* zassert_not_equal(-1, TRAP_TRACE); */ /* not implemented */ + + /* zassert_not_equal(-1, CLD_EXITED); */ /* not implemented */ + /* zassert_not_equal(-1, CLD_KILLED); */ /* not implemented */ + /* zassert_not_equal(-1, CLD_DUMPED); */ /* not implemented */ + /* zassert_not_equal(-1, CLD_TRAPPED); */ /* not implemented */ + /* zassert_not_equal(-1, CLD_STOPPED); */ /* not implemented */ + /* zassert_not_equal(-1, CLD_CONTINUED); */ /* not implemented */ + + /* zassert_not_equal(-1, POLL_IN); */ /* not implemented */ + /* zassert_not_equal(-1, POLL_OUT); */ /* not implemented */ + /* zassert_not_equal(-1, POLL_MSG); */ /* not implemented */ + /* zassert_not_equal(-1, POLL_ERR); */ /* not implemented */ + /* zassert_not_equal(-1, POLL_PRI); */ /* not implemented */ + /* zassert_not_equal(-1, POLL_HUP); */ /* not implemented */ + + /* zassert_not_equal(-1, SI_USER); */ /* not implemented */ + /* zassert_not_equal(-1, SI_QUEUE); */ /* not implemented */ + /* zassert_not_equal(-1, SI_TIMER); */ /* not implemented */ + /* zassert_not_equal(-1, SI_ASYNCIO); */ /* not implemented */ + /* zassert_not_equal(-1, SI_MESGQ); */ /* not implemented */ + + if (IS_ENABLED(CONFIG_POSIX_API)) { + /* zassert_not_null(kill); */ /* not implemented */ + /* zassert_not_null(killpg); */ /* not implemented */ + /* zassert_not_null(psiginfo); */ /* not implemented */ + /* zassert_not_null(psignal); */ /* not implemented */ + /* zassert_not_null(pthread_kill); */ /* not implemented */ + /* zassert_not_null(pthread_sigmask); */ /* not implemented */ + /* zassert_not_null(raise); */ /* not implemented */ + /* zassert_not_null(sigaction); */ /* not implemented */ + /* zassert_not_null(sigaddset); */ /* not implemented */ + /* zassert_not_null(sigaltstack); */ /* not implemented */ + /* zassert_not_null(sigdelset); */ /* not implemented */ + /* zassert_not_null(sigemptyset); */ /* not implemented */ + /* zassert_not_null(sigfillset); */ /* not implemented */ + /* zassert_not_null(sighold); */ /* not implemented */ + /* zassert_not_null(sigignore); */ /* not implemented */ + /* zassert_not_null(siginterrupt); */ /* not implemented */ + /* zassert_not_null(sigismember); */ /* not implemented */ + /* zassert_not_null(signal); */ /* not implemented */ + /* zassert_not_null(sigpause); */ /* not implemented */ + /* zassert_not_null(sigpending); */ /* not implemented */ + /* zassert_not_null(sigprocmask); */ /* not implemented */ + /* zassert_not_null(sigqueue); */ /* not implemented */ + /* zassert_not_null(sigrelse); */ /* not implemented */ + /* zassert_not_null(sigset); */ /* not implemented */ + /* zassert_not_null(sigsuspend); */ /* not implemented */ + /* zassert_not_null(sigtimedwait); */ /* not implemented */ + /* zassert_not_null(sigwait); */ /* not implemented */ + /* zassert_not_null(sigwaitinfo); */ /* not implemented */ + } +} diff --git a/tests/posix/headers/src/sys_eventfd_h.c b/tests/posix/headers/src/sys_eventfd_h.c new file mode 100644 index 000000000000..6f666393f2cc --- /dev/null +++ b/tests/posix/headers/src/sys_eventfd_h.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @note the eventfd API is not (yet) a part of POSIX. + * + * @see sys/eventfd.h + */ +ZTEST(posix_headers, test_sys_eventfd_h) +{ + /* zassert_not_equal(-1, EFD_CLOEXEC); */ /* not implemented */ + zassert_not_equal(-1, EFD_NONBLOCK); + zassert_not_equal(-1, EFD_SEMAPHORE); + + zassert_not_equal((eventfd_t)-1, (eventfd_t)0); + + if (IS_ENABLED(CONFIG_POSIX_API)) { + zassert_not_null(eventfd); + zassert_not_null(eventfd_read); + zassert_not_null(eventfd_write); + } +} diff --git a/tests/posix/headers/src/sys_ioctl_h.c b/tests/posix/headers/src/sys_ioctl_h.c new file mode 100644 index 000000000000..286cd78353d8 --- /dev/null +++ b/tests/posix/headers/src/sys_ioctl_h.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see ioctl + * @see ioctl(2) + */ +ZTEST(posix_headers, test_sys_ioctl_h) +{ + if (IS_ENABLED(CONFIG_POSIX_API)) { + zassert_not_null(ioctl); + } +} diff --git a/tests/posix/headers/src/sys_select_h.c b/tests/posix/headers/src/sys_select_h.c new file mode 100644 index 000000000000..6ea986cbae26 --- /dev/null +++ b/tests/posix/headers/src/sys_select_h.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see sys/select.h + */ +ZTEST(posix_headers, test_sys_select_h) +{ + fd_set fds = {0}; + + zassert_not_equal(-1, FD_SETSIZE); + FD_CLR(0, &fds); + FD_ISSET(0, &fds); + FD_SET(0, &fds); + FD_ZERO(&fds); + + if (IS_ENABLED(CONFIG_POSIX_API)) { + /* zassert_not_null(pselect); */ /* not implemented */ + zassert_not_null(select); + } +} diff --git a/tests/posix/headers/src/sys_socket_h.c b/tests/posix/headers/src/sys_socket_h.c new file mode 100644 index 000000000000..81ab9f95fd6f --- /dev/null +++ b/tests/posix/headers/src/sys_socket_h.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-value" +/** + * @brief existence test for `` + * + * @see sys/socket.h + */ +ZTEST(posix_headers, test_sys_socket_h) +{ + struct cmsghdr cmsg = {0}; + struct msghdr mhdr = {0}; + + zassert_true(sizeof(socklen_t) >= sizeof(uint32_t)); + zassert_true((sa_family_t)-1 >= 0); + + zassert_not_equal(-1, offsetof(struct sockaddr, sa_family)); + /* + * FIXME: in zephyr, we define struct sockaddr in + * The sa_data field is defined (incorrectly) as data. + * Fixing that is a (possibly breaking) tree-wide change. + */ + /* zassert_not_equal(-1, offsetof(struct sockaddr, sa_data)); */ /* not implemented */ + + zassert_not_equal(-1, offsetof(struct sockaddr_storage, ss_family)); + zassert_equal(offsetof(struct sockaddr, sa_family), + offsetof(struct sockaddr_storage, ss_family)); + + zassert_not_equal(-1, offsetof(struct msghdr, msg_name)); + zassert_not_equal(-1, offsetof(struct msghdr, msg_namelen)); + zassert_not_equal(-1, offsetof(struct msghdr, msg_iov)); + zassert_not_equal(-1, offsetof(struct msghdr, msg_iovlen)); + zassert_not_equal(-1, offsetof(struct msghdr, msg_control)); + zassert_not_equal(-1, offsetof(struct msghdr, msg_controllen)); + zassert_not_equal(-1, offsetof(struct msghdr, msg_flags)); + + zassert_not_equal(-1, offsetof(struct cmsghdr, cmsg_len)); + zassert_not_equal(-1, offsetof(struct cmsghdr, cmsg_level)); + zassert_not_equal(-1, offsetof(struct cmsghdr, cmsg_type)); + + CMSG_DATA(&cmsg); + CMSG_NXTHDR(&mhdr, &cmsg); + CMSG_FIRSTHDR(&mhdr); + + zassert_not_equal(-1, offsetof(struct linger, l_onoff)); + zassert_not_equal(-1, offsetof(struct linger, l_linger)); + + zassert_not_equal(-1, SOCK_DGRAM); + zassert_not_equal(-1, SOCK_RAW); + /* zassert_not_equal(-1, SOCK_SEQPACKET); */ /* not implemented */ + zassert_not_equal(-1, SOCK_STREAM); + + zassert_not_equal(-1, SO_ACCEPTCONN); + zassert_not_equal(-1, SO_BROADCAST); + zassert_not_equal(-1, SO_DEBUG); + zassert_not_equal(-1, SO_DONTROUTE); + zassert_not_equal(-1, SO_ERROR); + zassert_not_equal(-1, SO_KEEPALIVE); + zassert_not_equal(-1, SO_LINGER); + zassert_not_equal(-1, SO_OOBINLINE); + zassert_not_equal(-1, SO_RCVBUF); + zassert_not_equal(-1, SO_RCVLOWAT); + zassert_not_equal(-1, SO_RCVTIMEO); + zassert_not_equal(-1, SO_REUSEADDR); + zassert_not_equal(-1, SO_SNDBUF); + zassert_not_equal(-1, SO_SNDLOWAT); + zassert_not_equal(-1, SO_SNDTIMEO); + zassert_not_equal(-1, SO_TYPE); + + zassert_not_equal(-1, SOMAXCONN); + + /* zassert_not_equal(-1, MSG_CTRUNC); */ /* not implemented */ + /* zassert_not_equal(-1, MSG_DONTROUTE); */ /* not implemented */ + /* zassert_not_equal(-1, MSG_EOR); */ /* not implemented */ + /* zassert_not_equal(-1, MSG_OOB); */ /* not implemented */ + /* zassert_not_equal(-1, MSG_NOSIGNAL); */ /* not implemented */ + zassert_not_equal(-1, MSG_PEEK); + zassert_not_equal(-1, MSG_TRUNC); + zassert_not_equal(-1, MSG_WAITALL); + + zassert_not_equal(-1, AF_INET); + zassert_not_equal(-1, AF_INET6); + zassert_not_equal(-1, AF_UNIX); + zassert_not_equal(-1, AF_UNSPEC); + + zassert_not_equal(-1, SHUT_RD); + zassert_not_equal(-1, SHUT_RDWR); + zassert_not_equal(-1, SHUT_WR); + + if (IS_ENABLED(CONFIG_POSIX_API)) { + zassert_not_null(accept); + zassert_not_null(bind); + zassert_not_null(connect); + zassert_not_null(getpeername); + zassert_not_null(getsockname); + zassert_not_null(listen); + zassert_not_null(recv); + zassert_not_null(recvfrom); + /* zassert_not_null(recvmsg); */ /* not implemented */ + zassert_not_null(send); + zassert_not_null(sendmsg); + zassert_not_null(sendto); + zassert_not_null(setsockopt); + zassert_not_null(shutdown); + /* zassert_not_null(sockatmark); */ /* not implemented */ + zassert_not_null(socket); + zassert_not_null(socketpair); + } +} +#pragma GCC diagnostic pop diff --git a/tests/posix/headers/src/sys_time_h.c b/tests/posix/headers/src/sys_time_h.c new file mode 100644 index 000000000000..aa766943961f --- /dev/null +++ b/tests/posix/headers/src/sys_time_h.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see sys/time.h + */ +ZTEST(posix_headers, test_sys_time_h) +{ + zassert_not_equal(-1, offsetof(struct timeval, tv_sec)); + zassert_not_equal(-1, offsetof(struct timeval, tv_usec)); + + /* zassert_not_equal(-1, offsetof(struct itimerval, it_interval)); */ /* not implemented */ + /* zassert_not_equal(-1, offsetof(struct itimerval, it_value)); */ /* not implemented */ + + /* zassert_not_equal(-1, ITIMER_REAL); */ /* not implemented */ + /* zassert_not_equal(-1, ITIMER_VIRTUAL); */ /* not implemented */ + /* zassert_not_equal(-1, ITIMER_PROF); */ /* not implemented */ + + if (IS_ENABLED(CONFIG_POSIX_API)) { + /* zassert_not_null(getitimer); */ /* not implemented */ + zassert_not_null(gettimeofday); + /* zassert_not_null(setitimer); */ /* not implemented */ + /* zassert_not_null(utimes); */ /* not implemented */ + } +} diff --git a/tests/posix/headers/src/unistd_h.c b/tests/posix/headers/src/unistd_h.c new file mode 100644 index 000000000000..79586c5b00ef --- /dev/null +++ b/tests/posix/headers/src/unistd_h.c @@ -0,0 +1,389 @@ +/* + * Copyright (c) 2022 Meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "_common.h" + +#ifdef CONFIG_POSIX_API +#include +#else +#include +#endif + +/** + * @brief existence test for `` + * + * @see unistd.h + */ +ZTEST(posix_headers, test_unistd_h) +{ + /* zassert_not_equal(-1, _POSIX_VERSION); */ /* not implemented */ + /* zassert_not_equal(-1, _POSIX2_VERSION); */ /* not implemented */ + /* zassert_not_equal(-1, _XOPEN_VERSION); */ /* not implemented */ + + /* zassert_not_equal(INT_MIN, _POSIX_ADVISORY_INFO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_ASYNCHRONOUS_IO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_BARRIERS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_CHOWN_RESTRICTED); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_CPUTIME); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_FSYNC); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_IPV6); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_JOB_CONTROL); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_MAPPED_FILES); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_MEMLOCK); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_MEMLOCK_RANGE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_MEMORY_PROTECTION); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_MESSAGE_PASSING); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_MONOTONIC_CLOCK); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_NO_TRUNC); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_PRIORITIZED_IO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_PRIORITY_SCHEDULING); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_RAW_SOCKETS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_READER_WRITER_LOCKS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_REALTIME_SIGNALS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_REGEXP); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_SAVED_IDS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_SHARED_MEMORY_OBJECTS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_SHELL); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_SPAWN); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_SPIN_LOCKS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_SPORADIC_SERVER); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_SYNCHRONIZED_IO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_THREAD_ATTR_STACKADDR); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_THREAD_ATTR_STACKSIZE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_THREAD_CPUTIME); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_THREAD_PRIO_INHERIT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_THREAD_PRIO_PROTECT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_THREAD_PRIORITY_SCHEDULING); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_THREAD_PROCESS_SHARED); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_THREAD_ROBUST_PRIO_INHERIT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_THREAD_ROBUST_PRIO_PROTECT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_THREAD_SAFE_FUNCTIONS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_THREAD_SPORADIC_SERVER); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_THREADS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_TIMEOUTS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_TIMERS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_TRACE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_TRACE_EVENT_FILTER); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_TRACE_INHERIT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_TRACE_LOG); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_TYPED_MEMORY_OBJECTS); */ /* not implemented */ + + /* zassert_not_equal(INT_MIN, _POSIX_V6_ILP32_OFF32); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_V6_ILP32_OFFBIG); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_V6_LP64_OFF64); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_V6_LPBIG_OFFBIG); */ /* not implemented */ + + /* zassert_not_equal(INT_MIN, _POSIX_V7_ILP32_OFF32); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_V7_ILP32_OFFBIG); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_V7_LP64_OFF64); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_V7_LPBIG_OFFBIG); */ /* not implemented */ + + /* zassert_not_equal(INT_MIN, _POSIX2_C_BIND); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_C_DEV); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_CHAR_TERM); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_FORT_DEV); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_FORT_RUN); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_LOCALEDEF); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_PBS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_PBS_ACCOUNTING); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_PBS_CHECKPOINT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_PBS_LOCATE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_PBS_MESSAGE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_PBS_TRACK); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_SW_DEV); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_UPE); */ /* not implemented */ + + /* zassert_not_equal(INT_MIN, _XOPEN_CRYPT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _XOPEN_ENH_I18N); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _XOPEN_REALTIME); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _XOPEN_REALTIME_THREADS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _XOPEN_SHM); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _XOPEN_STREAMS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _XOPEN_UNIX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _XOPEN_UUCP); */ /* not implemented */ + + /* zassert_not_equal(INT_MIN, _POSIX_ASYNC_IO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_PRIO_IO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX_SYNC_IO); */ /* not implemented */ + + /* zassert_not_equal(-1, _POSIX_TIMESTAMP_RESOLUTION); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _POSIX2_SYMLINKS); */ /* not implemented */ + + /* zassert_not_equal(-1, F_OK); */ /* not implemented */ + /* zassert_not_equal(-1, R_OK); */ /* not implemented */ + /* zassert_not_equal(-1, W_OK); */ /* not implemented */ + /* zassert_not_equal(-1, X_OK); */ /* not implemented */ + + /* zassert_not_equal(INT_MIN, _CS_PATH); */ /* not implemented */ + + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_ILP32_OFF32_CFLAGS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_ILP32_OFF32_LDFLAGS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_ILP32_OFF32_LIBS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_ILP32_OFFBIG_LIBS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_LP64_OFF64_CFLAGS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_LP64_OFF64_LDFLAGS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_LP64_OFF64_LIBS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_LPBIG_OFFBIG_LIBS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_THREADS_CFLAGS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_THREADS_LDFLAGS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _CS_V7_ENV); */ /* not implemented */ + + /* zassert_not_equal(-1, F_LOCK); */ /* not implemented */ + /* zassert_not_equal(-1, F_TEST); */ /* not implemented */ + /* zassert_not_equal(-1, F_TLOCK); */ /* not implemented */ + /* zassert_not_equal(-1, F_ULOCK); */ /* not implemented */ + + /* zassert_not_equal(INT_MIN, _PC_2_SYMLINKS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_ALLOC_SIZE_MIN); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_ASYNC_IO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_CHOWN_RESTRICTED); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_FILESIZEBITS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_LINK_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_MAX_CANON); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_MAX_INPUT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_NAME_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_NO_TRUNC); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_PATH_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_PIPE_BUF); */ /* not imp``lemented */ + /* zassert_not_equal(INT_MIN, _PC_PRIO_IO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_REC_INCR_XFER_SIZE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_REC_MAX_XFER_SIZE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_REC_MIN_XFER_SIZE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_REC_XFER_ALIGN); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_SYMLINK_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_SYNC_IO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_TIMESTAMP_RESOLUTION); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _PC_VDISABLE); */ /* not implemented */ + + /* zassert_not_equal(INT_MIN, _SC_2_C_BIND); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_C_DEV); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_CHAR_TERM); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_FORT_DEV); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_FORT_RUN); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_LOCALEDEF); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_PBS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_PBS_ACCOUNTING); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_PBS_CHECKPOINT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_PBS_LOCATE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_PBS_MESSAGE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_PBS_TRACK); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_SW_DEV); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_UPE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_2_VERSION); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_ADVISORY_INFO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_AIO_LISTIO_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_AIO_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_AIO_PRIO_DELTA_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_ARG_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_ASYNCHRONOUS_IO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_ATEXIT_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_BARRIERS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_BC_BASE_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_BC_DIM_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_BC_SCALE_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_BC_STRING_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_CHILD_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_CLK_TCK); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_CLOCK_SELECTION); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_COLL_WEIGHTS_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_CPUTIME); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_DELAYTIMER_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_EXPR_NEST_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_FSYNC); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_GETGR_R_SIZE_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_GETPW_R_SIZE_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_HOST_NAME_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_IOV_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_IPV6); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_JOB_CONTROL); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_LINE_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_LOGIN_NAME_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_MAPPED_FILES); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_MEMLOCK); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_MEMLOCK_RANGE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_MEMORY_PROTECTION); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_MESSAGE_PASSING); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_MONOTONIC_CLOCK); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_MQ_OPEN_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_MQ_PRIO_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_NGROUPS_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_OPEN_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_PAGE_SIZE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_PAGESIZE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_PRIORITIZED_IO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_PRIORITY_SCHEDULING); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_RAW_SOCKETS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_RE_DUP_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_READER_WRITER_LOCKS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_REALTIME_SIGNALS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_REGEXP); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_RTSIG_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SAVED_IDS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SEM_NSEMS_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SEM_VALUE_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SEMAPHORES); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SHARED_MEMORY_OBJECTS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SHELL); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SIGQUEUE_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SPAWN); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SPIN_LOCKS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SPORADIC_SERVER); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SS_REPL_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_STREAM_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SYMLOOP_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_SYNCHRONIZED_IO); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_ATTR_STACKADDR); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_ATTR_STACKSIZE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_CPUTIME); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_DESTRUCTOR_ITERATIONS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_KEYS_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_PRIO_INHERIT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_PRIO_PROTECT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_PRIORITY_SCHEDULING); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_PROCESS_SHARED); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_ROBUST_PRIO_INHERIT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_ROBUST_PRIO_PROTECT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_SAFE_FUNCTIONS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_SPORADIC_SERVER); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_STACK_MIN); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREAD_THREADS_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_THREADS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TIMEOUTS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TIMER_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TIMERS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TRACE); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TRACE_EVENT_FILTER); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TRACE_EVENT_NAME_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TRACE_INHERIT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TRACE_LOG); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TRACE_NAME_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TRACE_SYS_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TRACE_USER_EVENT_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TTY_NAME_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TYPED_MEMORY_OBJECTS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_TZNAME_MAX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_V7_ILP32_OFF32); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_V7_ILP32_OFFBIG); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_V7_LP64_OFF64); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_V7_LPBIG_OFFBIG); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_V6_ILP32_OFF32); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_V6_ILP32_OFFBIG); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_V6_LP64_OFF64); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_V6_LPBIG_OFFBIG); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_VERSION); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_XOPEN_CRYPT); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_XOPEN_ENH_I18N); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_XOPEN_REALTIME); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_XOPEN_REALTIME_THREADS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_XOPEN_SHM); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_XOPEN_STREAMS); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_XOPEN_UNIX); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_XOPEN_UUCP); */ /* not implemented */ + /* zassert_not_equal(INT_MIN, _SC_XOPEN_VERSION); */ /* not implemented */ + + /* zassert_equal(STDERR_FILENO, 2); */ /* not implemented */ + /* zassert_equal(STDIN_FILENO, 0); */ /* not implemented */ + /* zassert_equal(STDOUT_FILENO, 1); */ /* not implemented */ + + /* zassert_not_equal(INT_MIN, _POSIX_VDISABLE); */ /* not implemented */ + +/* + * FIXME: this should really use IS_ENABLED() + * When CONFIG_POSIX_API is n-selected (i.e. POSIX headers can only be + * included with , i.e. are namespaced), then there + * should be no reason to conditionally declare standard posix + * function prototypes. + */ +#ifdef CONFIG_POSIX_API + /* zassert_not_null(access); */ /* not implemented */ + /* zassert_not_null(alarm); */ /* not implemented */ + /* zassert_not_null(chdir); */ /* not implemented */ + /* zassert_not_null(chown); */ /* not implemented */ + zassert_not_null(close); + /* zassert_not_null(confstr); */ /* not implemented */ + /* zassert_not_null(crypt); */ /* not implemented */ + /* zassert_not_null(dup); */ /* not implemented */ + /* zassert_not_null(dup2); */ /* not implemented */ + zassert_not_null(_exit); + /* zassert_not_null(encrypt); */ /* not implemented */ + /* zassert_not_null(execl); */ /* not implemented */ + /* zassert_not_null(execle); */ /* not implemented */ + /* zassert_not_null(execlp); */ /* not implemented */ + /* zassert_not_null(execv); */ /* not implemented */ + /* zassert_not_null(execve); */ /* not implemented */ + /* zassert_not_null(execvp); */ /* not implemented */ + /* zassert_not_null(faccessat); */ /* not implemented */ + /* zassert_not_null(fchdir); */ /* not implemented */ + /* zassert_not_null(fchown); */ /* not implemented */ + /* zassert_not_null(fchownat); */ /* not implemented */ + /* zassert_not_null(fdatasync); */ /* not implemented */ + /* zassert_not_null(fexecve); */ /* not implemented */ + /* zassert_not_null(fork); */ /* not implemented */ + /* zassert_not_null(fpathconf); */ /* not implemented */ + /* zassert_not_null(fsync); */ /* not implemented */ + /* zassert_not_null(ftruncate); */ /* not implemented */ + /* zassert_not_null(getcwd); */ /* not implemented */ + /* zassert_not_null(getegid); */ /* not implemented */ + /* zassert_not_null(geteuid); */ /* not implemented */ + /* zassert_not_null(getgid); */ /* not implemented */ + /* zassert_not_null(getgroups); */ /* not implemented */ + /* zassert_not_null(gethostid); */ /* not implemented */ + /* zassert_not_null(gethostname); */ /* not implemented */ + /* zassert_not_null(getlogin); */ /* not implemented */ + /* zassert_not_null(getlogin_r); */ /* not implemented */ + zassert_not_null(getopt); + /* zassert_not_null(getpgid); */ /* not implemented */ + /* zassert_not_null(getpgrp); */ /* not implemented */ + /* zassert_not_null(getpid); */ /* not implemented */ + /* zassert_not_null(getppid); */ /* not implemented */ + /* zassert_not_null(getsid); */ /* not implemented */ + /* zassert_not_null(getuid); */ /* not implemented */ + /* zassert_not_null(isatty); */ /* not implemented */ + /* zassert_not_null(lchown); */ /* not implemented */ + /* zassert_not_null(link); */ /* not implemented */ + /* zassert_not_null(linkat); */ /* not implemented */ + /* zassert_not_null(lockf); */ /* not implemented */ + zassert_not_null(lseek); + /* zassert_not_null(nice); */ /* not implemented */ + /* zassert_not_null(pathconf); */ /* not implemented */ + /* zassert_not_null(pause); */ /* not implemented */ + /* zassert_not_null(pipe); */ /* not implemented */ + /* zassert_not_null(pread); */ /* not implemented */ + /* zassert_not_null(pwrite); */ /* not implemented */ + zassert_not_null(read); + /* zassert_not_null(readlink); */ /* not implemented */ + /* zassert_not_null(readlinkat); */ /* not implemented */ + /* zassert_not_null(rmdir); */ /* not implemented */ + /* zassert_not_null(setegid); */ /* not implemented */ + /* zassert_not_null(seteuid); */ /* not implemented */ + /* zassert_not_null(setgid); */ /* not implemented */ + /* zassert_not_null(setpgid); */ /* not implemented */ + /* zassert_not_null(setpgrp); */ /* not implemented */ + /* zassert_not_null(setregid); */ /* not implemented */ + /* zassert_not_null(setreuid); */ /* not implemented */ + /* zassert_not_null(setsid); */ /* not implemented */ + /* zassert_not_null(setuid); */ /* not implemented */ + zassert_not_null(sleep); + /* zassert_not_null(swab); */ /* not implemented */ + /* zassert_not_null(symlink); */ /* not implemented */ + /* zassert_not_null(symlinkat); */ /* not implemented */ + /* zassert_not_null(sync); */ /* not implemented */ + /* zassert_not_null(sysconf); */ /* not implemented */ + /* zassert_not_null(tcgetpgrp); */ /* not implemented */ + /* zassert_not_null(tcsetpgrp); */ /* not implemented */ + /* zassert_not_null(truncate); */ /* not implemented */ + /* zassert_not_null(ttyname); */ /* not implemented */ + /* zassert_not_null(ttyname_r); */ /* not implemented */ + zassert_not_null(unlink); + /* zassert_not_null(unlinkat); */ /* not implemented */ + zassert_not_null(write); +#endif +} diff --git a/tests/posix/headers/testcase.yaml b/tests/posix/headers/testcase.yaml new file mode 100644 index 000000000000..fde61e074526 --- /dev/null +++ b/tests/posix/headers/testcase.yaml @@ -0,0 +1,44 @@ +common: + arch_exclude: posix + tags: posix net socket + +tests: + portability.posix.headers.with_posix_api: + extra_configs: + - CONFIG_POSIX_API=y + portability.posix.headers.without_posix_api: + extra_configs: + - CONFIG_POSIX_API=n + portability.posix.headers.picolibc.with_posix_api: + tags: picolibc + filter: CONFIG_PICOLIBC_SUPPORTED + extra_configs: + - CONFIG_POSIX_API=y + - CONFIG_PICOLIBC=y + portability.posix.headers.picolibc.without_posix_api: + tags: picolibc + filter: CONFIG_PICOLIBC_SUPPORTED + extra_configs: + - CONFIG_POSIX_API=n + - CONFIG_PICOLIBC=y + portability.posix.headers.newlib.with_posix_api: + tags: newlib + filter: TOOLCHAIN_HAS_NEWLIB == 1 + extra_configs: + - CONFIG_POSIX_API=y + - CONFIG_NEWLIB_LIBC=y + portability.posix.headers.newlib.without_posix_api: + filter: TOOLCHAIN_HAS_NEWLIB == 1 + extra_configs: + - CONFIG_POSIX_API=n + - CONFIG_NEWLIB_LIBC=y + portability.posix.headers.arcmwdtlib.with_posix_api: + toolchain_allow: arcmwdt + extra_configs: + - CONFIG_POSIX_API=y + - CONFIG_ARCMWDT_LIBC=y + portability.posix.headers.arcmwdtlib.without_posix_api: + toolchain_allow: arcmwdt + extra_configs: + - CONFIG_POSIX_API=n + - CONFIG_ARCMWDT_LIBC=y