summaryrefslogtreecommitdiffstats
path: root/connector/hello.c
diff options
context:
space:
mode:
Diffstat (limited to 'connector/hello.c')
-rw-r--r--connector/hello.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/connector/hello.c b/connector/hello.c
index 5240c15..c0fc633 100644
--- a/connector/hello.c
+++ b/connector/hello.c
@@ -8,11 +8,10 @@
8#include <signal.h> 8#include <signal.h>
9#include <linux/netlink.h> 9#include <linux/netlink.h>
10#include <linux/connector.h> 10#include <linux/connector.h>
11// #include <linux/cn_proc.h> 11#include <linux/cn_proc.h>
12#include <unistd.h> 12#include <unistd.h>
13#include <errno.h> 13#include <errno.h>
14#include <time.h> 14#include <time.h>
15#include "cn_proc.h"
16 15
17typedef struct __attribute__((aligned(NLMSG_ALIGNTO))) 16typedef struct __attribute__((aligned(NLMSG_ALIGNTO)))
18{ 17{
@@ -55,16 +54,16 @@ void Now()
55 54
56void printEvent() 55void printEvent()
57{ 56{
58 union unnamed *procEvent = &proc_msg.proc_ev.event_data; 57 // union unnamed *procEvent = &proc_msg.proc_ev.event_data;
59 switch (proc_msg.proc_ev.what) 58 switch (proc_msg.proc_ev.what)
60 { 59 {
61 case PROC_EVENT_FORK: 60 case PROC_EVENT_FORK:
62 Now(); 61 Now();
63 printf("Fork\t%6d\t%6d\t%6d\t%6d\n", procEvent->fork.parent_pid, procEvent->fork.parent_tgid, procEvent->fork.child_pid, procEvent->fork.child_tgid); 62 printf("Fork\t%6d\t%6d\t%6d\t%6d\n", proc_msg.proc_ev.event_data.fork.parent_pid, proc_msg.proc_ev.event_data.fork.parent_tgid, proc_msg.proc_ev.event_data.fork.child_pid, proc_msg.proc_ev.event_data.fork.child_tgid);
64 break; 63 break;
65 case PROC_EVENT_EXIT: 64 case PROC_EVENT_EXIT:
66 Now(); 65 Now();
67 printf("Exit\t%6d\t%6d\t%6d\t%6d\n", procEvent->exit.process_pid, procEvent->exit.process_tgid, procEvent->exit.exit_code, procEvent->exit.exit_signal); 66 printf("Exit\t%6d\t%6d\t%6d\t%6d\n", proc_msg.proc_ev.event_data.exit.process_pid, proc_msg.proc_ev.event_data.exit.process_tgid, proc_msg.proc_ev.event_data.exit.exit_code, proc_msg.proc_ev.event_data.exit.exit_signal);
68 break; 67 break;
69 case PROC_EVENT_EXEC: 68 case PROC_EVENT_EXEC:
70 default: 69 default: