gtpc2mjk | C/C++ Language Support User's Guide |
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);
Normal Return
The size of the special file, in bytes, or -1 if the size cannot be determined.
Error Return
Not applicable.
Programming Considerations
#include <c$spif.h> #include <errno.h> long device_type_size(const TPF_FSDD_FILEDATA *state_ptr) { errno = EINVAL; return -1; }
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