---
name: "rfio_pwrite"
section: "3"
platform: "linux"
package: "libdpm-dev"
version: "1.10.0-2+b3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/rfio_pwrite"
---

# rfio\_pwrite(3)

writes to a file

## NAME

rfio\_pwrite - writes to a file

## SYNOPSIS

**#include \<sys/types.h\>**\
 **#include "rfio\_api.h"**

**int rfio\_pwrite (char \****ptr***, int** *size***, int** *items***, FILE \****fd***);**

## DESCRIPTION

**rfio\_pwrite** stores in a file the bytes starting at **ptr** , a pointer to the memory location in which resides the information, **items** times **size** bytes, using the descriptor **fd** generated by a previous **rfio\_popen**.

## RETURN VALUE

This routine returns -1 if the operation failed or the number of items actually writen. In case of failure,  **serrno** is set appropriately.

## ERRORS

- **EBADF**

  *fd* is a NULL pointer.

- **SENOSHOST**

  Host unknown.

- **SENOSSERV**

  Service unknown.

- **SETIMEDOUT**

  Timed out.

- **SEBADVERSION**

  Version ID mismatch.

- **SECONNDROP**

  Connection closed by remote end.

- **SECOMERR**

  Communication error.

- **SENORCODE**

  Host did not return error number.

## SEE ALSO

**[rfio\_popen(3)](/rfio_popen/3.md)**

## AUTHOR

**LCG Grid Deployment** Team
