gettimeofday() on Solaris

gettimeofday() on Solaris

Post by Christopher Miln » Wed, 14 Jun 1995 04:00:00



Hi,

I'm having problems with gettimeofday() on Solaris.

I guess I'm not sure if the function is even supported on Solaris.

sys/time.h defines a struct called timeval which is supposed to be used for
"gettimeofday() system call and other calls".

A search in answerbook finds the Solaris 2.3 transition guide
which says that the SunOS 4.1 call gettimeofday(2) is supported
by Solaris and is now gettimeofday(3C).

However, I can't find the function gettimeofday() prototyped in any header file.

Does anybody know:

a) if gettimeofday() is supported on Solaris
b) in which header file is it prototyped?  In which .a file is it implemented?
c) Or is it just a wraparound to another call?
d) If it isn't supported, is there any other way to get the
   system time accurate to the millisecond?

Thanks,

Chris Milner

 
 
 

gettimeofday() on Solaris

Post by Paul Egge » Wed, 14 Jun 1995 04:00:00



> Would someone tell me whether gettimeofday() has one or two
> parameter on Solaris 2.4?

In future Solaris releases, it will have two arguments;
the second argument is ignored (and should be 0).
This is a good way to write Solaris 2.4 code, too.

 
 
 

gettimeofday() on Solaris

Post by Vic Abe » Thu, 15 Jun 1995 04:00:00



>Hi,

>However, I can't find the function gettimeofday() prototyped in any header file.

The gettimeofday() prototype appears in <sys/time.h> in Solaris 2.4.
Apparently it was omitted from that header file in Solaris 2.3.