Logo Search packages:      
Sourcecode: libnl2 version File versions  Download package

int nl_cache_mngr_poll ( struct nl_cache_mngr *  mngr,
int  timeout 

Check for event notifications

  • mngr Cache Manager
  • timeout Upper limit poll() will block, in milliseconds.
Causes poll() to be called to check for new event notifications being available. Automatically receives and handles available notifications.

This functionally is ideally called regularly during an idle period.

A positive value if at least one update was handled, 0 for none, or a negative error code.

Definition at line 314 of file cache_mngr.c.

References nl_cache_mngr_data_ready().

      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);

Generated by  Doxygen 1.6.0   Back to index