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;
Item | Description |
---|---|
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.
The fp_getf kernel service can be called from the process environment only.
Item | Description |
---|---|
0 | Indicates a successful operation. |
EBADF | Indicates that either the file descriptor is invalid or not currently used in the process. |