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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 16 Oct 2012 12:39:55 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	wilson self <wself00@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: VDSO gettimeofday() x86_64 linux 3.2

On Tue, Oct 16, 2012 at 12:33 PM, wilson self <wself00@...il.com> wrote:
> current_clocksource is tsc.
>
> the entire source of the test application:
> ---
> #include <stdio.h>
> #include <stdlib.h>
> #include <sys/time.h>
> #include <time.h>
>
> int main() {
>       struct timeval tim;
>       gettimeofday(&tim, NULL);
>       printf("%.6lf seconds\n", tim.tv_sec+tim.tv_usec/1000000.0);
> }
> ---
> nothing fancy going on here.
>
> thanks for the help.

There's lots of hidden fanciness.  What glibc version are you using
and how are you linking to glibc?  All but the newest glibc versions
use the old vsyscall when statically linked.  The newest versions use
the syscall instead.  If you're dynamically linking, then gettimeofday
should be okay even with fairly old glibc versions.

(FWIW, glibc maintainership has changed since this was decided.  Feel
free to bug the new maintainers if you care about statically-linked
performance.  The only other runtime library I know of that uses the
vdso or vsyscalls is Go, and the newest versions do the right thing.)

--Andy
--
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