On Tue, Mar 17, 2015 at 04:49:13PM -0700, Vinson Lee wrote:
> On Mon, Feb 16, 2015 at 12:50 PM, Yann Droneaud <ydrone...@opteya.com> wrote:
> >> +#ifdef __GLIBC_PREREQ
> >> +#if __GLIBC_PREREQ(2, 6)
> >> +#define HAVE_SCHED_GETCPU
> >> +#endif
> >> +#endif

> >> @@ -21,9 +27,13 @@ static int perf_flag_probe(void)
> >>       pid_t pid = -1;
> >>       char sbuf[STRERR_BUFSIZE];
> >>
> >> +#ifdef HAVE_SCHED_GETCPU
> >>       cpu = sched_getcpu();
> >>       if (cpu < 0)
> >>               cpu = 0;
> >> +#else
> >> +     cpu = 0;
> >> +#endif
> >>
> >>       while (1) {
> >>               /* check cloexec flag */

Would it not be much nicer to implement a sched_getcpu() stub that
returns -1 and sets errno to -ENOSYS or something?

That avoids the magic #ifdef mushroom.
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to