Skip to content

Commit 73ec778

Browse files
committed
Rename poll to poll_oneoff, and remove __wasi_subrwflags_t.
Renaming `poll` avoids a conflict with the libc poll in implementations where libc shared a namespace with the wasi syscall names. And calling it "oneoff" makes it clear that this is the classic poll which unlike things like epoll doesn't have a way to factor out the per-file-descriptor overhead over multiple calls. __wasi_subrwflags_t was unused and its only value was deprecated.
1 parent d962aaa commit 73ec778

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

expected/wasm32-wasi/undefined-symbols.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ __wasi_file_stat_get
5151
__wasi_file_stat_put
5252
__wasi_file_symlink
5353
__wasi_file_unlink
54-
__wasi_poll
54+
__wasi_poll_oneoff
5555
__wasi_proc_exit
5656
__wasi_random_get
5757
__wasi_sched_yield

libc-bottom-half/cloudlibc/src/libc/poll/poll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int poll(struct pollfd *fds, size_t nfds, int timeout) {
7575
// Execute poll().
7676
__wasi_event_t events[nevents];
7777
__wasi_errno_t error =
78-
__wasi_poll(subscriptions, events, nevents, &nevents);
78+
__wasi_poll_oneoff(subscriptions, events, nevents, &nevents);
7979
if (error != 0) {
8080
errno = error;
8181
return -1;

libc-bottom-half/cloudlibc/src/libc/sys/ioctl/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int ioctl(int fildes, int request, ...) {
3434
};
3535
__wasi_event_t events[__arraycount(subscriptions)];
3636
size_t nevents;
37-
__wasi_errno_t error = __wasi_poll(
37+
__wasi_errno_t error = __wasi_poll_oneoff(
3838
subscriptions, events, __arraycount(subscriptions), &nevents);
3939
if (error != 0) {
4040
errno = error;

libc-bottom-half/cloudlibc/src/libc/sys/select/pselect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ int pselect(int nfds, fd_set *restrict readfds, fd_set *restrict writefds,
104104
// Execute poll().
105105
__wasi_event_t events[nevents];
106106
__wasi_errno_t error =
107-
__wasi_poll(subscriptions, events, nevents, &nevents);
107+
__wasi_poll_oneoff(subscriptions, events, nevents, &nevents);
108108
if (error != 0) {
109109
errno = error;
110110
return -1;

libc-bottom-half/cloudlibc/src/libc/time/clock_nanosleep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp,
4444
// Block until polling event is triggered.
4545
size_t nevents;
4646
__wasi_event_t ev;
47-
__wasi_errno_t error = __wasi_poll(&sub, &ev, 1, &nevents);
47+
__wasi_errno_t error = __wasi_poll_oneoff(&sub, &ev, 1, &nevents);
4848
return error == 0 && ev.error == 0 ? 0 : ENOTSUP;
4949
}

libc-bottom-half/headers/public/wasi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,12 +735,12 @@ __wasi_errno_t __wasi_file_unlink(
735735
__wasi_ulflags_t flags
736736
) __WASI_SYSCALL_NAME(file_unlink) __attribute__((__warn_unused_result__));
737737

738-
__wasi_errno_t __wasi_poll(
738+
__wasi_errno_t __wasi_poll_oneoff(
739739
const __wasi_subscription_t *in,
740740
__wasi_event_t *out,
741741
size_t nsubscriptions,
742742
size_t *nevents
743-
) __WASI_SYSCALL_NAME(poll) __attribute__((__warn_unused_result__));
743+
) __WASI_SYSCALL_NAME(poll_oneoff) __attribute__((__warn_unused_result__));
744744

745745
_Noreturn void __wasi_proc_exit(
746746
__wasi_exitcode_t rval

0 commit comments

Comments
 (0)