poll.c (313B)
1 /* 2 * poll.c - poll system call 3 * Copyright (C) 2026. All rights reserved. 4 */ 5 6 #include "libc.h" 7 8 int poll(struct pollfd *fds, nfds_t nfds, int timeout) { 9 long ret = syscall(SYS_poll, (long)fds, (long)nfds, (long)timeout, 0, 0, 0); 10 11 if (ret < 0) { 12 errno = -ret; 13 return -1; 14 } 15 16 return (int)ret; 17 }