Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/settimeofday.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/settimeofday.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/settimeofday.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/settimeofday.html on line 8
Set the time and date
#include <sys/time.h>
int settimeofday( const struct timeval *when,
void *not_used );
- when
- A pointer to a timeval structure that specifies the
the time that you want to set.
The struct timeval contains the following members:
- time_t tv_sec — the number of
seconds since the start of the Unix Epoch.
- suseconds_t tv_usec — the number of
microseconds.
- not_used
- This pointer must be NULL or the behavior of
settimeofday() is unspecified.
This argument is provided only for backwards compatibility.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
This function sets the time and date to the values stored in the
structure pointed to by when.
0, or -1 if an error occurred
(errno is set).
- EFAULT
- An error occurred while accessing the when buffer.
- EPERM
- The calling process doesn't have superuser permissions.
Legacy Unix
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
The settimeofday() function is provided for compatibility with
existing Unix code.
You shouldn't use it in new code — use
clock_settime()
instead.
asctime(),
asctime_r(),
clock_gettime(),
clock_settime(),
ctime(),
ctime_r(),
difftime(),
gettimeofday(),
gmtime(),
gmtime_r(),
localtime(),
localtime_r(),
time()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/settimeofday.html on line 162
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/settimeofday.html on line 162