[CALUG] gettimeofday()

Jason C. Miller jason.c.miller at gmail.com
Sat Mar 28 23:47:26 EDT 2009


I did some digging on Google but, to be frank, I have no idea what to look
for.  All of the relevant buzzwords come up with completely unrelated
results.  That's where I'm hoping someone on here might be able to help.

I wrote a simple application that uses gettimeofday().  The code is below...

#include <stdio.h>
#include <sys/time.h>
int main()
  {
    struct timeval TV;
    struct timezone TZ;
    printf("%s\n", (gettimeofday( &TV, &TZ ))?"FAILURE":"SUCCESS" );
  } /* end main() */

Here's the wierdness.  Gettimeofday() is a system call.  The internet, man
page, and common knowledge all support that premise.  I have two linux
machines at home that I'm running this test program on.  The gettimeofday()
call shows up in the ltrace (understandably) of both machines, however, it
shows up in the strace of only one of them.

The machine that does NOT show it as a system call is running FC9
(2.6.27.7-53.fc9.x86_64 #1 SMP).

The machine that DOES show it as a system call is FC10
(2.6.27.19-170.2.35.fc10.i686 #1 SMP).

The only major difference I see is that one is a 64-bit kernel and the other
is 32-bit.

Any ideas?

                                                              ~j
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.unknownlamer.org/pipermail/calug/attachments/20090328/09e4c3b2/attachment.htm 


More information about the CALUG mailing list