libuev 2.4.1
signal.c File Reference
#include <errno.h>
#include <signal.h>
#include <sys/signalfd.h>
#include <unistd.h>
#include "uev.h"

Go to the source code of this file.

Functions

int uev_signal_init (uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg, int signo)
 
int uev_signal_set (uev_t *w, int signo)
 
int uev_signal_start (uev_t *w)
 
int uev_signal_stop (uev_t *w)
 

Detailed Description

Linux signalfd(2).

Notice how uev::siginfo returns a struct signalfd_siginfo with useful data on the sender of the signal, this information is only available to signal callbacks.

Definition in file signal.c.

Function Documentation

◆ uev_signal_init()

int uev_signal_init ( uev_ctx_t * ctx,
uev_t * w,
uev_cb_t * cb,
void * arg,
int signo )

Create a signal watcher

Parameters
ctxA valid libuEv context
wPointer to an uev_t watcher
cbSignal callback
argOptional callback argument
signoSignal to watch for
Returns
POSIX OK(0) or non-zero with errno set on error.

Definition at line 52 of file signal.c.

◆ uev_signal_set()

int uev_signal_set ( uev_t * w,
int signo )

Reset a signal watcher

Parameters
wWatcher to reset
signoNew signal to watch for
Returns
POSIX OK(0) or non-zero with errno set on error.

Definition at line 88 of file signal.c.

◆ uev_signal_start()

int uev_signal_start ( uev_t * w)

Start a stopped signal watcher

Parameters
wWatcher to start (again)
Returns
POSIX OK(0) or non-zero with errno set on error.

Definition at line 128 of file signal.c.

◆ uev_signal_stop()

int uev_signal_stop ( uev_t * w)

Stop a signal watcher

Parameters
wWatcher to stop
Returns
POSIX OK(0) or non-zero with errno set on error.

Definition at line 147 of file signal.c.