libuev 2.4.1
io.c File Reference
#include <errno.h>
#include "uev.h"

Go to the source code of this file.

Functions

int uev_io_init (uev_ctx_t *ctx, uev_t *w, uev_cb_t *cb, void *arg, int fd, int events)
 
int uev_io_set (uev_t *w, int fd, int events)
 
int uev_io_start (uev_t *w)
 
int uev_io_stop (uev_t *w)
 

Detailed Description

Descriptor backend, capable of watching files, sockets, pipes, etc.

Definition in file io.c.

Function Documentation

◆ uev_io_init()

int uev_io_init ( uev_ctx_t * ctx,
uev_t * w,
uev_cb_t * cb,
void * arg,
int fd,
int events )

Create an I/O watcher

Parameters
ctxA valid libuEv context
wPointer to an uev_t watcher
cbI/O callback
argOptional callback argument
fdFile descriptor to watch, or -1 to register an empty watcher
eventsEvents to watch for: UEV_READ, UEV_WRITE, UEV_EDGE, UEV_ONESHOT
Returns
POSIX OK(0) or non-zero with errno set on error.

Definition at line 44 of file io.c.

◆ uev_io_set()

int uev_io_set ( uev_t * w,
int fd,
int events )

Reset an I/O watcher

Parameters
wPointer to an uev_t watcher
fdNew file descriptor to monitor
eventsRequested events to watch for, a mask of UEV_READ and UEV_WRITE
Returns
POSIX OK(0) or non-zero with errno set on error.

Definition at line 65 of file io.c.

◆ uev_io_start()

int uev_io_start ( uev_t * w)

Start an I/O watcher

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

Definition at line 82 of file io.c.

◆ uev_io_stop()

int uev_io_stop ( uev_t * w)

Stop an I/O watcher

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

Definition at line 93 of file io.c.