Lines Matching refs:nfds

180 static int PollfdToSystem(struct pollfd *fds, nfds_t nfds, int **pollFdsBak)
182 if ((nfds != 0 && fds == NULL) || (pollFdsBak == NULL)) {
186 if (nfds == 0) {
189 int *pollFds = (int *)malloc(sizeof(int) * nfds);
194 for (int i = 0; i < nfds; ++i) {
208 static void RestorePollfd(struct pollfd *fds, nfds_t nfds, const int *pollFds)
213 for (int i = 0; i < nfds; ++i) {
219 static int UserPoll(struct pollfd *fds, nfds_t nfds, int timeout)
222 int ret = PollfdToSystem(fds, nfds, &pollFds);
227 ret = poll(fds, nfds, timeout);
229 RestorePollfd(fds, nfds, pollFds);
1147 int SysSelect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
1171 ret = do_select(nfds, (readfds ? readfdsRet : NULL), (writefds ? writefdsRet : NULL),
1552 int SysPoll(struct pollfd *fds, nfds_t nfds, int timeout)
1557 if ((nfds >= MAX_POLL_NFDS) || (nfds == 0) || (fds == NULL)) {
1561 kfds = (struct pollfd *)malloc(sizeof(struct pollfd) * nfds);
1563 if (LOS_ArchCopyFromUser(kfds, fds, sizeof(struct pollfd) * nfds) != 0) {
1570 ret = PollfdToSystem(kfds, nfds, &pollFds);
1576 ret = poll(kfds, nfds, timeout);
1583 RestorePollfd(kfds, nfds, pollFds);
1584 if (LOS_ArchCopyToUser(fds, kfds, sizeof(struct pollfd) * nfds) != 0) {
2657 int SysPpoll(struct pollfd *fds, nfds_t nfds, const struct timespec *tmo_p, const sigset_t *sigMask, int nsig)
2685 retVal = SysPoll(fds, nfds, timeout);
2691 int SysPselect6(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
2723 ret = do_select(nfds, readfds, writefds, exceptfds, (struct timeval *)timeout, UserPoll);