aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/include/libc_private.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2012-06-22 07:13:30 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2012-06-22 07:13:30 +0000
commit869fd80fd449c2e3f8d7caa7ff4af71e904b5f08 (patch)
tree58a73d4c3dd528ab72afbea3d6243d4dd6c48c3e /lib/libc/include/libc_private.h
parentaea810386d8eb0602013a36a5d41822758972af6 (diff)
downloadsrc-869fd80fd449c2e3f8d7caa7ff4af71e904b5f08.tar.gz
src-869fd80fd449c2e3f8d7caa7ff4af71e904b5f08.zip
Use struct vdso_timehands data to implement fast gettimeofday(2) and
clock_gettime(2) functions if supported. The speedup seen in microbenchmarks is in range 4x-7x depending on the hardware. Only amd64 and i386 architectures are supported. Libc uses rdtsc and kernel data to calculate current time, if enabled by kernel. Hopefully, this code is going to migrate into vdso in some future. Discussed with: bde Reviewed by: jhb Tested by: flo MFC after: 1 month
Notes
Notes: svn path=/head/; revision=237434
Diffstat (limited to 'lib/libc/include/libc_private.h')
-rw-r--r--lib/libc/include/libc_private.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h
index 2182f4689719..faae02811d17 100644
--- a/lib/libc/include/libc_private.h
+++ b/lib/libc/include/libc_private.h
@@ -34,6 +34,7 @@
#ifndef _LIBC_PRIVATE_H_
#define _LIBC_PRIVATE_H_
+#include <sys/_types.h>
#include <sys/_pthreadtypes.h>
/*
@@ -245,6 +246,12 @@ extern void * __sys_freebsd6_mmap(void *, __size_t, int, int, int, int, __off_t)
/* Without back-compat translation */
extern int __sys_fcntl(int, int, ...);
+struct timespec;
+struct timeval;
+struct timezone;
+int __sys_gettimeofday(struct timeval *, struct timezone *);
+int __sys_clock_gettime(__clockid_t, struct timespec *ts);
+
/* execve() with PATH processing to implement posix_spawnp() */
int _execvpe(const char *, char * const *, char * const *);