GLibUnix.signal_add
Description: Reference for GLibUnix.signal_add

### Function

# GLibUnixsignal_add

since: 2.30

#### Declaration [src]

    guint
    g_unix_signal_add (
      gint signum,
      GSourceFunc handler,
      gpointer user_data
    )

#### Description [src]

A convenience function for g_unix_signal_source_new(), which attaches to the default `GMainContext`. You can remove the watch using g_source_remove().

Available since: 2.30

This function is not directly available to language bindings.

The implementation of this function is provided by `g_unix_signal_add_full()` in language bindings.

#### Parameters

`signum`

  Type: `gint`

  Signal number.

`handler`

  Type: `GSourceFunc`

  Callback.

`user_data`

  Type: `gpointer`

  Data for `handler`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

#### Return value

Type: `guint`

An ID (greater than 0) for the event source.