gtpc2mjkC/C++ Language Support User's Guide

TPF_FSDD_SIZE-Get the Size of a File

This type of function is specified as part of the file systemdevice driver interface and is called by fcntl, fseek, and lseek to determine the size of an open special file.

Format

typedef long TPF_FSDD_SIZE(const TPF_FSDD_FILEDATA *filedata);

filedata
The address of the file data object returned by the TPF_FSDD_OPEN-type device driver function for the special file being sized.

Normal Return

The size of the special file, in bytes, or -1 if the size cannot be determined.

Error Return

Not applicable.

Programming Considerations

Examples

The following example is the size device driver interface function for the null file (/dev/null).

#include <c$spif.h> /* Device driver interface */
/**********************************************************************/
/* The null_size() function always returns a size of 0.               */
/**********************************************************************/
long null_size (const TPF_FSDD_FILEDATA *filedata)
{
    return 0;
}

Related Information