> On June 25, 2012, 8:01 p.m., Benjamin Hindman wrote:
> > src/linux/cgroups.cpp, line 328
> > <https://reviews.apache.org/r/5395/diff/5/?file=112400#file112400line328>
> >
> > Older versions of glibc don't have eventfd. We need to wrap it if
> > necessary.
>
> Jie Yu wrote:
> Maybe we should add a check in the autotool to check the glibc version.
> But anyway, cgroups is not available in the kernel if eventfd is not.
>
> Therefore, I think there are two possibilities if eventfd is not
> available:
>
> 1) if you try to compile on that platform, compilation will not succeed
> 2) if you compile on other machine and try to run the binary on a machine
> without eventfd, the linking will fail
I'm not worried about not having eventfd, I'm worried about not having the
glibc wrapper for eventfd. You'll need to check if you have a version of glibc
that has that wrapper, and if not, include something like:
#define EFD_SEMAPHORE 1
#define EFD_CLOEXEC O_CLOEXEC
#define EFD_NONBLOCK O_NONBLOCK
int eventfd(unsigned int count, int flags)
{
return syscall(__NR_eventfd2, count, flags);
}
- Benjamin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/5395/#review8426
-----------------------------------------------------------
On June 27, 2012, 11:58 p.m., Jie Yu wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/5395/
> -----------------------------------------------------------
>
> (Updated June 27, 2012, 11:58 p.m.)
>
>
> Review request for mesos, Benjamin Hindman and Vinod Kone.
>
>
> Description
> -------
>
> In cgroups, sometimes you want to be notified if some certain events happen.
> For example, users may want to be notified when an out-of-memory event
> happens.
>
> This patch introduce a function called "listenEvent" which returns an
> instance of Future so that you can check the status of this future to see
> whether any event happens.
>
> This interface is general to all the events in cgroups.
>
>
> Diffs
> -----
>
> src/linux/cgroups.hpp PRE-CREATION
> src/linux/cgroups.cpp PRE-CREATION
> src/tests/cgroups_tests.cpp PRE-CREATION
>
> Diff: https://reviews.apache.org/r/5395/diff/
>
>
> Testing
> -------
>
> On Linux machines, make check.
>
>
> Thanks,
>
> Jie Yu
>
>