Read

nn::hio::CTR::HostFile::Read Member Function

Syntax

#include <nn/hio.h>

s32 Read(
     void * buf,
     size_t size
);

Arguments

Name Description
in buf Pointer to the buffer where the data is read into.
in size Maximum number of bytes to read.

Return Values

Returns the actual number of bytes that were copied. If an error occurred, it returns -1.

Description

Reads the specified amount of data from a file into a buffer, and returns the size of data (in bytes) that were actually read.

Up to size bytes of data are read from the current file position and copied to the region at the address specified by buf.
Returns the number of bytes that were copied.

In the debugger environment, the portion in the read buffer after the returned position is undefined.
If there is a difference between the requested size and the read size, do not treat the values beyond the read size as if they were unmodified initialized values.

Revision History

2010/06/21
Added specification and note.
2010/06/14
Added description of arguments and behavior.
2010/03/31
Initial version.

CONFIDENTIAL