06.12.2012 Aufrufe

Technische Dokumentation zum Unix-Verbund ... - Dr. Hubert Feyrer

Technische Dokumentation zum Unix-Verbund ... - Dr. Hubert Feyrer

Technische Dokumentation zum Unix-Verbund ... - Dr. Hubert Feyrer

MEHR ANZEIGEN
WENIGER ANZEIGEN

Erfolgreiche ePaper selbst erstellen

Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.

B.28 Monitoring/nkill.c 317<br />

#include <br />

#include <br />

#include <br />

#include <br />

extern int wildmat(char *text, char *p);<br />

int main(int argc, char *argv[])<br />

{<br />

DIR *d;<br />

struct dirent *de;<br />

if(argcd_name,".")==0) continue;<br />

if(strcmp(de->d_name,"..")==0) continue;<br />

sprintf(pn,"/proc/%s",de->d_name);<br />

fd=open(pn,O_RDWR,&pi);<br />

if(fd==-1){<br />

fprintf(stderr,"open(\"%s\") failed: %s\n",pn,strerror(errno));<br />

continue;<br />

}<br />

/* Info ueber Prozess holen */<br />

rv=ioctl(fd,PIOCPSINFO,&pi);<br />

if(rv==-1){<br />

fprintf(stderr,"ioctl(PIOCPSINFO) failed: %s\n",strerror(errno));<br />

exit(1);<br />

}<br />

/* printf("uid=%05d pid=%05d nam=\"%s\"\n",<br />

pi.pr_uid,<br />

pi.pr_pid,<br />

pi.pr_fname); */<br />

{<br />

}<br />

int i;<br />

for(i=1;i

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!