---
name: "gfs_pio_read"
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_read"
---

# gfs\_pio\_read(3)

binary stream input

## NAME

gfs\_pio\_read - binary stream input

## SYNOPSIS

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

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

## DESCRIPTION

**gfs\_pio\_read()** attempts to read up to *size* bytes from the file referenced by *gf* into the buffer starting at *buffer*, and returns the number of bytes read to the address pointed by *np*. On end of file, the number of bytes read is zero.

## 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 *gf* is not a valid or is not open for reading.

**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\_open**(3)](/gfs_pio_open/3.md)
