STRUCT COMEDI_BUFINFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct comedi_bufinfo(9) ✨

okay bestie, buckle up πŸ’– this is a page from the Kernel API Manual (that's the manual name, slay) and it's all about one lil struct that lets you mess with buffer positions for a subdevice. it's giving "small but important" energy, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

like, here's the whole vibe of the struct, literally verbatim, don't touch:

struct comedi_bufinfo {
    unsigned int subdevice;
    unsigned int bytes_read;
    unsigned int buf_write_ptr;
    unsigned int buf_read_ptr;
    unsigned int buf_write_count;
    unsigned int buf_read_count;
    unsigned int bytes_written;
    unsigned int unused[4];
 };

🌸 Members 🌸

okay so every single field, let's go 🫢

  • subdevice β€” the subdevice index. which subdevice you're talking about, iykyk.
  • bytes_read β€” you use this to specify how much to advance the read position for an asynchronous command in the input ("read") direction. it's giving "move the read pointer this far" πŸ’…
  • buf_write_ptr β€” the current write position (index) within the buffer. where the writing is at, right now.
  • buf_read_ptr β€” the current read position (index) within the buffer. where the reading is at, right now.
  • buf_write_count β€” total amount written, modulo 2^32. yes, the modulo is real πŸ”₯
  • buf_read_count β€” total amount read, modulo 2^32. same energy, read edition.
  • bytes_written β€” you use this to specify how much to advance the write position for an asynchronous command in the output ("write") direction. the write-side twin of bytes_read ✨
  • unused β€” reserved for future use. it's literally just sitting there, main character energy, waiting for its moment 🌈

πŸ’œ Description πŸ’œ

so this whole struct is used with the COMEDI_BUFINFO ioctl, and it does two iconic things:

  • optionally advance the current read or write position in an asynchronous acquisition data buffer (yes, optionally β€” you don't have to, it's chill)
  • get the current read and write positions in the buffer

that's it, that's the tea. two jobs, both ate. πŸ’…


πŸ¦‹ SEE ALSO πŸ¦‹

the kernel file is ./include/uapi/linux/comedi.h, and it's friends with literally everyone. here's the full squad, no skips:

  • enum comedi_subdevice_type(9)
  • enum comedi_io_direction(9)
  • enum configuration_ids(9)
  • enum comedi_digital_trig_op(9)
  • enum comedi_support_level(9)
  • enum comedi_counter_status_flags(9)
  • struct comedi_insn(9)
  • struct comedi_insnlist(9)
  • struct comedi_cmd(9)
  • struct comedi_chaninfo(9)
  • struct comedi_rangeinfo(9)
  • struct comedi_krange(9)
  • struct comedi_subdinfo(9)
  • struct comedi_devinfo(9)
  • struct comedi_devconfig(9)
  • struct comedi_bufconfig(9)

like, that's a whole group chat right there πŸ’€ but go read them, fr fr.


ngl bestie, the struct has unused[4] and it means it β€” reserved for future use, so don't go writing your own lore into it πŸ™ˆ

🌸 okay bye, this page lives in ./include/uapi/linux, dated October 2026, and it's struct comedi_bufinfo(9) β€” go forth and advance those buffer positions, you absolute icon πŸ‘‘πŸ’–

πŸ“¦ where this page comes from