STRUCT COMEDI_BUFINFO(9)
β¨ 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 ofbytes_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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms