45 void *ptr = malloc(
sizeof(
io_ctx_t));
52 io_ctx_free(
void *ptr)
void io_ctx_remove(io_ctx_t *ctx, struct io_svc *svc)
Unregisters an I/O service with an I/O context.
This header file is part of the I/O library; it contains the I/O context and service declarations...
void mtx_destroy(mtx_t *mtx)
Releases any resources used by the mutex at mtx.
void io_ctx_destroy(io_ctx_t *ctx)
Destroys an I/O context.
int(* notify_fork)(struct io_svc *svc, enum io_fork_event e)
A pointer to the function to be called by io_ctx_notify_fork() (can be NULL).
Indicates that the requested operation succeeded.
io_fork_event
The type of event generated by an I/O context before and after a process fork.
void(* shutdown)(struct io_svc *svc)
A pointer to the function to be called by io_ctx_shutdown() (can be NULL).
A mutex type that supports neither timeout nor test and return.
struct dlnode * next
A pointer to the next node in the list.
int mtx_unlock(mtx_t *mtx)
Unlocks the mutex at mtx.
void set_errc(int errc)
Sets the current (thread-specific) native error code to errc.
struct dlnode * dllist_last(const struct dllist *list)
Returns a pointer to the last node in a doubly-linked list.
This header file is part of the C11 and POSIX compatibility library; it includes <threads.h>, if it exists, and defines any missing functionality.
int mtx_lock(mtx_t *mtx)
Blocks until it locks the mutex at mtx.
io_ctx_t * io_ctx_create(void)
Creates a new I/O context.
pthread_mutex_t mtx_t
A complete object type that holds an identifier for a mutex.
const struct io_svc_vtbl * vptr
A pointer to the virtual table for the I/O service.
This header file is part of the utilities library; it contains the native and platform-independent er...
void io_ctx_shutdown(io_ctx_t *ctx)
Shuts down all registered I/O services in reverse order of registration.
void dllist_push_back(struct dllist *list, struct dlnode *node)
Pushes a node to the back of a doubly-linked list.
int get_errc(void)
Returns the last (thread-specific) native error code set by a system call or library function...
int errno2c(int errnum)
Transforms a standard C error number to a native error code.
void io_ctx_insert(io_ctx_t *ctx, struct io_svc *svc)
Registers an I/O service with an I/O context.
int io_ctx_notify_fork(io_ctx_t *ctx, enum io_fork_event e)
Notifies all registered I/O services of the specified fork event.
A node in a doubly-linked list.
#define structof(ptr, type, member)
Obtains the address of a structure from the address of one of its members.
The virtual table of an I/O service.
struct dlnode * prev
A pointer to the previous node in the list.
This header file is part of the C11 and POSIX compatibility library; it includes <stdlib.h> and defines any missing functionality.
void dllist_init(struct dllist *list)
Initializes a doubly-linked list.
struct dlnode * dllist_first(const struct dllist *list)
Returns a pointer to the first node in a doubly-linked list.
This is the internal header file of the I/O library.
This is the public header file of the utilities library.
void dllist_remove(struct dllist *list, struct dlnode *node)
Removes a node from a doubly-linked list.
int mtx_init(mtx_t *mtx, int type)
Creates a mutex object with properties indicated by type, which must have one of the four values: ...
The event generated before the fork.