Skip to content

Commit 2f5fd9a

Browse files
authored
Merge pull request #183 from linD026/master
example/syscall: Fix typo and unmatch types
2 parents 0decb83 + 6062f64 commit 2f5fd9a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/syscall.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ module_param(uid, int, 0644);
7575
* Another reason for this is that we can not get sys_open.
7676
* It is a static variable, so it is not exported.
7777
*/
78-
static asmlinkage int (*original_call)(const char *, int, int);
78+
static asmlinkage int (*original_call)(const char __user *, int, umode_t);
7979

8080
/* The function we will replace sys_open (the function called when you
8181
* call the open system call) with. To find the exact prototype, with
@@ -87,7 +87,8 @@ static asmlinkage int (*original_call)(const char *, int, int);
8787
* wreck havoc and require programs to be recompiled, since the system
8888
* calls are the interface between the kernel and the processes).
8989
*/
90-
static asmlinkage int our_sys_open(const char *filename, int flags, int mode)
90+
static asmlinkage int our_sys_open(const char __user *filename, int flags,
91+
umode_t mode)
9192
{
9293
int i = 0;
9394
char ch;
@@ -107,7 +108,7 @@ static asmlinkage int our_sys_open(const char *filename, int flags, int mode)
107108
return original_call(filename, flags, mode);
108109
}
109110

110-
static unsigned long **aquire_sys_call_table(void)
111+
static unsigned long **acquire_sys_call_table(void)
111112
{
112113
#ifdef HAVE_KSYS_CLOSE
113114
unsigned long int offset = PAGE_OFFSET;
@@ -185,7 +186,7 @@ static void disable_write_protection(void)
185186

186187
static int __init syscall_start(void)
187188
{
188-
if (!(sys_call_table = aquire_sys_call_table()))
189+
if (!(sys_call_table = acquire_sys_call_table()))
189190
return -1;
190191

191192
disable_write_protection();

0 commit comments

Comments
 (0)