linux-sysprog · beginner · ~15 min
Model the additive eventfd counter.
An eventfd accumulates the values written to it. Implement long eventfd_total(const long *adds, int n) returning the sum of n writes.
long eventfd_total(const long *adds, int n) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.