lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 14 Jan 2010 15:48:23 -0200
From:	Arnaldo Carvalho de Melo <acme@...hat.com>
To:	Ulrich Drepper <drepper@...hat.com>
Cc:	a.p.zijlstra@...llo.nl, eranian@...gle.com, fweisbec@...il.com,
	linux-kernel@...r.kernel.org, lizf@...fujitsu.com, mingo@...e.hu,
	paulus@...ba.org
Subject: Re: perf: don't use obsolete getpagesize

Em Thu, Jan 14, 2010 at 12:43:20PM -0500, Ulrich Drepper escreveu:
> 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>

I have this already in my queue, thanks!

acme@...isc:~/git/linux-2.6-tip$ git show 578bb387c17692896a2a7c6b8bcba2c3945c33f4
commit 578bb387c17692896a2a7c6b8bcba2c3945c33f4
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
Date:   Thu Jan 14 14:10:35 2010 -0200

    perf tools: Convert getpagesize() uses to sysconf(_SC_GETPAGESIZE)
    
    Using the more portable and equivalent sysconf call.
    
    Reported-by: Aristeu Rozanski <aris@...hat.com>
    Cc: Aristeu Rozanski <aris@...hat.com>
    Cc: Frédéric Weisbecker <fweisbec@...il.com>
    Cc: Mike Galbraith <efault@....de>
    Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
    Cc: Paul Mackerras <paulus@...ba.org>
    Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 604e14f..1951e33 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -384,7 +384,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;
 
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
index 407fd65..5ea8973 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -515,7 +515,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();
acme@...isc:~/git/linux-2.6-tip$
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ