]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/stime.2
Automated addition of parentheses by add_parens_for_own_funcs.sh
[thirdparty/man-pages.git] / man2 / stime.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
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@gmx.net>
29 .\"
30 .TH STIME 2 2004-05-27 "Linux 2.6.6" "Linux Programmer's Manual"
31 .SH NAME
32 stime \- set time
33 .SH SYNOPSIS
34 .BR "#define _SVID_SOURCE" " /* glibc2 needs this */"
35 .br
36 .B #include <time.h>
37 .sp
38 .BI "int stime(time_t *" t );
39 .SH DESCRIPTION
40 \fBstime\fP() sets the system's idea of the time and date. Time, pointed
41 to by \fIt\fP, is measured in seconds from 00:00:00 GMT January 1, 1970.
42 \fBstime()\fP may only be executed by the superuser.
43 .SH "RETURN VALUE"
44 On success, zero is returned. On error, \-1 is returned, and
45 .I errno
46 is set appropriately.
47 .SH ERRORS
48 .TP
49 .B EFAULT
50 Error in getting information from user space.
51 .TP
52 .B EPERM
53 The calling process has insufficient privilege.
54 Under Linux the
55 .B CAP_SYS_TIME
56 privilege is required.
57 .SH "CONFORMING TO"
58 SVr4, SVID, X/OPEN
59 .SH NOTES
60 Under glibc2,
61 .I <time.h>
62 only provides a prototype when
63 .B _SVID_SOURCE
64 is defined.
65 .SH "SEE ALSO"
66 .BR date (1),
67 .BR settimeofday (2),
68 .BR capabilities (7)