Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

   Computer Science / IT
   Electronics
   Electrical
   Mechanical
   Chemical
   Civil

   CAT / MBA

   GMAT / Foreign MBA
Latest Jobs

Engineering Jobs / Technical Jobs
Management Jobs

Sitemap
Terms of use

Displaying  Source Code(s)  
 

 
implementing who am i using system calls

--------------------------------------------------------------------------------

Description : This program is used to implement the who am i program using system calls(utmp struture)

#include<stdio.h>
#include<utmp.h>
int main()
{
char *s,*c;
struct utmp *u;
int i;
c=getlogin();
setutent();
u=getutent();
while(u!=NULL)
{
if(u->ut_type==7 && strcmp(u->ut_user,c)==0)
{
printf("%-12s",u->ut_user);
printf("%-9s",u->ut_line);
s=ctime(&u->ut_time);
for(i=4;i<16;i++)
printf("%c",s[i]);
printf("(%s",u->ut_host);
printf(")<BR>);
}
u=getutent();
}
}

 

 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG