COMEDI_MARK_BUFFER_W(3)

✨ NAME ✨

comedi_mark_buffer_written β€” streaming buffer control, bestie πŸ’–

okay so this is a Comedi reference page, manual section 3, and we're talking about COMEDI_MARK_BUFFER_W(3). yes the whole name is shouting, she's dramatic, we love her πŸ‘‘


🌸 SYNOPSIS 🌸

#include <comedilib.h>

int comedi_mark_buffer_written(comedi_t * device,
                               unsigned int subdevice,
                               unsigned int num_bytes);

πŸ’… DESCRIPTION πŸ’…

so comedi_mark_buffer_written is the function you call on a subdevice that has a Comedi output command in progress. it's giving "hey bestie, I got more data for you" energy 🫢

real talk tho β€” you should only reach for this one if you're using an mmap mapping to write data into Comedi's buffer. if you're just calling write on the device file descriptor instead, don't bother, because Comedi already keeps track of how many bytes have been transferred via write calls all by itself. she's self-sufficient like that ✨

what this function actually does is tell Comedi: "the next num_bytes bytes sitting in the buffer are valid, go ahead and send them to the device." that's it, that's the whole vibe 🌈


πŸ”₯ RETURN VALUE πŸ”₯

  • on success ✨ β€” it returns the number of bytes successfully marked as written. and listen, that return value may be less than num_bytes, so like, don't just assume they're equal, check your numbers bestie 😭
  • on failure πŸ’€ β€” -1 is returned. rude but honest.

πŸŽ€ AUTHORS πŸŽ€

the icons who made this happen, periodt πŸ‘‘

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

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.

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.

ngl the license paragraph is a whole mood but you DO have to read it, it's not decorative πŸ’€

that's the page babes 🌸 this was Comedi, dated 03/20/2026, filed under COMEDI_MARK_BUFFER_W(3) β€” go mark some bytes written, you absolute main character πŸ¦‹πŸ’–

πŸ“¦ where this page comes from