gettimeofday man page on Solaris

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
Solaris logo
[printable version]

gettimeofday(3UCB) SunOS/BSD Compatibility Library Functionsgettimeofday(3UCB)

NAME
       gettimeofday, settimeofday - get or set the date and time

SYNOPSIS
       /usr/ucb/cc [ flag ... ] file ...
       #include <sys/time.h>

       int gettimeofday(tp, tzp)
       struct timeval *tzp;
       struct timezone *tzp;

       int settimeofday(tp, tzp)
       struct timeval *tzp;
       struct timezone *tzp;

DESCRIPTION
       The  system's notion of the current Greenwich time is obtained with the
       gettimeofday() call, and set with the settimeofday() call. The  current
       time  is expressed in elapsed seconds and microseconds since 00:00 GMT,
       January 1, 1970 (zero hour). The resolution  of	the  system  clock  is
       hardware	 dependent;  the time may be updated continuously, or in clock
       ticks.

	 long tv_sec;	   /* seconds since Jan. 1, 1970 */
	 long tv_usec;	     /* and microseconds */

       tp points to a timeval structure, which includes the following members:

       If tp is a NULL pointer, the current time information is	 not  returned
       or set.

       tzp is an obsolete pointer formerly used to get and set timezone infor‐
       mation. tzp is now ignored. Timezone information is now	handled	 using
       the TZ environment variable; see TIMEZONE(4).

       Only the privileged user may set the time of day.

RETURN VALUES
       A  −1  return  value indicates an error occurred; in this case an error
       code is stored in the global variable errno.

ERRORS
       The following error codes may be set in errno:

       EINVAL	 tp specifies an invalid time.

       EPERM	 A user other than the privileged user attempted  to  set  the
		 time.

SEE ALSO
       cc(1B), adjtime(2), ctime(3C), gettimeofday(3C), TIMEZONE(4)

NOTES
       Use of these interfaces should be restricted to only applications writ‐
       ten on BSD platforms.  Use of these interfaces with any of  the	system
       libraries or in multi-thread applications is unsupported.

       tzp is ignored in SunOS 5.X releases.

       tv_usec is always 0.

SunOS 5.10			  30 Oct 2007		    gettimeofday(3UCB)
[top]

List of man pages available for Solaris

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net