Lines Matching full:poll

58 	struct nsos_socket_poll poll;  member
208 sock->poll.mid.fd = nsos_adapt_socket(family_mid, type_mid, proto_mid); in nsos_socket_create()
209 if (sock->poll.mid.fd < 0) { in nsos_socket_create()
210 errno = errno_from_nsos_mid(-sock->poll.mid.fd); in nsos_socket_create()
237 ret = nsi_host_read(sock->poll.mid.fd, buf, sz); in nsos_read()
250 ret = nsi_host_write(sock->poll.mid.fd, buf, sz); in nsos_write()
261 struct nsos_socket_poll *poll; in nsos_close() local
264 ret = nsi_host_close(sock->poll.mid.fd); in nsos_close()
269 SYS_DLIST_FOR_EACH_CONTAINER(&nsos_polls, poll, node) { in nsos_close()
270 if (poll == &sock->poll) { in nsos_close()
271 poll->mid.revents = ZSOCK_POLLHUP; in nsos_close()
272 poll->mid.cb(&poll->mid); in nsos_close()
283 struct nsos_socket_poll *poll = CONTAINER_OF(mid, struct nsos_socket_poll, mid); in pollcb() local
285 k_poll_signal_raise(&poll->signal, poll->mid.revents); in pollcb()
290 struct nsos_socket_poll *poll) in nsos_poll_prepare() argument
295 poll->mid.events = pfd->events; in nsos_poll_prepare()
296 poll->mid.revents = 0; in nsos_poll_prepare()
297 poll->mid.cb = pollcb; in nsos_poll_prepare()
303 k_poll_signal_init(&poll->signal); in nsos_poll_prepare()
304 k_poll_event_init(*pev, K_POLL_TYPE_SIGNAL, K_POLL_MODE_NOTIFY_ONLY, &poll->signal); in nsos_poll_prepare()
306 sys_dlist_append(&nsos_polls, &poll->node); in nsos_poll_prepare()
308 nsos_adapt_poll_add(&poll->mid); in nsos_poll_prepare()
316 k_poll_signal_check(&poll->signal, &signaled, &flags); in nsos_poll_prepare()
326 struct k_poll_event **pev, struct nsos_socket_poll *poll) in nsos_poll_update() argument
336 if (!sys_dnode_is_linked(&poll->node)) { in nsos_poll_update()
337 nsos_adapt_poll_update(&poll->mid); in nsos_poll_update()
341 nsos_adapt_poll_remove(&poll->mid); in nsos_poll_update()
342 sys_dlist_remove(&poll->node); in nsos_poll_update()
344 k_poll_signal_check(&poll->signal, &signaled, &flags); in nsos_poll_update()
368 return nsos_poll_prepare(obj, pfd, pev, pev_end, &sock->poll); in nsos_ioctl()
378 return nsos_poll_update(obj, pfd, pev, &sock->poll); in nsos_ioctl()
387 flags = nsos_adapt_fcntl_getfl(sock->poll.mid.fd); in nsos_ioctl()
401 ret = nsos_adapt_fcntl_setfl(sock->poll.mid.fd, flags); in nsos_ioctl()
410 ret = nsos_adapt_fionread(sock->poll.mid.fd, avail); in nsos_ioctl()
570 ret = nsos_adapt_dup(sock->poll.mid.fd); in nsos_wait_for_poll()
616 sock_flags = nsos_adapt_fcntl_getfl(sock->poll.mid.fd); in nsos_poll_if_blocking()
640 ret = nsos_adapt_bind(sock->poll.mid.fd, addr_mid, addrlen_mid); in nsos_bind()
659 ret = nsos_adapt_fcntl_setfl(sock->poll.mid.fd, fcntl_flags | NSOS_MID_O_NONBLOCK); in nsos_connect_blocking()
664 ret = nsos_adapt_connect(sock->poll.mid.fd, addr_mid, addrlen_mid); in nsos_connect_blocking()
674 ret = nsos_adapt_getsockopt(sock->poll.mid.fd, NSOS_MID_SOL_SOCKET, in nsos_connect_blocking()
684 clear_nonblock_ret = nsos_adapt_fcntl_setfl(sock->poll.mid.fd, fcntl_flags); in nsos_connect_blocking()
706 flags = nsos_adapt_fcntl_getfl(sock->poll.mid.fd); in nsos_connect()
709 ret = nsos_adapt_connect(sock->poll.mid.fd, addr_mid, addrlen_mid); in nsos_connect()
728 ret = nsos_adapt_listen(sock->poll.mid.fd, backlog); in nsos_listen()
754 ret = nsos_adapt_accept(accept_sock->poll.mid.fd, addr_mid, &addrlen_mid); in nsos_accept()
779 conn_sock->poll.mid.fd = adapt_fd; in nsos_accept()
824 ret = nsos_adapt_sendto(sock->poll.mid.fd, buf, len, flags_mid, in nsos_sendto()
883 ret = nsos_adapt_sendmsg(sock->poll.mid.fd, &msg_mid, flags_mid); in nsos_sendmsg()
919 ret = nsos_adapt_recvfrom(sock->poll.mid.fd, buf, len, flags_mid, in nsos_recvfrom()
1034 err = nsos_adapt_getsockopt(sock->poll.mid.fd, NSOS_MID_SOL_SOCKET, in nsos_getsockopt_int()
1063 err = nsos_adapt_getsockopt(sock->poll.mid.fd, NSOS_MID_SOL_SOCKET, in nsos_getsockopt()
1083 err = nsos_adapt_getsockopt(sock->poll.mid.fd, NSOS_MID_SOL_SOCKET, in nsos_getsockopt()
1107 err = nsos_adapt_getsockopt(sock->poll.mid.fd, NSOS_MID_SOL_SOCKET, in nsos_getsockopt()
1131 err = nsos_adapt_getsockopt(sock->poll.mid.fd, NSOS_MID_SOL_SOCKET, in nsos_getsockopt()
1214 err = nsos_adapt_setsockopt(sock->poll.mid.fd, nsos_mid_level, nsos_mid_optname, in nsos_setsockopt_int()
1243 err = nsos_adapt_setsockopt(sock->poll.mid.fd, NSOS_MID_SOL_SOCKET, in nsos_setsockopt()
1266 err = nsos_adapt_setsockopt(sock->poll.mid.fd, NSOS_MID_SOL_SOCKET, in nsos_setsockopt()
1295 err = nsos_adapt_setsockopt(sock->poll.mid.fd, NSOS_MID_SOL_SOCKET, in nsos_setsockopt()
1550 struct nsos_socket_poll *poll; in nsos_isr() local
1552 SYS_DLIST_FOR_EACH_CONTAINER(&nsos_polls, poll, node) { in nsos_isr()
1553 if (poll->mid.revents) { in nsos_isr()
1554 poll->mid.cb(&poll->mid); in nsos_isr()