posix: define nfds_t in posix/poll.h
Add the nfds_t type defined by POSIX and test for it. Signed-off-by: Jakub Michalski <jmichalski@antmicro.com> Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
This commit is contained in:
parent
55db0d84a8
commit
f4cb7e35ec
2 changed files with 3 additions and 1 deletions
|
@ -12,6 +12,8 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef unsigned int nfds_t;
|
||||||
|
|
||||||
#define pollfd zsock_pollfd
|
#define pollfd zsock_pollfd
|
||||||
|
|
||||||
#define POLLIN ZSOCK_POLLIN
|
#define POLLIN ZSOCK_POLLIN
|
||||||
|
|
|
@ -23,7 +23,7 @@ ZTEST(posix_headers, test_poll_h)
|
||||||
zassert_not_equal(-1, offsetof(struct pollfd, events));
|
zassert_not_equal(-1, offsetof(struct pollfd, events));
|
||||||
zassert_not_equal(-1, offsetof(struct pollfd, revents));
|
zassert_not_equal(-1, offsetof(struct pollfd, revents));
|
||||||
|
|
||||||
/* zassert_true(sizeof(nfds_t) <= sizeof(long)); */ /* not implemented */
|
zassert_true(sizeof(nfds_t) <= sizeof(long));
|
||||||
|
|
||||||
zassert_not_equal(-1, POLLIN);
|
zassert_not_equal(-1, POLLIN);
|
||||||
/* zassert_not_equal(-1, POLLRDNORM); */ /* not implemented */
|
/* zassert_not_equal(-1, POLLRDNORM); */ /* not implemented */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue