[PATCH v2 -mmotm 3/4] cgroups: Add simple listener of cgroup events to documentation

Kirill A. Shutemov kirill at shutemov.name
Wed Feb 24 03:36:30 PST 2010


On Wed, Feb 24, 2010 at 5:30 AM, Li Zefan <lizf at cn.fujitsu.com> wrote:
>> +     ret = dprintf(event_control, "%d %d %s", efd, cfd, argv[2]);
>
> I found it won't return negative value for invalid input, though
> errno is set properly.

It looks like a glibc bug. I've file bug to glibc bugzilla:

http://sourceware.org/bugzilla/show_bug.cgi?id=11319

I'll fix cgroup_event_listener.c. Thanks!

> try:
> # ./cgroup_event_listner /cgroup/cgroup.procs abc
>
> while strace shows write() does return -1:
>
> # strace ./cgroup_event_listner /cgroup/cgroup.procs abc
> ...
> write(6, "7 5 abc"..., 7)               = -1 EINVAL (Invalid argument)
>
>> +     if (ret == -1) {
>> +             perror("Cannot write to cgroup.event_control");
>> +             goto out;
>> +     }
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo at kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont at kvack.org"> email at kvack.org </a>
>


More information about the Containers mailing list