---
name: "modbus_flush"
section: "3"
platform: "linux"
package: "libmodbus-dev"
version: "3.1.6-2.1"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/modbus_flush"
---

# modbus\_flush(3)

flush non-transmitted data

## NAME

modbus\_flush - flush non-transmitted data

## SYNOPSIS

**int modbus\_flush(modbus\_t \****ctx***);**

## DESCRIPTION

The **modbus\_flush()** function shall discard data received but not read to the socket or file descriptor associated to the context *ctx*.

## RETURN VALUE

The function shall return 0 or the number of flushed bytes if successful. Otherwise it shall return -1 and set errno.

## AUTHORS

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