MODBUS_FLUSH(3)

πŸ“¦
version 3.1.6 Β· 3 versions
, in debian bookworm

πŸ’– MODBUS_FLUSH(3) πŸ’–

okay bestie, pull up a chair, we're reading a libmodbus Manual page together and honestly? it's a short one, which is so rare in this house. πŸŽ€ this is the tea on modbus_flush, and yes it's giving tiny-but-mighty.


✨ NAME ✨

modbus_flush β€” flush non-transmitted data 🚽✨


🌸 SYNOPSIS 🌸

int modbus_flush(modbus_t *ctx);

like. that's it. one line. iconic behavior honestly. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so the modbus_flush() function shall discard data received but not read to the socket or the file descriptor that's associated with the context ctx. 🧚

that's the whole vibe: stuff came in, nobody read it, and now it's gone. bye bestie. πŸ’…


πŸ”₯ RETURN VALUE πŸ”₯

so here's what you're getting back:

  • on success it shall return 0 β€” or the number of flushed bytes 🫢
  • otherwise it shall return -1 and set errno 😭
not me checking errno every single time. but like. do it. fr fr. πŸ‘€

πŸ‘‘ AUTHORS πŸ‘‘

the libmodbus documentation was written by Stéphane Raimbault <stephane.raimbault@gmail.com> 🌈


and that's the whole page, no cap. πŸ“ this little cutie came from libmodbus v3.1.6, dated 11/17/2025 β€” mwah, love that for us, periodt. πŸ’œ

πŸ“¦ where this page comes from