COMEDI_GET_BUFFER_RE(3)

πŸ’– COMEDI_GET_BUFFER_RE(3) πŸ’–

okay bestie, welcome to the Comedi reference page for comedi_get_buffer_read_offset β€” yes that's the whole manual name situation, it's giving "the function name is longer than my attention span" but we're gonna get through it together 🫢


✨ NAME ✨

comedi_get_buffer_read_offset β€” streaming buffer read offset. that's it, that's the vibe. πŸ“


🌸 SYNOPSIS 🌸

#include <comedilib.h>

int comedi_get_buffer_read_offset(comedi_t * device,
                                  unsigned int subdevice);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” comedi_get_buffer_read_offset is the function you call on a subdevice that has a Comedi command in progress, and it hands you the current read position in the streaming buffer, expressed as an offset in bytes from the start of the buffer. slay.

and like, heads up: that position will wrap around to 0 once it hits the buffer size πŸ” so don't be out here doing math assuming it's always gonna grow. plot twist, but a predictable one.

also, this offset is only useful for memory mapped buffers. just so you know. no cap.

oh and one more thing β€” this function replaces comedi_get_buffer_offset and has the exact same functionality. so if you're still calling the old one, bestie… it's time. evolution era. 🧚


⭐ RETURN VALUE ⭐

  • on success πŸ’… β€” comedi_get_buffer_read_offset returns the current read position, as an offset in bytes from the start of the buffer.
  • on failure πŸ’€ β€” -1 is returned.

that's the whole thing. iconic and simple.


πŸ‘‘ AUTHORS πŸ‘‘

look at this roster, we stan every single one of them:

  • 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.

the legal corner, but make it cute (the words are exactly the same tho, do not play with legal bestie):

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.

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.

⚠️ okay this part is the serious one: 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. fr fr, don't skip this.

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! this one came from Comedi, dated 03/20/2026, and it lives in the manual as COMEDI_GET_BUFFER_RE(3) β€” go forth and read your buffer offsets responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from