[systemd-devel] [PATCH 2/3] sd-daemon: Use LISTEN_NAMES env when available

Krzysztof Opasiak k.opasiak at samsung.com
Tue May 19 01:37:07 PDT 2015



On 05/18/2015 11:05 PM, Filipe Brandenburger wrote:
> Hi,
>
> On Mon, May 18, 2015 at 7:26 AM, Krzysztof Opasiak
> <k.opasiak at samsung.com> wrote:
>> Matching between fds and list of expected paths is done in n^2
>
> I don't think that's the case, because you can just stat() all the
> names and fstat() all the fds, then sort both lists on inode numbers
> and then traverse both in order matching inode orders on each list, so
> it's actually O(n * log n).
>
> Not that it matters that much, I don't expect this scheme to be used
> for a very large number of fds/labels...
>

True but it is not possible using sd_is_*() functions, you have to 
implement this on your own;)

-- 
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics


More information about the systemd-devel mailing list