1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Modified by Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de)
.\" Modified Fri Jul 23 21:26:27 1993 by Rik Faith (faith@cs.unc.edu)
.\" Modified 21 Aug 1994 by Michael Chastain (mec@shell.portal.com):
.\" Fixed necessary '#include' lines.
.\" Modified 15 Apr 1995 by Michael Chastain (mec@shell.portal.com):
.\" Added reference to adjtimex.
.\" Removed some nonsense lines pointed out by urs@isnogud.escape.de (Urs Thuermann),
.\" aeb, 950722.
.\"
.\"
.\" Traduction 10/10/1996 Christophe BLAESS (ccb@club-internet.fr)
.\" Mise a jour 23/01/97
.\" Mise a jour 8/04/97
.TH GETTIMEOFDAY 2 "8 Avril 1997" "Linux 2.0.21" "Manuel du programmeur Linux"
.SH NOM
gettimeofday, settimeofday \- Lire / ecrire l'heure actuelle.
.SH SYNOPSIS
.B #include <sys/time.h>
.br
.B #include <unistd.h>
.sp
.BI "int gettimeofday(struct timeval *" tv ", struct timezone *" tz );
.br
.BI "int settimeofday(const struct timeval *" tv
.BI ", const struct timezone *" tz );
.SH DESCRIPTION
.B gettimeofday
et
.B settimeofday
peuvent programmer l'heure ainsi que le fuseau horaire (timezone).
.I tv
est une structure
.B timeval
decrite dans /usr/include/sys/time.h :
.sp
.nf
struct timeval {
.in 22
int tv_sec; /* secondes */
int tv_usec; /* microsecondes */
};
.in 10
.fi
.PP
.sp
et
.I tz
est une structure
.B timezone
decrite egalement dans /usr/include/sys/time.h:
.sp
.nf
struct timezone {
.in 23
int tz_minuteswest;
/* minutes west of Greenwich */
int tz_dsttime;
/* type de changement horaire */
};
.in 10
.fi
.PP
Les changements horaires (Daylight saving - DST) sont
definis comme suit :
.PP
.B DST_NONE
/* Aucun */
.br
.B DST_USA
/* USA */
.br
.B DST_AUST
/* Australie */
.br
.B DST_WET
/* Europe occidentale */
.br
.B DST_MET
/* Europe centrale */
.br
.B DST_EET
/* Europe Orientale */
.br
.B DST_CAN
/* Canada */
.br
.B DST_GB
/* Grande Bretagne et Irlande */
.br
.B DST_RUM
/* Roumanie */
.br
.B DST_TUR
/* Turkie */
.br
.B DST_AUSTALT
/* Australie avec decallage en 1986 */
.PP
Les macros suivantes permettent de manipuler les
structures timeval :
.br
.nf
#define timerisset(tvp)\\
.ti 18
((tvp)->tv_sec || (tvp)->tv_usec)
indique si le timer est non-nul.
.sp
#define timercmp(tvp, uvp, cmp)\\
.in 18
((tvp)->tv_sec cmp (uvp)->tv_sec ||\\
(tvp)->tv_sec == (uvp)->tv_sec &&\\
(tvp)->tv_usec cmp (uvp)->tv_usec)
compare deux timers.
.sp
.in 10
#define timerclear(tvp)\\
.ti 18
((tvp)->tv_sec = (tvp)->tv_usec = 0)
efface un timer
.fi
.PP
Si
.I tv
ou
.I tz
est nulle, la structure correspondante n'est ni programmee ni retournee.
.PP
Seul le Super\-User peut appeler
.BR settimeofday .
.SH "VALEUR RENVOYEE"
.B getimeofday
et
.B settimeofday
renvoient 0 s'ils reussissent, ou -1 s'ils echouent, auquel
cas
.I errno
contient le code d'erreur.
.SH ERREURS
.TP
.B EPERM
.B settimeofday
est appele par quelqu'un d'autre que le Super\-User
.TP
.B EINVAL
le fuseau horaire est invalide.
.B EFAULT
.I tv
ou
.I tz
pointent en dehors de l'espace d'adressage autorise.
.SH "CONFORMITE"
SVr4, BSD 4.3
.SH "VOIR AUSSI"
.BR date "(1), " adjtimex "(2), " time "(2), " ctime "(3), " ftime "(3)"
|