| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Done with a combination of regex'ing and banging my head against a wall.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
| |
This reverts commit d9d7af1a52d77ed0074ebb72f87678308296e74e.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Back when I put this together in 2015, ISO C11 was still reasonably new
and we couldn't require it just yet. Without ISO C11, there is no
"good" way (only bad hacks) to require a semicolon after a macro that
ends with a function definition. And if you added one anyway, you'd get
"spurious semicolon" warnings on some compilers...
With C11, `_Static_assert()` at the end of a macro will make it so that
the semicolon is properly required, consumed, and not warned about.
Consistently requiring semicolons after "file-level" macros matches
Linux kernel coding style and helps some editors against mis-syntax'ing
these macros.
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
|
|
|
|
|
| |
Implement new ringbuf function to do the proper socket reads without
the need of intermediary buffers.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
|
|
|
|
| |
Signed-off-by: Lou Berger <lberger@labn.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix rare failure caused when end pointer is at end of buffer memory
and a call to ringbuf_get() is made that reads all of the data in the
buffer; start pointer was advanced past end pointer, causing some
special handling to be skipped
* Fix ringbuf_peek() moving start pointer
* Fix use after free
* Remove extraneous assignment
* Update relevant tests
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
|
|
| |
Quick 'n easy way to copy the contents of one ringbuf to another.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Peek functionality for ring buffers and associated tests.
Also:
* Slight optimization to avoid 0-byte memcpy() by changing > to >=
* Add rv checks for some ringbuf_[put|get] calls that were missing them
in the test
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
Simple ring buffer implementation useful for fixed size FIFO queues.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|