---
name: "sigevent"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/sigevent"
---

# sigevent(3)

asynchronous event notification

## NAME

**sigevent** – asynchronous event notification

## SYNOPSIS

**#include \<signal.h\>**

## DESCRIPTION

Some operations permit threads to request asynchronous notification of events via a *struct* *sigevent* structure. This structure contains several fields that describe the requested notification:

| | | |
| --- | --- | --- |
| **Type** | **Member** | **Description** |
| *int* | sigev\_notify | notification method |
| *int* | sigev\_signo | signal number |
| *union* *sigval* | sigev\_value | signal value |
| *int* | sigev\_notify\_kqueue |  |
| *unsigned* *short* | sigev\_notify\_kevent\_flags | kevent flags |
| *lwpid\_t* | sigev\_notify\_thread\_id | LWP ID |
| *void* *(\*)(union* *sigval)* | sigev\_notify\_function |  |
| *pthread\_attr\_t* *\** | sigev\_notify\_attributes |  |

The *sigev\_notify* field specifies the notification method used when the event triggers:

- SIGEV\_NONE

  No notification is sent.

- SIGEV\_SIGNAL

  The signal *sigev\_signo* is queued as a real-time signal to the calling process. The value stored in *sigev\_value* will be present in the *si\_value* of the *siginfo\_t* structure of the queued signal.

- SIGEV\_THREAD

  The notification function in *sigev\_notify\_function* is called in a separate thread context. The thread is created with the attributes specified in *\*sigev\_notify\_attributes*. The value stored in *sigev\_value* is passed as the sole argument to *sigev\_notify\_function*. If *sigev\_notify\_attributes* is NULL, the thread is created with default attributes.

- SIGEV\_KEVENT

  A new kevent is posted to the kqueue *sigev\_notify\_kqueue*. The *udata* member of the kevent structure contains the value stored in *sigev\_value*. The meaning of other fields in the kevent are specific to the type of triggered event.

- SIGEV\_THREAD\_ID

  The signal *sigev\_signo* is queued to the thread whose LWP ID is *sigev\_notify\_thread\_id*. The value stored in *sigev\_value* will be present in the *si\_value* of the *siginfo\_t* structure of the queued signal.

## NOTES

Note that programs wishing to use SIGEV\_THREAD notifications must link against the library “librt”.

## SEE ALSO

[aio\_read(2)](/aio_read/2.md), [mq\_notify(2)](/mq_notify/2.md), [timer\_create(2)](/timer_create/2.md), [siginfo(3)](/siginfo/3.md)

## STANDARDS

The *struct* *sigevent* type conforms to IEEE Std 1003.1-2004 (“POSIX.1”).

## HISTORY

The *sigevent* structure first appeared in FreeBSD 3.3.
