Start of man-pages-5.14: renaming .Announce and .lsm files
[man-pages.git] / man2 / stime.2
blob4aaa6c7759da8a25738e933e46be21c7ed18788d
1 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Modified by Michael Haardt <michael@moria.de>
26 .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 2001-03-16 by Andries Brouwer <aeb@cwi.nl>
28 .\" Modified 2004-05-27 by Michael Kerrisk <mtk.manpages@gmail.com>
29 .\"
30 .TH STIME 2 2021-03-22 "Linux" "Linux Programmer's Manual"
31 .SH NAME
32 stime \- set time
33 .SH SYNOPSIS
34 .nf
35 .B #include <time.h>
36 .PP
37 .BI "int stime(const time_t *" t );
38 .fi
39 .PP
40 .RS -4
41 Feature Test Macro Requirements for glibc (see
42 .BR feature_test_macros (7)):
43 .RE
44 .PP
45 .BR stime ():
46 .nf
47     Since glibc 2.19:
48         _DEFAULT_SOURCE
49     Glibc 2.19 and earlier:
50         _SVID_SOURCE
51 .fi
52 .SH DESCRIPTION
53 .BR NOTE :
54 This function is deprecated;
55 use
56 .BR clock_settime (2)
57 instead.
58 .PP
59 .BR stime ()
60 sets the system's idea of the time and date.
61 The time, pointed
62 to by \fIt\fP, is measured in seconds since the
63 Epoch, 1970-01-01 00:00:00 +0000 (UTC).
64 .BR stime ()
65 may be executed only by the superuser.
66 .SH RETURN VALUE
67 On success, zero is returned.
68 On error, \-1 is returned, and
69 .I errno
70 is set to indicate the error.
71 .SH ERRORS
72 .TP
73 .B EFAULT
74 Error in getting information from user space.
75 .TP
76 .B EPERM
77 The calling process has insufficient privilege.
78 Under Linux, the
79 .B CAP_SYS_TIME
80 privilege is required.
81 .SH CONFORMING TO
82 SVr4.
83 .SH NOTES
84 Starting with glibc 2.31,
85 this function is no longer available to newly linked applications
86 and is no longer declared in
87 .IR <time.h> .
88 .SH SEE ALSO
89 .BR date (1),
90 .BR settimeofday (2),
91 .BR capabilities (7)