[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

fp_read Kernel Service

Purpose

Performs a read on an open file with arguments passed.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
int fp_read (fp, buf, nbytes, ext, segflag, countp)
struct file *fp;
char *buf;
int nbytes;
int  ext;
int segflag;
int *countp;  

Parameters

fp Points to a file structure returned by the fp_open or fp_opendev kernel service.
buf Points to the buffer where data read from the file is to be stored.
nbytes Specifies the number of bytes to be read from the file into the buffer.
ext Specifies an extension argument required by some device drivers. Its content, form, and use are determined by the individual driver.
segflag Indicates in which part of memory the buffer specified by the buf parameter is located:
SYS_ADSPACE The buffer specified by the buf parameter is in kernel memory.
USER_ADSPACE The buffer specified by the buf parameter is in application memory.
countp Points to the location where the count of bytes actually read from the file is to be returned.

Description

The fp_read kernel service is an internal interface to the function provided by the read subroutine.

Execution Environment

The fp_read kernel service can be called from the process environment only.

Return Values

0 Indicates successful completion.

If an error occurs, one of the values from the /usr/include/sys/errno.h file is returned.

Implementation Specifics

The fp_read kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The read subroutine.

Logical File System Kernel Services in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]