[Lazarus] Process ID

Kaj Mikkelsen laz at vgdata.dk
Thu Sep 13 10:09:15 CEST 2012


Mark Morgan Lloyd Wrote:

>Please use the same quoting convention as the messages you are responding
to. The thread was already growing downwards, and adding a message to the
top is inappropriate.


>In my experience, using ps etc. is wrong since apart from the efficiency
aspect it makes several assumptions:

>i)   That the ps binary is available.

>ii)  That the command-line options you need are universally implemented.

>iii) That (at least in the case of Linux) the /proc filesystem is
available.

>I think that it's probably more portable to go straight to the values
available in /proc, if you can't read them then it's unlikely that ps would
show you much more.

I have never seen a Linux or Unix system that did not have ps installed.
Unless we are talking embedded systems or similar.
Unix systems (Solaris, AIX, SCO ) do not have the /proc file system, at
least it is not usable.
So living in a heterogeneous world I would prefer the ps, although I know
the options (aux in this case) varies from system to system.
Whatever works for the user and he/she finds easiest to use is the correct
way ;-)

/Kaj





More information about the Lazarus mailing list