COMEDI_GET_BUFFER_WR(3)
π NAME π
comedi_get_buffer_write_count β the streaming buffer write count, bestie β¨
We're in the Comedi reference corner of the manual, section 3 (that's the library-functions girlies π), and this page is all about one liiiittle function that tells you how much has been written into your streaming buffer. iykyk
πΈ SYNOPSIS πΈ
Okay so first you gotta bring in the header, obviously:
#include <comedilib.h>
and then the function herself, looking like this:
int comedi_get_buffer_write_count(comedi_t * device,
unsigned int subdevice,
unsigned int * write_count);
Three args, no notes. Slay. π
β¨ DESCRIPTION β¨
So comedi_get_buffer_write_count is the function you call on a subdevice that has a Comedi command in progress β like, the command has to already be running, that's the whole vibe check π¦ β and what it does is hand you back the number of bytes that have been written to the buffer, modulo UINT_MAX + 1.
And where does that number go? Straight into *write_count, that's where. Not me pointing at a pointer in the year of our lord π it just writes the value through the pointer you gave it, no cap.
fr fr though: the modulo thing is real. The count wraps around at UINT_MAX + 1, so don't be shocked when it goes back to the top. That's just the math doing its thing π
π«Ά RETURN VALUE π«Ά
- On success?
0is returned. Iconic. Ate and left no crumbs. β - On failure?
-1comes back. Sad girl hours, check your errno energy π
π AUTHORS π
The literal main characters who made this happen, in order:
- David Schleef <ds@schleef.org> β Author.
- Frank Mori Hess <fmhess@users.sourceforge.net> β Author.
- Herman Bruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be> β Author.
- Bernd Porr <tech@linux-usb-daq.co.uk> β Author.
- Ian Abbott <abbotti@mev.co.uk> β Author.
- Γric Piel <piel@delmic.com> β Author.
Six authors, six crowns ππππππ we love a collaborative moment.
π COPYRIGHT π
Copyright Β© 1998-2003 David Schleef Copyright Β© 2001-2003, 2005, 2008 Frank Mori Hess Copyright Β© 2002-2003 Herman Bruyninckx Copyright Β© 2012 Bernd Porr Copyright Β© 2012 Ian Abbott Copyright Β© 2012, 2015 Γric Piel
This document is part of Comedilib. In the context of this document, the term "source code" as defined by the license is interpreted as the XML source. (Yes bestie, the docs are literally source code here, we're being precise about it π)
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 2.1 of the License.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. (Translation: it's giving "as-is", no promises, read the license fr fr π)
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
No SEE ALSO section on this one, so if you were waiting for the crossover episode, it's not happening. This page is a solo act and honestly? She's thriving. π
And that's a wrap, bestie πΈ this page was served up by the Comedi manual, version-dated 03/20/2026, filed under COMEDI_GET_BUFFER_WR(3). Go forth and count your buffer bytes, you absolute legend π§β¨π
π¦ where this page comes from
- ubuntu resolute: libcomedi-dev 0.11.0+5-1.3build6 Β· LGPL-2.1-only
- ubuntu stonking: libcomedi-dev 0.11.0+5-1.3build6 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms