Debian Codegraph @

upstream/debian-unstable/man2/stime.2

raw
1 .\" Copyright 1992, Drew Eckhardt <[email protected]>
2 .\" Copyright, the authors of the Linux man-pages project
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH stime 2 2026-02-08 "Linux man-pages 6.18"
7 .SH NAME
8 stime \- set time
9 .SH SYNOPSIS
10 .nf
11 .B #include <time.h>
12 .P
13 .BI "[[deprecated]] int stime(const time_t *" t );
14 .fi
15 .P
16 .RS -4
17 Feature Test Macro Requirements for glibc (see
18 .BR feature_test_macros (7)):
19 .RE
20 .P
21 .BR stime ():
22 .nf
23 Since glibc 2.19:
24 _DEFAULT_SOURCE
25 glibc 2.19 and earlier:
26 _SVID_SOURCE
27 .fi
28 .SH DESCRIPTION
29 .BR NOTE :
30 This function is deprecated;
31 use
32 .BR clock_settime (2)
33 instead.
34 .P
35 .BR stime ()
36 sets the system's idea of the time and date.
37 The time, pointed
38 to by
39 .IR t ,
40 is measured in seconds since the Epoch,
41 1970-01-01 00:00:00 +0000 (UTC).
42 .BR stime ()
43 may be executed only by the superuser.
44 .SH RETURN VALUE
45 On success, zero is returned.
46 On error, \-1 is returned, and
47 .I errno
48 is set to indicate the error.
49 .SH ERRORS
50 .TP
51 .B EFAULT
52 Error in getting information from user space.
53 .TP
54 .B EPERM
55 The calling process has insufficient privilege.
56 Under Linux, the
57 .B CAP_SYS_TIME
58 privilege is required.
59 .SH STANDARDS
60 None.
61 .SH HISTORY
62 SVr4.
63 .P
64 Starting with glibc 2.31,
65 this function is no longer available to newly linked applications
66 and is no longer declared in
67 .IR <time.h> .
68 .SH SEE ALSO
69 .BR date (1),
70 .BR settimeofday (2),
71 .BR capabilities (7)