UnixUtils.fdAdd

Sets a function to be called when the IO condition, as specified by condition becomes true for fd.

function will be called when the specified IO condition becomes TRUE. The function is expected to clear whatever event caused the IO condition to become true and return TRUE in order to be notified when it happens again. If function returns FALSE then the watch will be cancelled.

The return value of this function can be passed to Source.remove to cancel the watch at any time that it exists.

The source will never close the fd -- you must do it yourself.

struct UnixUtils
static
uint
fdAdd

Parameters

fd int

a file descriptor

condition GIOCondition

IO conditions to watch for on fd

function_ GUnixFDSourceFunc
userData void*

data to pass to function

Return Value

Type: uint

the ID (greater than 0) of the event source

Meta

Since

2.36