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

fp_getf Kernel Service


Retrieves a pointer to a file structure.


#include <sys/types.h>
#include <sys/errno.h>

int fp_getf ( fd, fpp)
int fd;
struct file **fpp;


fd Specifies a file descriptor.
fpp Points to the location where the file pointer is to be returned.


A process calls the fp_getf kernel service when it has a file descriptor for an open file, but needs a file pointer to use other Logical File System services.

The fp_getf kernel service uses the file descriptor as an index into the process's open file table. From this table it extracts a pointer to the associated file structure.

As a side effect of the call to the fp_getf kernel service, the reference count on the file descriptor is incremented. This count must be decremented when the caller has completed its use of the returned file pointer. The file descriptor reference count is decremented by a call to the ufdrele kernel service.

Execution Environment

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

Return Values

0 Indicates a successful operation.
EBADF Indicates that either the file descriptor is invalid or not currently used in the process.

Implementation Specifics

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

Related Information

The ufdrele kernel service.

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

[ Previous | Next | Contents | Home | Search ]