[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <201001141743.o0EHhKUV023427@hs20-bc2-1.build.redhat.com>
Date: Thu, 14 Jan 2010 12:43:20 -0500
From: Ulrich Drepper <drepper@...hat.com>
To: a.p.zijlstra@...llo.nl, acme@...hat.com, eranian@...gle.com,
fweisbec@...il.com, linux-kernel@...r.kernel.org,
lizf@...fujitsu.com, mingo@...e.hu, paulus@...ba.org
Subject: perf: don't use obsolete getpagesize
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@...hat.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists