Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

notify (nr 510)

Signal a notification file descriptor.

Signature

notify(fd: i32) → 0 or -errno

Arguments

ArgRegisterDescription
fdrdiNotification fd (from notify_create)

Return value

Returns 0 on success.

Errors

ErrorCondition
EBADFfd is invalid or does not refer to a notification object

Description

Signals a notification fd, waking a consumer waiting via OP_RING_WAIT on a completion port.

If an OP_RING_WAIT is armed on the fd, a completion is posted to the consumer’s port with result = 0 and opcode = OP_RING_WAIT.

If no OP_RING_WAIT is armed, the notification is buffered. The next OP_RING_WAIT submission will complete immediately. Multiple buffered notifications coalesce into one event.

The caller uses scheduler donate (set_donate_target + yield_now) for low-latency wakeup of the consumer.

Userspace usage (C)

#define SYS_NOTIFY 510

static long notify(int fd) {
    return syscall(SYS_NOTIFY, fd);
}

notify(nfd);  /* wake consumer */

Implementation

osl/src/notify.rssys_notify

See also