| 22 Dec 2025 |
Randy Eckenrode | * What are the expected semantics when the user provides NULL fds and nfds 0? | 15:47:57 |
Randy Eckenrode | Is it equivalent to passing an empty array? | 15:48:53 |
Randy Eckenrode | macOS supports pselect but not ppoll? | 15:51:13 |
Randy Eckenrode | Let’s look at the implementation. The signature takes a pointer, so NULL should be valid. | 15:52:54 |
Ihar Hrachyshka | one could probably implement g_poll conditioning to default to poll but fall back to select if a) any device fds passed or b) fds is null. then for most calls we would use poll. | 15:53:06 |
Ihar Hrachyshka | that's on nixos
(ins)[nix-shell:/tmp]$ ./a.out
poll() returned: 0
(ins)[nix-shell:/tmp]$ cat test.c
#include <stdio.h>
#include <poll.h>
#include <errno.h>
#include <string.h>
int main() {
int result = poll(NULL, 0, 1000);
printf("poll() returned: %d\n", result);
if (result == -1) {
printf("Error: %s\n", strerror(errno));
}
return 0;
}
(ins)[nix-shell:/tmp]$ clang ./test.c
(ins)[nix-shell:/tmp]$ ./a.out
poll() returned: 0
| 15:53:15 |
Ihar Hrachyshka | actuall it returns the same zero on darwin, not sure if there's more than just that they are looking for... | 15:54:09 |
Ihar Hrachyshka | maybe the original reasoning documented in the comment is no longer applicable, but tap device polling is still an issue. | 15:55:30 |