COMEDI_GET_BUFFER_RE(3)
π COMEDI_GET_BUFFER_RE(3) π
okay bestie, so this is a page from the Comedi reference manual (that's the manual name, it's literally called Comedi), and we're about to get into comedi_get_buffer_read_count. it's giving short-king manpage but the lore is real. π¦
β¨ NAME β¨
comedi_get_buffer_read_count β bestie, it counts the reads in your streaming buffer ππ₯
πΈ SYNOPSIS πΈ
lowkey just include the header and call the thing, no cap:
#include <comedilib.h>
int comedi_get_buffer_read_count(comedi_t * device,
unsigned int subdevice,
unsigned int * read_count);
π DESCRIPTION π
so here's the vibe. comedi_get_buffer_read_count is the function you call on a subdevice that already has a Comedi command in progress β like, the stream is streaming, the data is data-ing π«Ά β and what it gives you back is the number of bytes that have been read from the buffer, taken modulo UINT_MAX + 1.
like, yes, it wraps. it's math. it's modulo UINT_MAX + 1 energy and we respect it. π
and where does that gorgeous number go? it gets stored in *read_count. that's the pointer you handed over, bestie, that's where the tea lives ββ¨
β RETURN VALUE β
- on success, you get
0back. slay. π - on failure, you get
-1back. not slay. π
π AUTHORS π
the icons who made this happen, fr fr:
- 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. π
π«Ά COPYRIGHT π«Ά
legal bit, but make it cute. here we go:
- 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. and in the context of this document specifically, the term "source code" as defined by the license is interpreted as the XML source. yes really, that's the rule. π
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. π (yes, that's the whole screaming-caps situation, it's not me being dramatic, that's what it says)
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.
and that's the whole page bestie, no crumbs left π
this lil drop came from the Comedi crew and it's dated 03/20/2026 β catch you on the next man page, mwah ππβ¨
π¦ 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