Results 1 to 7 of 7
HI,
I want to write programe to get syslogd.pid , will you guide me for this ?
Thanks ,...
- 09-11-2009 #1Just Joined!
- Join Date
- Dec 2007
- Location
- Bangalore >> India
- Posts
- 28
- 09-11-2009 #2
- 09-12-2009 #3Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,117
Hi.
Also
will work on Linux and Solaris (of recent vintage) ... cheers, drlCode:pgrep syslogd
Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )
- 09-14-2009 #4Just Joined!
- Join Date
- Dec 2007
- Location
- Bangalore >> India
- Posts
- 28
- 09-14-2009 #5Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,117
Hi.
So you wish to do what code in ps does. For that, note:
which suggests you should look at man proc.Code:... ps works by reading the virtual files in /proc ... -- excerpt from man ps
Best wishes ... cheers, drlWelcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )
- 09-14-2009 #6Just Joined!
- Join Date
- Dec 2007
- Location
- Bangalore >> India
- Posts
- 28
No,
i wanted to write a programe for syslogd.pid , example,
like wise i want to write programe for syslogd.pidCode:#include<stdio.h> int main() { printf("Hello World\n"); return 0; } will print :- Hello World
Thanks,
Computer And Technologies
- 09-14-2009 #7Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Sorry, but I don't know if there is a specific function call that can get you information from /proc by name. Most people would pipe the output from the pgrep command to a temporary file and then use your C program to read the file and place the output into a variable.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
