1: /*
2: * Copyright (c) 1986 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)time.h 1.3 (2.11BSD) 2000/4/21
7: */
8:
9: #ifndef _SYS_TIME_H_
10: #define _SYS_TIME_H_
11:
12: #include <sys/types.h>
13:
14: /*
15: * Structure returned by gettimeofday(2) system call,
16: * and used in other calls.
17: */
18: struct timeval {
19: long tv_sec; /* seconds */
20: long tv_usec; /* and microseconds */
21: };
22:
23: /*
24: * Structure defined by POSIX.4 to be like a timeval but with nanoseconds
25: * instead of microseconds. Silly on a PDP-11 but keeping the names the
26: * same makes life simpler than changing the names.
27: */
28: struct timespec {
29: time_t tv_sec; /* seconds */
30: long tv_nsec; /* and nanoseconds */
31: };
32:
33: struct timezone {
34: int tz_minuteswest; /* minutes west of Greenwich */
35: int tz_dsttime; /* type of dst correction */
36: };
37: #define DST_NONE 0 /* not on dst */
38: #define DST_USA 1 /* USA style dst */
39: #define DST_AUST 2 /* Australian style dst */
40: #define DST_WET 3 /* Western European dst */
41: #define DST_MET 4 /* Middle European dst */
42: #define DST_EET 5 /* Eastern European dst */
43: #define DST_CAN 6 /* Canada */
44:
45: /*
46: * Operations on timevals.
47: *
48: * NB: timercmp does not work for >= or <=.
49: */
50: #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
51: #define timercmp(tvp, uvp, cmp) \
52: ((tvp)->tv_sec cmp (uvp)->tv_sec || \
53: (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
54: #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
55:
56: /*
57: * Names of the interval timers, and structure
58: * defining a timer setting.
59: */
60: #define ITIMER_REAL 0
61: #define ITIMER_VIRTUAL 1
62: #define ITIMER_PROF 2
63:
64: struct k_itimerval {
65: long it_interval; /* timer interval */
66: long it_value; /* current value */
67: };
68:
69: struct itimerval {
70: struct timeval it_interval; /* timer interval */
71: struct timeval it_value; /* current value */
72: };
73:
74: #ifndef KERNEL
75: #include <time.h>
76: #endif
77:
78: /*
79: * Getkerninfo clock information structure
80: */
81: struct clockinfo {
82: int hz; /* clock frequency */
83: int tick; /* micro-seconds per hz tick */
84: int stathz; /* statistics clock frequency */
85: int profhz; /* profiling clock frequency */
86: };
87: #endif /* !_SYS_TIME_H_ */
Defined struct's
itimerval
defined in line
69; used 102 times
- in /usr/src/games/atc/graphics.c line
241(2),
326(2)
- in /usr/src/games/atc/input.c line
274(2)
- in /usr/src/games/atc/main.c line
21(2)
- in /usr/src/games/hunt/driver.c line
28(2)
- in /usr/src/lib/libc/gen/alarm.c line
19-20(4)
- in /usr/src/lib/libc/gen/ualarm.c line
25(2)
- in /usr/src/libexec/acctd/acctd.c line
423(2)
- in /usr/src/libexec/ctimed/ctimed.c line
52(2),
68(2),
92(2)
- in /usr/src/new/kermit5.188/cku2tm.c line
52(2),
68(2),
92(2)
- in /usr/src/new/nntp/server/netaux.c line
188(2)
- in /usr/src/sys/sys/kern_time.c line
160-162(4),
186(2),
193-196(6),
211(2),
268(2)
- in /usr/src/ucb/lock/lock.c line
62(2)
- in /usr/src/ucb/talk/invite.c line
35(2),
53(2)
- in /usr/src/ucb/talk/msgs.c line
27(2)
- in /usr/src/usr.bin/tip/aculib/courier.c line
328-329(4),
343-347(4)
- in /usr/src/usr.sbin/named/named/ns_init.c line
51(2),
283(2)
- in /usr/src/usr.sbin/named/named/ns_maint.c line
45(2),
104(2),
127-128(4),
200(2),
212(2),
229(2),
241(2),
328(2),
340(2),
350(2),
362(2)
- in /usr/src/usr.sbin/ntp/ntpd.c line
132-133(4),
381(2)
- in /usr/src/usr.sbin/syslogd/syslogd.c line
156(2)
- in /usr/src/usr.sbin/update/update.c line
48(2)
timeval
defined in line
18; used 470 times
- in line 70-71(4)
- in /usr/src/bin/ar/extract.c line
68(2)
- in /usr/src/bin/cp.c line
224(2)
- in /usr/src/bin/csh/sh.h line
66(2)
- in /usr/src/bin/csh/sh.proc.c line
660-661(4)
- in /usr/src/bin/csh/sh.time.c line
33(2),
79(2),
170-172(4),
179(2),
189(2)
- in /usr/src/bin/date.c line
35(2),
89(2),
250(2),
256(2)
- in /usr/src/bin/login/login.c line
92(2)
- in /usr/src/bin/mv.c line
181(2),
197(2)
- in /usr/src/bin/ping/ping.c line
146(2),
159(2),
266(2),
424(2),
464(2),
490-492(4),
529(2),
676(2),
967(2)
- in /usr/src/bin/rcp.c line
595(2)
- in /usr/src/bin/sysctl/sysctl.c line
374(4)
- in /usr/src/bin/tar.c line
1402(2)
- in /usr/src/bin/tcsh/sh.h line
341(2)
- in /usr/src/bin/tcsh/tc.os.h line
276(2)
- in /usr/src/bin/time.c line
20(2),
56(2)
- in /usr/src/games/battlestar/com6.c line
70(2)
- in /usr/src/games/hunt/driver.c line
79(2)
- in /usr/src/lib/libc/compat-4.1/ftime.c line
29(2)
- in /usr/src/lib/libc/compat-4.1/times.c line
35(2)
- in /usr/src/lib/libc/compat-4.1/utime.c line
21(2)
- in /usr/src/lib/libc/gen/ctime.c line
224(2)
- in /usr/src/lib/libc/gen/sleep.c line
30(2)
- in /usr/src/lib/libc/gen/time.c line
21(2)
- in /usr/src/lib/libc/gen/usleep.c line
26(2)
- in /usr/src/lib/libc/net/res_send.c line
60(2)
- in /usr/src/libexec/getty/get_date.c line
30(2)
- in /usr/src/libexec/getty/subr.c line
354(2)
- in /usr/src/libexec/identd/src/crypto.c line
91(2)
- in /usr/src/libexec/identd/src/identd.c line
276(2)
- in /usr/src/libexec/identd/src/proxy.c line
48(2)
- in /usr/src/libexec/rexecd/rexecd.c line
158(2)
- in /usr/src/libexec/rshd/rshd.c line
338(2)
- in /usr/src/libexec/talkd/announce.c line
110(2)
- in /usr/src/libexec/talkd/table.c line
32(2)
- in /usr/src/libexec/telnetd/telnetd.c line
358(2),
470(2)
- in /usr/src/local/mtools/mread.c line
243(2),
301(2)
- in /usr/src/new/PORT/B/src/bed/unix.c line
400(2)
- in /usr/src/new/jove/util.c line
821(2)
- in /usr/src/new/kermit5.188/ckufio.c line
1871(2)
- in /usr/src/new/kermit5.188/ckutio.c line
666-674(6)
- in /usr/src/new/nntp/server/serve.c line
78(2)
- in /usr/src/new/nntp/server/time.c line
174(2),
207(2)
- in /usr/src/new/nntp/xfer/nntpxfer.c line
401(2)
- in /usr/src/new/nntp/xmit/nntpxmit.c line
172(2),
291(2)
- in /usr/src/sbin/routed/tools/query.c line
39(2)
- in /usr/src/sbin/savecore/savecore.c line
235(2)
- in /usr/src/sys/h/kernel.h line
26-27(4)
- in /usr/src/sys/netinet/ip_icmp.c line
444-450(6)
- in /usr/src/sys/netinet/ip_input.c line
65-66(4),
79(2)
- in /usr/src/sys/netns/ns_input.c line
60(2)
- in /usr/src/sys/pdpif/if_de.c line
111-112(4),
372(2),
1188(2),
1208(2)
- in /usr/src/sys/sys/kern_clock.c line
337(2)
- in /usr/src/sys/sys/kern_sysctl.c line
252(2)
- in /usr/src/sys/sys/kern_time.c line
25-28(4),
52-60(6),
76(2),
116-119(6),
126(2),
153(2),
245(2),
310(2),
320(2),
330(2)
- in /usr/src/sys/sys/sys_generic.c line
293(2),
328(2)
- in /usr/src/sys/sys/ufs_fio.c line
125(2)
- in /usr/src/sys/sys/ufs_inode.c line
365(2)
- in /usr/src/sys/sys/ufs_syscalls2.c line
265-270(4)
- in /usr/src/ucb/Mail/aux.c line
322(2)
- in /usr/src/ucb/ftp/ftp.c line
431(2),
463(2),
709(2),
1182-1184(4),
1208(2)
- in /usr/src/ucb/lock/lock.c line
48-49(4),
61(2),
176(2)
- in /usr/src/ucb/rdist/docmd.c line
301(2)
- in /usr/src/ucb/rdist/server.c line
667(2)
- in /usr/src/ucb/talk/ctl_transact.c line
29(2)
- in /usr/src/ucb/talk/io.c line
38(2)
- in /usr/src/ucb/talk/msgs.c line
28-29(4)
- in /usr/src/ucb/telnet.c line
285(2),
784(2)
- in /usr/src/ucb/tftp/tftp.c line
379-380(4)
- in /usr/src/ucb/tn3270/tn3270.c line
532(2),
569(2),
1288(2),
1313-1318(4)
- in /usr/src/ucb/w.c line
67(2)
- in /usr/src/ucb/window/defs.h line
16(2)
- in /usr/src/ucb/window/lcmd2.c line
64(2),
102(2)
- in /usr/src/ucb/window/wwiomux.c line
33(2),
66(2)
- in /usr/src/usr.bin/at/at.c line
785(2)
- in /usr/src/usr.bin/at/atq.c line
335(2)
- in /usr/src/usr.bin/at/atrun.c line
110(2),
497(2)
- in /usr/src/usr.bin/uucp/condevs.c line
368(2)
- in /usr/src/usr.bin/uucp/pk1.c line
365(2)
- in /usr/src/usr.lib/libident/id_open.c line
42(2)
- in /usr/src/usr.lib/libident/id_parse.c line
42(2)
- in /usr/src/usr.lib/libident/id_query.c line
42(2)
- in /usr/src/usr.lib/libident/ident.c line
60(2),
70(2),
81(2),
103(2)
- in /usr/src/usr.sbin/cron/crontab.c line
577(2)
- in /usr/src/usr.sbin/inetd/inetd.c line
145(2),
317(2),
362(2),
1097(2)
- in /usr/src/usr.sbin/lpr/cmds.c line
842(2)
- in /usr/src/usr.sbin/named/named/db_dump.c line
140(2),
179(2)
- in /usr/src/usr.sbin/named/named/db_update.c line
27(2)
- in /usr/src/usr.sbin/named/named/ns_main.c line
110(2),
151(2),
1169(2)
- in /usr/src/usr.sbin/named/named/ns_maint.c line
276(2),
525(2)
- in /usr/src/usr.sbin/named/named/ns_resp.c line
141(2)
- in /usr/src/usr.sbin/named/tools/nslookup/send.c line
102(2)
- in /usr/src/usr.sbin/ntp/ntp.c line
137(2)
- in /usr/src/usr.sbin/ntp/ntp_adjust.c line
138-140(4),
238(2)
- in /usr/src/usr.sbin/ntp/ntp_proto.c line
174(2),
325-326(4),
359(2),
548(2)
- in /usr/src/usr.sbin/ntp/ntpd.c line
134(2),
389(2),
1343(2)
- in /usr/src/usr.sbin/ntp/ntpdc.c line
193(2)
- in /usr/src/usr.sbin/ntp/ntpsubs.c line
217(2),
230(2)
- in /usr/src/usr.sbin/ntp/read_local.c line
20-22(4)
- in /usr/src/usr.sbin/ntp/read_psti.c line
67(2),
150-154(8)
- in /usr/src/usr.sbin/ntp/test.c line
114(2)
- in /usr/src/usr.sbin/rwhod/rwhod.c line
325(2)
- in /usr/src/usr.sbin/syslogd/syslogd.c line
300(2)
- in /usr/src/usr.sbin/timed/acksend.c line
40(2)
- in /usr/src/usr.sbin/timed/candidate.c line
28(2)
- in /usr/src/usr.sbin/timed/cmds.c line
55(2),
124(2),
265(2)
- in /usr/src/usr.sbin/timed/correct.c line
27-29(4),
81-85(4),
106-112(6),
126(2)
- in /usr/src/usr.sbin/timed/master.c line
42-44(6),
282-286(4),
478(2),
541(2)
- in /usr/src/usr.sbin/timed/measure.c line
35(2),
46(2)
- in /usr/src/usr.sbin/timed/readmsg.c line
34(2),
57(2)
- in /usr/src/usr.sbin/timed/slave.c line
28-29(4),
542(2)
- in /usr/src/usr.sbin/timed/timed.c line
77(2),
211(2),
423(2),
588(2)
- in /usr/src/usr.sbin/traceroute/traceroute.c line
239(2),
467(2),
528(2),
578-580(4),
732(2)
timezone
defined in line
33; used 182 times
- in /usr/src/bin/csh/sh.proc.c line
63(2),
401(2)
- in /usr/src/bin/csh/sh.time.c line
21(2),
39(2)
- in /usr/src/bin/date.c line
51(2),
117(2),
138(2)
- in /usr/src/bin/login/login.c line
335(2)
- in /usr/src/bin/ping/ping.c line
425(2),
468(2)
- in /usr/src/games/battlestar/com6.c line
77(2)
- in /usr/src/lib/libc/compat-4.1/ftime.c line
30(2)
- in /usr/src/lib/libc/gen/ctime.c line
225(2)
- in /usr/src/lib/libc/gen/time.c line
23(2)
- in /usr/src/libexec/talkd/announce.c line
111(2)
- in /usr/src/libexec/talkd/table.c line
33(2)
- in /usr/src/local/mtools/mread.c line
244(2)
- in /usr/src/new/kermit5.188/ckutio.c line
667-675(6)
- in /usr/src/new/nntp/server/serve.c line
172(2),
258(2)
- in /usr/src/new/nntp/server/time.c line
175(2),
208(2)
- in /usr/src/new/nntp/xmit/nntpxmit.c line
173(2),
292(2)
- in /usr/src/sbin/savecore/savecore.c line
239(2)
- in /usr/src/sys/CURLY/param.c line
40(2)
- in /usr/src/sys/GENERIC/param.c line
40(2)
- in /usr/src/sys/QT/param.c line
40(2)
- in /usr/src/sys/conf/param.c line
40(2)
- in /usr/src/sys/h/kernel.h line
28(2)
- in /usr/src/sys/sys/kern_time.c line
26(2),
53-56(4)
- in /usr/src/ucb/ftp/ftp.c line
579(2),
651(2),
663(2),
880(2),
991(2),
1017(2)
- in /usr/src/ucb/lock/lock.c line
103(2),
178(2)
- in /usr/src/ucb/rdist/docmd.c line
302(2)
- in /usr/src/ucb/tftp/tftp.c line
381(2)
- in /usr/src/ucb/window/lcmd2.c line
72(2)
- in /usr/src/ucb/window/main.c line
101(2)
- in /usr/src/usr.bin/at/at.c line
786(2)
- in /usr/src/usr.bin/at/atq.c line
336(2)
- in /usr/src/usr.bin/at/atrun.c line
111(2),
498(2)
- in /usr/src/usr.sbin/inetd/inetd.c line
360-364(4),
1099(2)
- in /usr/src/usr.sbin/named/named/ns_main.c line
1171(2)
- in /usr/src/usr.sbin/ntp/ntp.c line
213(2),
246(2),
339(2),
345(2)
- in /usr/src/usr.sbin/ntp/ntp_adjust.c line
153(2),
165(2)
- in /usr/src/usr.sbin/ntp/ntp_proto.c line
189(2)
- in /usr/src/usr.sbin/ntp/ntpd.c line
334(2),
390(2)
- in /usr/src/usr.sbin/ntp/read_psti.c line
203(2)
- in /usr/src/usr.sbin/ntp/test.c line
117(2)
- in /usr/src/usr.sbin/timed/correct.c line
117-119(4)
- in /usr/src/usr.sbin/timed/master.c line
45(2),
73(2),
230(2),
295(2),
373(2),
521(2)
- in /usr/src/usr.sbin/timed/measure.c line
95(2),
113(2)
- in /usr/src/usr.sbin/timed/readmsg.c line
125(2),
135(2)
- in /usr/src/usr.sbin/timed/slave.c line
83(2),
95(2),
143(2),
184(2),
205-207(4),
213(2),
248(2),
255(2),
345(2)
- in /usr/src/usr.sbin/timed/timed.c line
202(2),
590(2)
- in /usr/src/usr.sbin/traceroute/traceroute.c line
248(2)
Defined macros
ITIMER_REAL
defined in line
60; used 40 times
- in /usr/src/games/atc/graphics.c line
257,
333
- in /usr/src/games/atc/input.c line
277,
313
- in /usr/src/games/atc/main.c line
139,
152,
165
- in /usr/src/games/hunt/driver.c line
287-292(2),
307
- in /usr/src/lib/libc/gen/alarm.c line
25
- in /usr/src/lib/libc/gen/ualarm.c line
33
- in /usr/src/libexec/acctd/acctd.c line
443
- in /usr/src/libexec/ctimed/ctimed.c line
68,
92
- in /usr/src/new/kermit5.188/cku2tm.c line
68,
92
- in /usr/src/new/nntp/server/netaux.c line
206
- in /usr/src/sys/sys/kern_time.c line
172,
215
- in /usr/src/ucb/lock/lock.c line
146
- in /usr/src/ucb/talk/invite.c line
53
- in /usr/src/ucb/talk/msgs.c line
44,
53
- in /usr/src/usr.bin/tip/aculib/courier.c line
334,
343-347(2)
- in /usr/src/usr.sbin/named/named/ns_init.c line
283
- in /usr/src/usr.sbin/named/named/ns_maint.c line
104,
199,
211,
228,
240,
327,
339,
349,
361
- in /usr/src/usr.sbin/ntp/ntpd.c line
381
- in /usr/src/usr.sbin/syslogd/syslogd.c line
228
- in /usr/src/usr.sbin/update/update.c line
59
Usage of this include