1 /*imp1.h*/
2 #ifndef __IMP1_H__
3 #define __IMP1_H__
4
5 #define IMP1_OPS_BASIC 128
6 #define IMP1_SET IMP1_OPS_BASIC
7 #define IMP1_GET IMP1_OPS_BASIC
8 #define IMP1_MAX IMP1_OPS_BASIC+1
9
10 #endif
~
四 编译后运行结果:
内核打印:[541380.295993] umsg: a message from userspace
[541390.819256] umsg: a message from userspace
[541392.515414] umsg: a message from userspace
[541393.374753] umsg: a message from userspace
[541393.967123] umsg: a message from userspace
应用程序打印:
/imp1$ sudo ./imp1_u
kmsg: a message from kernel