[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Obtain number of ports in proc and libps

From: Samuel Thibault
Subject: Re: [PATCH] Obtain number of ports in proc and libps
Date: Wed, 8 Sep 2010 12:01:12 +0200
User-agent: Mutt/1.5.12-2006-07-14

olafBuddenhagen@gmx.net, le Wed 08 Sep 2010 01:38:25 +0200, a écrit :
> On Tue, Sep 07, 2010 at 10:34:04AM +0200, Samuel Thibault wrote:
> > Mmm, portinfo <pid> | wc -l works too, is there really a need for a
> > new RPC, couldn't libps use the same RPC as portinfo does?
> No, for several reasons:
> - portinfo is slow.

I wasn't implying to _use_ portinfo, but to use the same mechanism, i.e.
mach_port_names actually, which is precisely what your implementation is

>   It makes no sense to fetch a list of all ports, if all we want to
>   know is the number of ports used.

That's what your implementation is doing :)

> - portinfo is privileged.

Err, for other processes, yes, but for one's own processes,no.

> The information available from proc through
>   libps OTOH can be accessed by every user.

Which might be questionable actually.  I know it's just the number of
ports, nothing more, but it seems odd to me to add an interface just for
this small part of information which you can fetch yourself for your own

> Also, as libps can handle all kinds of information provided by proc in a
> rather generic fashion, the implementation is in fact probably
> simpler...

Errr, adding an RPC, simpler than making the mach_port_names call
directly from libps?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]