---
name: "gfs_pio_write"
section: "3"
platform: "linux"
package: "libgfarm-dev"
version: "2.7.20+dfsg-1.2+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/gfs_pio_write"
---

# gfs\_pio\_write(3)

write to a file

## NAME

gfs\_pio\_write - write to a file

## SYNOPSIS

```
#include <gfarm/gfarm.h>
```

**gfarm\_error\_t gfs\_pio\_write(GFS\_File** *gf***, const void \*** *buffer***, int** *size***, int \*** *np***);**

## DESCRIPTION

**gfs\_pio\_write()** writes up to *size* bytes to the file *gf* from the buffer starting at *buffer*. It returns the number of bytes written to the address pointed by *np*.

## RETURN VALUES

**GFARM\_ERR\_NO\_ERROR**

The function terminated successfully.

**GFARM\_ERR\_OPERATION\_NOT\_PERMITTED**

*gf* does not specify a regular file.

**GFARM\_ERR\_BAD\_FILE\_DESCRIPTOR**

The file descripter specified by *gfp* is not a valid or is not open for writing.

**GFARM\_ERR\_NO\_SPACE**

The file system node has no room to store data

**GFARM\_ERR\_NO\_FILE\_SYSTEM\_NODE**

There is no available file system node.

**GFARM\_ERR\_NO\_MEMORY**

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by **gfarm\_error\_string**(3).

## SEE ALSO

[**gfs\_pio\_create**(3)](/gfs_pio_create/3.md), [**gfs\_pio\_flush**(3)](/gfs_pio_flush/3.md), [**gfs\_pio\_open**(3)](/gfs_pio_open/3.md)
