>>> + qsort(tmp_list, n, sizeof(pid_t), &pid_compare);
>>
>> Is there are reason we qsort here? I though the kernel already sorted
>> the pids.. no?
>>
>
> I have not seen a case where it is not sorted, but as per
> documentation (Documentation/cgroups/cgroups.txt in the kernel)
>
> - cgroup.procs: list of tgids in the cgroup. This list is not
> guaranteed to be sorted or free of duplicate tgids, and userspace
> should sort/uniquify the list if this property is required.
> This is a read-only file, for now.
The code in cgroup.c (pidlist_array_load) does
/* now sort & (if procs) strip out duplicates */
sort(array, length, sizeof(pid_t), cmppid, NULL);
Balbir
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel