---
name: "muroar_write"
section: "3"
platform: "linux"
package: "libmuroar-dev"
version: "0.1.13-7"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/muroar_write"
---

# muroar\_write(3)

Write data to a stream in a portable way

## NAME

muroar\_write - Write data to a stream in a portable way

## SYNOPSIS

\#include \<muroar.h\>

ssize\_t muroar\_write  (muroar\_t fh, const void \* buf, size\_t len);

## DESCRIPTION

This function writes a block of data to a connected stream. It exists to have a portable way to send the data to the sound server that does not depend on the underlying operating system.

## PARAMETERS

- **fh**

  The stream file handle connected to the server. This must be opend using **[muroar\_stream(3)](/muroar_stream/3.md).**

- **buf**

  A pointer to the block of data that should be written.

- **len**

  The total length in byte of the data that should be written.

## RETURN VALUE

On success this call return the number of successful written bytes. On error, -1 is returned.

## NOTES

This function calls the underlying write function in a loop. If this returns less than the given length you should not re-try directly but wait at least some milisecunds.

## HISTORY

This function first appeared in muRoar version 0.1beta0.

## SEE ALSO

[**write**(2)](/write/2.md), [**muroar\_read**(3)](/muroar_read/3.md), [**muroar\_stream**(3)](/muroar_stream/3.md), [**muroar\_close**(3)](/muroar_close/3.md), [**RoarAudio**(7)](/RoarAudio/7.md).
