0

I wanted to know truncate() equivalent function for Linux Kernel Module. I want to selectively truncate data in a file in kernel module starting from an index and ending at another index. All suggestions are welcome.

Thanks.

user3367692
  • 11
  • 1
  • 3

1 Answers1

0

You would have go one level lower and use Virtual File System level functions. which will allow you to call truncate directly.

Here is an example for open/close, read/write in kernel space. You may use the equivalent vfs_trunc(...) method

But there are many discussion why you should NOT do that.

Community
  • 1
  • 1
hengsti
  • 310
  • 3
  • 11