Re: clockspeed and AIX 5.1 w/gcc

Malte Tancred <[email protected]> Mon, 19 Aug 2002 22:50:46 +0200
Newsgroups gmane.comp.lib.libtai
Message-ID <[email protected]>
On monday, august 19, 2002, at 06:43 , John Peacock wrote:
> I would like to get clockspeed running on an AIX box but am having 
> problems getting clockspeed.c to compile.  After noodling about, it 
> appears that this is the root cause of my problems:
>
> bash-2.05a# ./compile tryrdtsc.c
> tryrdtsc.c: In function `main':
> tryrdtsc.c:11: inconsistent operand constraints in an `asm'
> tryrdtsc.c:12: inconsistent operand constraints in an `asm'
>
> As I understand it, this is to determine if the machine has an 
> unadjusted hardware clock, but the code itself isn't even compiling.
>
> A) Has anyone sucessfully compiled clockspeed under AIX (with xlc or 
> gcc)?

Nope, not me.

> b) Does anyone recognize this error and how to fix it?

 From what you describe I think I had a similar problem but on Mac OS X. I
found a system call on Mac OS X that resembles the Solaris gethrtime and
stuck with that.

So far clockspeed seem to do it's job on our local time server:

   [chipotle:~] malte% uptime
   10:45PM  up 17 days, 10:59, 1 user, load averages: 0.17, 0.03, 0.00
   [chipotle:~] malte% sntpclock 130.235.20.3 | clockview
   before: 2002-08-19 22:45:37.911690000000000000
   after:  2002-08-19 22:45:37.912733180603027343

Perhaps AIX has something similar to gethrtime.

You can find my patch here at http://oops.se/~malte/software.html , if
it's of any help.

Cheerio,
Malte