On Sun, May 31, 2015 at 07:11:25PM +0530, Sai Prajeeth wrote: > I have done experiments and it seems that FreeBSD's libc function > clock_gettime() results in a system call when running on QEMU whereas on > hardware it does not. Does anybody know why? For those interested , you can > find the clock_gettime libc call in freebsd source here: > https://github.com/lattera/freebsd/blob/master/lib/libc/sys/clock_gettime.c
This is more of a FreeBSD kernel question than a QEMU question. I don't have time to dig into the FreeBSD sources but you should be able to find the answer there. Check out the FreeBSD kernel's vdso implementation. Linux has something similar, it's a library mapped into userspace processes that is provided by the kernel. It includes low-level utilities that depend on the specific kernel. Stefan
pgpybECa6RqHf.pgp
Description: PGP signature