xref: /netbsd-src/lib/libcompat/4.1/ftime.3 (revision 3c70878e9a33bc15432458ef59075c3b28eebe66)
1.\"	$NetBSD: ftime.3,v 1.15 2010/03/22 21:55:39 joerg Exp $
2.\"
3.\" Copyright (c) 1980, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)ftime.3	8.1 (Berkeley) 6/4/93
31.\"
32.Dd June 4, 1993
33.Dt FTIME 3
34.Os
35.Sh NAME
36.Nm ftime
37.Nd get date and time
38.Sh LIBRARY
39.Lb libcompat
40.Sh SYNOPSIS
41.In sys/types.h
42.In sys/timeb.h
43.Ft int
44.Fn ftime "struct timeb *tp"
45.Sh DESCRIPTION
46.Bf -symbolic
47This interface is obsoleted by
48.Xr gettimeofday 2 .
49It is available from the compatibility library, libcompat.
50.Ef
51.Pp
52.Bf -symbolic
53Note: time zone information is no longer provided by this interface.
54See
55.Xr localtime 3
56for information on how to retrieve it.
57.Ef
58.Pp
59The
60.Fn ftime
61routine fills in a structure pointed to by its argument,
62as defined by
63.In sys/timeb.h :
64.Bd -literal -offset indent
65struct timeb {
66	time_t  time;
67	unsigned short millitm;
68	short   timezone;
69	short   dstflag;
70};
71.Ed
72.Pp
73The structure contains the time since the epoch in seconds,
74up to 1000 milliseconds of more-precise interval.
75The
76.Em timezone
77and
78.Em dstflag
79fields are provided for source compatibility, but are always zero.
80.Sh SEE ALSO
81.Xr gettimeofday 2 ,
82.Xr settimeofday 2 ,
83.Xr ctime 3 ,
84.Xr localtime 3 ,
85.Xr time 3
86.Sh HISTORY
87The
88.Fn ftime
89function appeared in
90.Bx 4.1 .
91