[Lazarus] Process ID

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Thu Sep 13 17:55:15 CEST 2012


Kaj Mikkelsen wrote:
> Mark Morgan Lloyd wrote:
>>> Wrong. I've got a terminal session connected to a Solaris 10 system on my
> desk at the moment (because I'm trying to debug some LOM issues), and /proc
> is fine. However, it's worth remembering that non-Linux implementations tend
> to have less in the /proc tree than Linux, and that the Linux kernel
> developers are trying to move towards this model.
> 
> I maintain SunOS 4, Solaris 7,8 and 9.
> I am pretty sure /proc is very invalidated if it exists on the SunOS
> platform.
> On newer version it requires root privileges.

And I've just fired up a Solaris 10 system:

-bash-3.00$ uname -a
SunOS pye-dev-09 5.10 Generic_118833-17 sun4u sparc SUNW,Sun-Fire-280R 
Solaris
-bash-3.00$ ls -l /proc/$PPID/fd
total 0
c--------- 1 root    sys   13, 2 Sep 13 15:31 0
c--------- 1 root    sys   13, 2 Sep 13 15:31 1
c--------- 0 root    root  23, 1 Sep 13 15:38 10
p--------- 0 markMLl staff     0 Sep 13 15:33 11
c--------- 0 root    root  23, 1 Sep 13 15:38 12
c--------- 1 root    sys   13, 2 Sep 13 15:31 2
D--------- 1 root    root      0 Sep 13 15:30 3
s--------- 0 root    root      0 Sep 13 15:38 4
p--------- 0 markMLl staff     0 Sep 13 15:33 5
p--------- 0 markMLl staff     0 Sep 13 15:33 6
p--------- 0 markMLl staff     0 Sep 13 15:33 7
s--------- 0 root    root      0 Sep 13 15:33 8
c--------- 0 root    root  23, 1 Sep 13 15:38 9
-bash-3.00$ ls -l /proc/$PPID/path 2>/dev/null |grep a.out
lrwxrwxrwx 1 markMLl staff 0 Sep 13 15:33 a.out -> /usr/lib/ssh/sshd

Now you'll obviously need elevated privileges to look at properties of 
processes that you're not related to, but in other cases /proc (or 
directly comparable resources) is available- otherwise where do you 
think things like ps get their info?

So if you want to trump that I suggest getting hold of a copy of Solaris 
11 (or OpenIndiana or whatever it calls itself these days) and seeing 
what restrictions it adds (and then check out Lazarus on it and update 
any bits of http://wiki.lazarus.freepascal.org/Lazarus_on_Solaris that 
merit attention :-)

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list