### Function

# GLib PollFunc

#### Declaration

    gint
    (* GPollFunc) (
      GPollFD* ufds,
      guint nfsd,
      gint timeout_
    )

#### Description [src]

Specifies the type of function passed to g_main_context_set_poll_func(). The semantics of the function should match those of the `poll()` system call.

#### Parameters

`ufds`

  Type: `GPollFD`

  An array of `GPollFD` elements.

  The data is owned by the caller of the function.

`nfsd`

  Type: `guint`

  The number of elements in `ufds`.

`timeout_`

  Type: `gint`

  The maximum time to wait for an event of the file descriptors. A negative value indicates an infinite timeout.

#### Return value

Type: `gint`

The number of `GPollFD` elements which have events or errors reported, or -1 if an error occurred.