Prev: perf: don't use obsolete getpagesize
Next: [PATCH] [mmotm v2] comment on swap notify locking constraints
From: Ulrich Drepper on 14 Jan 2010 12:50 perf uses the obsolete getpagesize function. Let's do better and use the correct POSIX interface to get the information: sysconf. Signed-off-by: Ulrich Drepper <drepper(a)redhat.com> diff --git a/tools/perf/util/data_map.c b/tools/perf/util/data_map.c index b557b83..cc8b396 100644 --- a/tools/perf/util/data_map.c +++ b/tools/perf/util/data_map.c @@ -153,7 +153,7 @@ int perf_session__process_events(struct perf_session *self, perf_event_ops__fill_defaults(ops); - page_size = getpagesize(); + page_size = sysconf(_SC_PAGESIZE); head = self->header.data_offset; self->sample_type = perf_header__sample_type(&self->header); diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c index cace355..948dc9e 100644 --- a/tools/perf/util/trace-event-info.c +++ b/tools/perf/util/trace-event-info.c @@ -533,7 +533,7 @@ int read_tracing_data(int fd, struct perf_event_attr *pattrs, int nb_events) write_or_die(buf, 1); /* save page_size */ - page_size = getpagesize(); + page_size = sysconf(_SC_PAGESIZE); write_or_die(&page_size, 4); read_header_files(); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |