Source.addPoll

void addPoll(glib.types.PollFD fd)

Adds a file descriptor to the set of file descriptors polled for this source. This is usually combined with [glib.source.Source.new_] to add an event source. The event source's check function will typically test the revents field in the #GPollFD struct and return true if events need to be processed.

This API is only intended to be used by implementations of #GSource. Do not call this API on a #GSource that you did not create.

Using this API forces the linear scanning of event sources on each main loop iteration. Newly-written event sources should try to use [glib.source.Source.addUnixFd] instead of this API.

Parameters

fda #GPollFD structure holding information about a file descriptor to watch.