简体   繁体   中英

Unknown symbol vfs_write (err -2) in kernel module in kernel 4.20

I'm trying to set a keylogger kernel module. all is fine except the final log file. I'm trying to, at the exit of the module, write a log in a /tmp/ file.

I'm using last kernel version 4.20. I'm trying to use vfs_write, but when compiling, it tells me

"WARNING : vfs_write [...] undefined !"

and when im trying to insert the module it says me

"Unknown symbol vfs_write (err -2)"

i am using this method to do the job: Read/write files within a Linux kernel module

Tell me What i did wrong or how to correctly open /to write a file x). Thanks for all.

Since version 4.14 of Linux kernel, vfs_write function is no longer exported for use in modules. Use kernel_write instead. It has the the same signature:

ssize_t kernel_write(struct file *file, const void *buf, size_t count,
            loff_t *pos)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM