obj-m := kproc.o
all:
+ make -C user
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules
clean:
+ make -C user
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) clean
\ No newline at end of file
unsigned int uid;
if(likely(in_task())){
uid = from_kuid(&init_user_ns, current_uid());
- snprintf(buf, KPROC_BUFF_LEN, "kproc: ctx: process: uid: %u: pid: %d\n", uid, task_pid_nr(current));
+ snprintf(buf, KPROC_BUFF_LEN, "kproc: ctx: process: uid: %u: pid: %d", uid, task_pid_nr(current));
} else {
- snprintf(buf, KPROC_BUFF_LEN, "kproc: ctx: interrupt\n");
+ snprintf(buf, KPROC_BUFF_LEN, "kproc: ctx: interrupt");
}
}
all:
- gcc -g -o user.out user.c -lpthread
\ No newline at end of file
+ gcc -g -o user.out user.c -lpthread
+clean:
+ rm -rf *.out *.o
\ No newline at end of file