HPlogo HP-UX Reference > S

stime(2)

HP-UX 11i Version 2: December 2007 Update
» 

Technical documentation

 » Table of Contents

 » Index

NAME

stime() — set time and date

SYNOPSIS

#include <time.h>

int stime(const time_t *tp);

DESCRIPTION

The stime() system call sets the system time and date. tp points to the value of time as measured in seconds from 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).

Security Restrictions

Some or all of the actions associated with this system call require the SYSATTR privilege. Processes owned by the superuser will have this privilege. Processes owned by other users may have this privilege, depending on system configuration. See privileges(5) for more information about privileged access on systems that support fine-grained privileges.

RETURN VALUE

stime() returns the following values:

0

Successful completion.

-1

Failure. errno is set to indicate the error.

ERRORS

If stime() fails, errno is set to one of the following values.

EPERM

The calling process does not have the SYSATTR privilege.

EINVAL

The tp parameter points to an invalid (negative) time value.

EFAULT

The tp parameter is an invalid address.

STANDARDS CONFORMANCE

stime(): SVID2, SVID3, XPG2