[PATCH] configure: introduce --{enable, disable}-syscall-clock

Alan Coopersmith alan.coopersmith at oracle.com
Mon Mar 29 11:02:30 PDT 2010


Tiago Vignatti wrote:
> Some systems might not want to link against rt and pthread libraries simply to
> implement monotonic clock, inside GetTimeInMillis(). For those, use a direct
> syscall instead.
> 
> This patch keeps the new syscall version disabled by default - therefore not
> changing the original behaviour of the xserver build.
> 
> The main concern was regarding some eventual performance degradation when not
> going through optimized code in C library, or because syscall is varargs
> based.

That's actually my secondary concern - my primary concern is that on most
non-Linux systems, the system libraries are the public, stable, supported,
documented interface, and syscall() is a private implementation detail to
those, which applications are strongly discouraged from calling directly.

There's also the question of whether you know the right syscall arguments
to use for every single kernel that Xorg runs on - though it appears
SYS_clock_gettime is common to at least Linux & Solaris, I haven't checked
any of the BSD's, Cygwin, or MacOS X.   (Perhaps wrapping a #ifdef
SYS_clock_gettime around the #define after you've included syscall.h would
provide a little more safety there.)

I don't object to having it as a special case for embedded systems which
really need to avoid the small linker overhead, but don't want to make
Xorg less portable, stable and debuggable on general-purpose OS'es.

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list