diff --git a/main.c b/main.c index 2b14afe..431faa0 100644 --- a/main.c +++ b/main.c @@ -5,6 +5,7 @@ #include #include #include +#include #define HOSTNAME "lalis" @@ -18,8 +19,18 @@ int isinarray( int pid, int array[], int n ) { return x; } + } return 0; +} + +int getutmp( int pid ) +{ + struct utmp * utmp; + while ( (utmp = getutent()) == NULL ) + { + printf("toto"); } - return 0; + endutent(); + } int null2space( char str[] ) @@ -92,6 +103,7 @@ int getprocinfo( int ppid, char cmdline[], char cmd[], char user[] ) int retval = 0; char * pos; + getutmp( pid ); while ( flag == 0) { r = getpids( pid, child_pid ); @@ -147,6 +159,7 @@ int main() { FILE *fh; FILE *fh1; + struct utmp * utmp; int n_ssh=10; int id; int pid;