forked from R3x/How2Kernel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathassignment.c
40 lines (30 loc) · 902 Bytes
/
assignment.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Assignment module : Make changes to the assignment from lab1 using ioctl so that
* we can change the xor key
*/
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_ALERT */
#include <linux/init.h> /* Needed for the macros */
/* Include other required Header Files*/
static struct file_operations fops_struct = {
/* Your Code here */
};
static ssize_t procfile_write(struct file *file,const char *buffer, size_t count, loff_t *offset)
{
/* Your Code here */
}
static ssize_t procfile_read(struct file *file, char *buffer, size_t buffer_length, loff_t *offset)
{
/* Your Code here */
}
static int __init assignment_init(void)
{
/* Your Code here */
return 0;
}
static void __exit assignment_exit(void)
{
/* Your Code here */
}
module_init(assignment_init);
module_exit(assignment_exit);