How can I tell the size of a file from a kernel module?
I know about vfs_llseek()
but I also need an equivalent function to ftell()
.
How can I tell the size of a file from a kernel module?
I know about vfs_llseek()
but I also need an equivalent function to ftell()
.
you could tyry to use vfs_llseek with a offset of 0 and whence of SEEK_END: it will go to the end and return the file position (which will be the end of the file)
Likewise for the current position, toy would use offset 0, SEEK_CUR, to return the current position.