/* This functionally is ideally called regularly during an idle period. */
int nl_cache_mngr_poll(struct nl_cache_mngr *mngr, int timeout)
/* This functionally is ideally called regularly during an idle period. */
int nl_cache_mngr_poll(struct nl_cache_mngr *mngr, int timeout)
{
	int ret;
	struct pollfd fds = {
		.fd = nl_socket_get_fd(mngr->cm_handle),
		.events = POLLIN,
	};
	NL_DBG(3, "Cache manager %p, poll() fd %d\n", mngr, fds.fd);
	ret = poll(&fds, 1, timeout);
	NL_DBG(3, "Cache manager %p, poll() returned %d\n", mngr, ret);
	if (ret < 0)
		return -nl_syserr2nlerr(errno);
	if (ret == 0)
		return 0;
	return nl_cache_mngr_data_ready(mngr);
}