q_init3
Initialize and free queue
Usage
#include <librecast/q.h>
int q_init(q_t *q); int q_free(q_t *q);
Compile and link with -llibrecast.
Library
Librecast library (liblibrecast, -llibrecast)
Overview
The q_init() function initializes smolq queue q.
You will be surprised to learn that q_free() is the corresponding function to free a queue so initialized.
Return value
These functions return zero on success. On error, -1 is returned and errno is set to indicate the error.
Errors
q_init() may fail when initializing the queue semaphore. q_free() may fail when destroying the queue semaphore. See sem_init(3) and sem_destroy(3) for the relevant error codes.