| Main index | Section 9 | Options |
#include <sys/param.h>
#include <sys/buf_ring.h>
The buf_ring_alloc() function is used to allocate a buf_ring ring buffer with count slots using malloc_type type and memory flags flags. The single consumer interface is protected by sc_lock.
The buf_ring_free() function is used to free a buf_ring. The user is responsible for freeing any enqueued items.
The buf_ring_enqueue() function is used to enqueue a buffer to a buf_ring.
The buf_ring_dequeue_mc() function is a multi-consumer safe way of dequeueing elements from a buf_ring.
The buf_ring_dequeue_sc() function is a single-consumer interface to dequeue elements - requiring the user to serialize accesses with a lock.
The buf_ring_count() function returns the number of elements in a buf_ring.
The buf_ring_empty() function returns TRUE if the buf_ring is empty, FALSE otherwise.
The buf_ring_full() function returns TRUE if no more items can be enqueued, FALSE otherwise.
The buf_ring_peek() function returns a pointer to the last element in the buf_ring if the buf_ring is not empty, NULL otherwise.
| BUF_RING (9) | September 27, 2012 |
| Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | Our grievance is not just against Unix itself, but against the cult of Unix zealots who defend and nurture it. They take the heat, disease, and pestilence as givens, and, as ancient shamans did, display their wounds, some self-inflicted, as proof of their power and wizardry. We aim, through bluntness and humor, to show them that they pray to a tin god, and that science, not religion, is the path to useful and friendly technology. | ” |
| — The Unix Haters' handbook | ||