What is an simple example of copy_from_user

There is already a question about copy_from_user, but it is a little bit too advanced for me, I want to see simple example of using the copy_from_user method within kernel module, what is the simplest example of using that method?

#include <linux/uaccess.h>
#include <linux/module.h>
#include <linux/init.h>

MODULE_LICENSE("GPL");

static int __init initialization_function(void)
{
    // unsigned long result = copy_from_user(, , ,);
    return 0;
}

static void __exit cleanup_funcion(void)
{
    printk(KERN_INFO "Module: Bye, World.\n");
}

module_init(initialization_function);
module_exit(cleanup_funcion);

Leave a Comment