1 /****************************************************************************
3 * GNAT COMPILER COMPONENTS *
7 * C Implementation File *
10 * Copyright (C) 1992-2001, Free Software Foundation, Inc. *
12 * GNAT is free software; you can redistribute it and/or modify it under *
13 * terms of the GNU General Public License as published by the Free Soft- *
14 * ware Foundation; either version 2, or (at your option) any later ver- *
15 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
16 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
17 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
18 * for more details. You should have received a copy of the GNU General *
19 * Public License distributed with GNAT; see file COPYING. If not, write *
20 * to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
21 * MA 02111-1307, USA. *
23 * As a special exception, if you link this file with other files to *
24 * produce an executable, this file does not by itself cause the resulting *
25 * executable to be covered by the GNU General Public License. This except- *
26 * ion does not however invalidate any other reasons why the executable *
27 * file might be covered by the GNU Public License. *
29 * GNAT was originally developed by the GNAT team at New York University. *
30 * It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). *
32 ****************************************************************************/
34 /* This file contains those routines named by Import pragmas in package */
35 /* GNAT.Calendar. It is used to to Duration to timeval convertion. */
36 /* These are simple wrappers function to abstarct the fact that the C */
37 /* struct timeval fields type are not normalized (they are generaly */
38 /* defined as int or long values). */
42 /* this is temporary code to avoid build failure under VMS */
45 __gnat_timeval_to_duration (void *t
, long *sec
, long *usec
)
50 __gnat_duration_to_timeval (long sec
, long usec
, void *t
)
56 #if defined (__vxworks)
57 #include <sys/times.h>
63 __gnat_timeval_to_duration (struct timeval
*t
, long *sec
, long *usec
)
65 *sec
= (long) t
->tv_sec
;
66 *usec
= (long) t
->tv_usec
;
70 __gnat_duration_to_timeval (long sec
, long usec
, struct timeval
*t
)
72 /* here we are doing implicit convertion from a long to the struct timeval
80 #ifdef __alpha_vxworks
82 #elif defined (__vxworks)
83 #include <types/vxTypesOld.h>
86 /* Return the value of the "time" C library function. We always return
87 a long and do it this way to avoid problems with not knowing
88 what time_t is on the target. */