On Sun, 12 Feb 2006 01:04:14 +0100, Martin v. Löwis <[EMAIL PROTECTED]> wrote: > Jorgen Grahn wrote: >> There might still be a problem for people doing things like this: netstat >> might use unstable or non-public APIs to find the things it lists. This is >> fine because it's typically your OS vendor who have to handle that (ship >> another netstat when the /proc or /sys file system layout changes, etc). > > Right. However, on Unix, there aren't really that much "non-public" > APIs. If you can figure out what the system call number is, and you > have /usr/include/sys, you can typically come up with a way to call > this API.
I was thinking mostly about /proc, /sys and related file systems. I have a feeling parts of them they change quite frequently under Linux, and of course under other Unices they may look completely different, or be absent. Like Mr Laird said elsewhere, the best thing might be to popen() netstat and parse its output. /Jorgen -- // Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu \X/ snipabacken.dyndns.org> R'lyeh wgah'nagl fhtagn! -- http://mail.python.org/mailman/listinfo/python-list