Skip to content

Commit f4cb7e3

Browse files
jmichalski-antkartben
authored andcommitted
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 <[email protected]> Signed-off-by: Maciej Sobkowski <[email protected]>
1 parent 55db0d8 commit f4cb7e3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/zephyr/posix/poll.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
extern "C" {
1313
#endif
1414

15+
typedef unsigned int nfds_t;
16+
1517
#define pollfd zsock_pollfd
1618

1719
#define POLLIN ZSOCK_POLLIN

tests/posix/headers/src/poll_h.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ZTEST(posix_headers, test_poll_h)
2323
zassert_not_equal(-1, offsetof(struct pollfd, events));
2424
zassert_not_equal(-1, offsetof(struct pollfd, revents));
2525

26-
/* zassert_true(sizeof(nfds_t) <= sizeof(long)); */ /* not implemented */
26+
zassert_true(sizeof(nfds_t) <= sizeof(long));
2727

2828
zassert_not_equal(-1, POLLIN);
2929
/* zassert_not_equal(-1, POLLRDNORM); */ /* not implemented */

0 commit comments

Comments
 (0)