xref: /netbsd-src/lib/libc/compat/time/compat_difftime.c (revision f943330f9141c047ce0282e7783e2daa2fc9031e)
1*f943330fSchristos /*	$NetBSD: compat_difftime.c,v 1.2 2009/01/11 03:46:25 christos Exp $	*/
2*f943330fSchristos /*-
3*f943330fSchristos  * Copyright (c) 2008 The NetBSD Foundation, Inc.
4*f943330fSchristos  * All rights reserved.
5*f943330fSchristos  *
6*f943330fSchristos  * This code is derived from software contributed to The NetBSD Foundation
7*f943330fSchristos  * by Christos Zoulas.
8*f943330fSchristos  *
9*f943330fSchristos  * Redistribution and use in source and binary forms, with or without
10*f943330fSchristos  * modification, are permitted provided that the following conditions
11*f943330fSchristos  * are met:
12*f943330fSchristos  * 1. Redistributions of source code must retain the above copyright
13*f943330fSchristos  *    notice, this list of conditions and the following disclaimer.
14*f943330fSchristos  * 2. Redistributions in binary form must reproduce the above copyright
15*f943330fSchristos  *    notice, this list of conditions and the following disclaimer in the
16*f943330fSchristos  *    documentation and/or other materials provided with the distribution.
17*f943330fSchristos  * 3. All advertising materials mentioning features or use of this software
18*f943330fSchristos  *    must display the following acknowledgement:
19*f943330fSchristos  *        This product includes software developed by the NetBSD
20*f943330fSchristos  *        Foundation, Inc. and its contributors.
21*f943330fSchristos  * 4. Neither the name of The NetBSD Foundation nor the names of its
22*f943330fSchristos  *    contributors may be used to endorse or promote products derived
23*f943330fSchristos  *    from this software without specific prior written permission.
24*f943330fSchristos  *
25*f943330fSchristos  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26*f943330fSchristos  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27*f943330fSchristos  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28*f943330fSchristos  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29*f943330fSchristos  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30*f943330fSchristos  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31*f943330fSchristos  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32*f943330fSchristos  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33*f943330fSchristos  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34*f943330fSchristos  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35*f943330fSchristos  * POSSIBILITY OF SUCH DAMAGE.
36*f943330fSchristos  */
37*f943330fSchristos #include "namespace.h"
38*f943330fSchristos #include <sys/cdefs.h>
39*f943330fSchristos 
40*f943330fSchristos #define __LIBC12_SOURCE__
41*f943330fSchristos #include <time.h>
42*f943330fSchristos #include <sys/time.h>
43*f943330fSchristos #include <compat/include/time.h>
44*f943330fSchristos #include <compat/sys/time.h>
45*f943330fSchristos 
46*f943330fSchristos #ifdef __weak_alias
47*f943330fSchristos __weak_alias(difftime,_difftime)
48*f943330fSchristos #endif
49*f943330fSchristos 
50*f943330fSchristos #define timeval timeval50
51*f943330fSchristos #define timespec timespec50
52*f943330fSchristos #define	time_t	int32_t
53*f943330fSchristos 
54*f943330fSchristos #include "time/difftime.c"
55