Warning: include(topsc.html): failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/implementing_who.html on line 13

Warning: include(topsc.html): failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/implementing_who.html on line 13

Warning: include(): Failed opening 'topsc.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eng123/public_html/sourcecode/c/unix/implementing_who.html on line 13

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)  
 


Warning: include(adsc.html): failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/implementing_who.html on line 31

Warning: include(adsc.html): failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/implementing_who.html on line 31

Warning: include(): Failed opening 'adsc.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eng123/public_html/sourcecode/c/unix/implementing_who.html on line 31

 
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