xref: /freebsd/sys/sys/_timeval.h (revision 95ee2897)
1d9755695SMike Barcroft /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3c4e20cadSPedro F. Giffuni  *
4d9755695SMike Barcroft  * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
5d9755695SMike Barcroft  * All rights reserved.
6d9755695SMike Barcroft  *
7d9755695SMike Barcroft  * Redistribution and use in source and binary forms, with or without
8d9755695SMike Barcroft  * modification, are permitted provided that the following conditions
9d9755695SMike Barcroft  * are met:
10d9755695SMike Barcroft  * 1. Redistributions of source code must retain the above copyright
11d9755695SMike Barcroft  *    notice, this list of conditions and the following disclaimer.
12d9755695SMike Barcroft  * 2. Redistributions in binary form must reproduce the above copyright
13d9755695SMike Barcroft  *    notice, this list of conditions and the following disclaimer in the
14d9755695SMike Barcroft  *    documentation and/or other materials provided with the distribution.
15d9755695SMike Barcroft  *
16d9755695SMike Barcroft  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17d9755695SMike Barcroft  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18d9755695SMike Barcroft  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19d9755695SMike Barcroft  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20d9755695SMike Barcroft  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21d9755695SMike Barcroft  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22d9755695SMike Barcroft  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23d9755695SMike Barcroft  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24d9755695SMike Barcroft  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25d9755695SMike Barcroft  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26d9755695SMike Barcroft  * SUCH DAMAGE.
27d9755695SMike Barcroft  */
28d9755695SMike Barcroft 
29d9755695SMike Barcroft #ifndef _SYS__TIMEVAL_H_
30d9755695SMike Barcroft #define _SYS__TIMEVAL_H_
31d9755695SMike Barcroft 
32d9755695SMike Barcroft #include <sys/_types.h>
33d9755695SMike Barcroft 
34d9755695SMike Barcroft #ifndef _SUSECONDS_T_DECLARED
35d9755695SMike Barcroft typedef	__suseconds_t	suseconds_t;
36d9755695SMike Barcroft #define	_SUSECONDS_T_DECLARED
37d9755695SMike Barcroft #endif
38d9755695SMike Barcroft 
39d9755695SMike Barcroft #ifndef _TIME_T_DECLARED
40d9755695SMike Barcroft typedef	__time_t	time_t;
41d9755695SMike Barcroft #define	_TIME_T_DECLARED
42d9755695SMike Barcroft #endif
43d9755695SMike Barcroft 
44d9755695SMike Barcroft /*
45d9755695SMike Barcroft  * Structure returned by gettimeofday(2) system call, and used in other calls.
46d9755695SMike Barcroft  */
47d9755695SMike Barcroft struct timeval {
4809c00166STom Rhodes 	time_t		tv_sec;		/* seconds */
49d9755695SMike Barcroft 	suseconds_t	tv_usec;	/* and microseconds */
50d9755695SMike Barcroft };
51d9755695SMike Barcroft 
52d9755695SMike Barcroft #endif /* !_SYS__TIMEVAL_H_ */
53