upipe/ueventfd.h header reference
Upipe replacement for eventfd calls More
Header inclusion
Members
Types
- struct ueventfd
- enum ueventfd_mode
Functions
- void ueventfd_clean(struct ueventfd *fd)
- bool ueventfd_init(struct ueventfd *fd, bool readable)
- bool ueventfd_read(struct ueventfd *fd)
- struct upump * ueventfd_upump_alloc(struct ueventfd *fd, struct upump_mgr *upump_mgr, upump_cb cb, void *opaque, struct urefcount *refcount)
- bool ueventfd_write(struct ueventfd *fd)
Description
Upipe replacement for eventfd calls
Members detail
This macro is declared in upipe/ueventfd.h source file, line 58.
This macro is declared in upipe/ueventfd.h source file, line 31.
This struct is declared in upipe/ueventfd.h source file, line 71.
This struct allows to wait on a condition in a upump event loop.
Field | Description |
---|---|
enum ueventfd_mode mode; | mode of allocation of the ueventfd |
union <anonymous> { | |
int event_fd; | used when eventfd() is available |
int pipe_fds[2]; | used when pipe() is available |
}; |
void ueventfd_clean(struct ueventfd *fd)
This function is declared in upipe/ueventfd.h source file, line 284.
This function releases any data and file descriptors associated with the ueventfd.
Parameter list:
- fd: pointer to a ueventfd
bool ueventfd_init(struct ueventfd *fd, bool readable)
This function is declared in upipe/ueventfd.h source file, line 222.
This function initializes a ueventfd.
Parameter list:
- fd: pointer to a ueventfd
- readable: true if the ueventfd must be initialized as readable
The return value is false in case of failure
This enum is declared in upipe/ueventfd.h source file, line 63.
This enum is a list of the available allocation modes for the ueventfd.
Identifier | Value | Description |
---|---|---|
UEVENTFD_MODE_EVENTFD | 0 | uses the eventfd() system call |
UEVENTFD_MODE_PIPE | 1 | uses the pipe() system call |
bool ueventfd_read(struct ueventfd *fd)
This function is declared in upipe/ueventfd.h source file, line 117.
This function reads from a ueventfd and makes it non-readable.
Parameter list:
- fd: pointer to a ueventfd
The return value is false in case of an unrecoverable error
struct upump * ueventfd_upump_alloc(struct ueventfd *fd, struct upump_mgr *upump_mgr, upump_cb cb, void *opaque, struct urefcount *refcount)
This function is declared in upipe/ueventfd.h source file, line 96.
This function allocates a watcher triggering when the ueventfd is readable.
Parameter list:
- fd: pointer to a ueventfd
- upump_mgr: management structure for this event loop
- cb: function to call when the watcher triggers
- opaque: pointer to the module's internal structure
- refcount: pointer to urefcount structure to increment during callback, or NULL
The return value is pointer to allocated watcher, or NULL in case of failure
bool ueventfd_write(struct ueventfd *fd)
This function is declared in upipe/ueventfd.h source file, line 169.
This function writes to a ueventfd and make it readable.
Parameter list:
- fd: pointer to a ueventfd
The return value is false in case of an unrecoverable error