Lely core libraries
2.2.5
|
Go to the documentation of this file.
25 #ifndef LELY_IO2_CTX_H_
26 #define LELY_IO2_CTX_H_
57 #define IO_SVC_INIT(vptr) \
59 (vptr), 0, { NULL, NULL } \
82 void *io_ctx_alloc(
void);
83 void io_ctx_free(
void *ptr);
147 #endif // !LELY_IO2_CTX_H_
The virtual table of an I/O service.
@ IO_FORK_PARENT
The event generated after the fork in the parent process.
void io_ctx_insert(io_ctx_t *ctx, struct io_svc *svc)
Registers an I/O service with 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).
@ IO_FORK_PREPARE
The event generated before the fork.
void(* shutdown)(struct io_svc *svc)
A pointer to the function to be called by io_ctx_shutdown() (can be NULL).
io_ctx_t * io_ctx_create(void)
Creates a new I/O context.
void io_ctx_shutdown(io_ctx_t *ctx)
Shuts down all registered I/O services in reverse order of registration.
void io_ctx_destroy(io_ctx_t *ctx)
Destroys 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.
void io_ctx_remove(io_ctx_t *ctx, struct io_svc *svc)
Unregisters an I/O service with an I/O context.
A node in a doubly-linked list.
io_fork_event
The type of event generated by an I/O context before and after a process fork.
const struct io_svc_vtbl * vptr
A pointer to the virtual table for the I/O service.
@ IO_FORK_CHILD
The event generated after the fork in the child process.