[Lazarus] Process ID
Marco van de Voort
marcov at stack.nl
Sat Sep 15 20:02:05 CEST 2012
On Fri, Sep 14, 2012 at 08:06:38PM +0000, Mark Morgan Lloyd wrote:
> >> In Linux, "everything" is (accessible as if it were) a file (or a
> >> directory). This is a _good_thing_.
> > Yeah. Everybody doing his own parsing of system textfiles is *such* a good
> > principle to build durable applications on *g*
> I think it was you who made the point earlier that doing this "the Linux
> way" takes multiple syscalls to enumerate the content of directories in
> the /proc or /sys tree. That's obviously valid criticism, but at the
> same time I'm not sure there's a better way to handle a complex
> structure with version- and system-specific elements (example:
> /proc/cpuinfo is grossly architecture-specific, even for basic things
> like counting the number of CPUs).
You miss the point. The /proc structure for the most doesn't even address
that since it often packs more than one value into one file.
In such it is worse than its direct competitor on Windows, the registry.
>but this would be difficult on
> account of /proc and /sys being an unstructured mix of stuff defined by
> the architecture and stuff changing every nSec.
That was exactly the point of my reply to a msg that tried to glorify /proc.
> I'm no registry fan, but at least it tries to keep things separate.
> I wonder whether POSIX has anything instructive to say about this sort
> of thing?
No. Afaik only the per process part of /proc is standarized, and even then
in an optional part.
Posix is rarely a solution into anything *nix. It is merely the rock bottom
most common denomitor.
More information about the Lazarus