Subject: Re: [Netatalk-devel] Logger

From: Carsten Neumann <[email-masked]>
Date: Sat, 24 Nov 2001 00:51:37 +0100

On Fri, 23 Nov 2001, Bob Rogers wrote:
> From: Simon Bazley <[email-masked]>
>    Date: Fri, 23 Nov 2001 12:38:17 +0000
> 
>    FYI linux ps gets the process name by loading the file /proc/#/stat
>    into a string buffer . . .

That wouldn't work on my linux box (kernel 2.2.x).
There is no dir /proc/# - did you mean /proc/self/stat?

On my system a process can find itself in /proc/self which is a symlink to /proc/<process-id> where
<process-id> is the id of the current process.

Now you can simply readlink(2) /proc/self/exe, and you have the name of your process.

> 
>    That will work for linux but like I say, what about Tru64, solaris et al.
> 
>    Simon

	Carsten

---

From: Simon Bazley <[email-masked]>
Date: Sat, 24 Nov 2001 02:34:15 +0000

By # I meant the process ID.  So for example for afpd running as pid 8534, it would be /proc/8534/stat

Simon

Carsten Neumann wrote:

> _______________________________________________
> Netatalk-devel mailing list
> [email-masked]
> https://lists.sourceforge.net/lists/listinfo/netatalk-devel