diff --git a/book/src/kernel/linux-compatibility/README.md b/book/src/kernel/linux-compatibility/README.md index ce6c46a90..39f9eea1c 100644 --- a/book/src/kernel/linux-compatibility/README.md +++ b/book/src/kernel/linux-compatibility/README.md @@ -27,7 +27,7 @@ which are summarized in the table below. | 4 | stat | ✅ | 💯 | | 5 | fstat | ✅ | 💯 | | 6 | lstat | ✅ | 💯 | -| 7 | poll | ✅ | 💯 | +| 7 | poll | ✅ | [⚠️](syscall-flag-coverage/file-descriptor-and-io-control/#poll) | | 8 | lseek | ✅ | [⚠️](syscall-flag-coverage/file-and-directory-operations/#lseek) | | 9 | mmap | ✅ | [⚠️](syscall-flag-coverage/memory-management/#mmap-and-munmap) | | 10 | mprotect | ✅ | [⚠️](syscall-flag-coverage/memory-management/#mprotect) | @@ -43,7 +43,7 @@ which are summarized in the table below. | 20 | writev | ✅ | 💯 | | 21 | access | ✅ | 💯 | | 22 | pipe | ✅ | 💯 | -| 23 | select | ✅ | ❓ | +| 23 | select | ✅ | 💯 | | 24 | sched_yield | ✅ | 💯 | | 25 | mremap | ✅ | [⚠️](syscall-flag-coverage/memory-management/#mremap) | | 26 | msync | ✅ | [⚠️](syscall-flag-coverage/memory-management/#msync) | diff --git a/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-descriptor-and-io-control/README.md b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-descriptor-and-io-control/README.md index 5d63bd710..63da7853e 100644 --- a/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-descriptor-and-io-control/README.md +++ b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-descriptor-and-io-control/README.md @@ -100,3 +100,19 @@ Unsupported flags in events: For more information, see [the man page](https://man7.org/linux/man-pages/man2/epoll_ctl.2.html). + +### `poll` + +Supported functionality in SCML: + +```c +{{#include poll.scml}} +``` + +Unsupported events: +* `POLLRDBAND` +* `POLLWRNORM` +* `POLLWRBAND` + +For more information, +see [the man page](https://man7.org/linux/man-pages/man2/poll.2.html). diff --git a/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-descriptor-and-io-control/fully_covered.scml b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-descriptor-and-io-control/fully_covered.scml index 4af188c16..669003d17 100644 --- a/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-descriptor-and-io-control/fully_covered.scml +++ b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-descriptor-and-io-control/fully_covered.scml @@ -6,9 +6,6 @@ dup3(oldfd, newfd, flags); // Monitor multiplexed I/O with signal safety and precise timeout handling pselect6(nfds, readfds, writefds, exceptfds, timeout, sigmask); -// Wait for some event on a file descriptor -poll(fds, nfds, timeout); - // Transfer data between file descriptors sendfile(out_fd, in_fd, offset, count); @@ -28,3 +25,6 @@ signalfd4(fd, mask, sizemask, flags = SFD_NONBLOCK | SFD_CLOEXEC); epoll_wait(epfd, events, maxevents, timeout); epoll_pwait(epfd, events, maxevents, timeout, sigmask); epoll_pwait2(epfd, events, maxevents, timeout, sigmask); + +// Wait for I/O event on the file descriptors set in read, write or except bitmaps +select(nfds, readfds, writefds, exceptfds, timeout); diff --git a/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-descriptor-and-io-control/poll.scml b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-descriptor-and-io-control/poll.scml new file mode 100644 index 000000000..5479822fa --- /dev/null +++ b/book/src/kernel/linux-compatibility/syscall-flag-coverage/file-descriptor-and-io-control/poll.scml @@ -0,0 +1,8 @@ +struct pollfd = { + events = POLLIN | POLLPRI | POLLOUT | POLLRDHUP | POLLERR | + POLLHUP | POLLNVAL | POLLRDNORM, + .. +}; + +// Wait for I/O event on a set of file descriptors +poll(fds = [ ], nfds, timeout);