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 0 back. slay. πŸ‘‘
  • on failure, you get -1 back. 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. 🌈

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