source: rtems/cpukit/libcsupport/src/__gettod.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 *  gettimeofday() - SVR4 and BSD4.3 extension required by Newlib
3 *
4 *  COPYRIGHT (c) 1989-2007.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
17
18#if defined(RTEMS_NEWLIB)
19#include <sys/time.h>
20#include <errno.h>
21#include <rtems.h>
22#include <rtems/seterr.h>
23
24#if defined(RTEMS_NEWLIB) && !defined(HAVE_GETTIMEOFDAY)
25/*
26 *  NOTE:  The solaris gettimeofday does not have a second parameter.
27 */
28int gettimeofday(
29  struct timeval  *tp,
30  void * __tz __attribute__((unused))
31)
32{
33  /* struct timezone* tzp = (struct timezone*) __tz; */
34  if ( !tp )
35    rtems_set_errno_and_return_minus_one( EFAULT );
36
37  /*
38   *  POSIX does not seem to allow for not having a TOD so we just
39   *  grab the time of day.
40   */
41  _TOD_Get_timeval( tp );
42
43  /*
44   *  Timezone information ignored by the OS proper.   Per email
45   *  with Eric Norum, this is how GNU/Linux, Solaris, and MacOS X
46   *  do it.  This puts us in good company.
47   */
48
49  return 0;
50}
51#endif
52
53#if defined(RTEMS_NEWLIB) && !defined(HAVE__GETTIMEOFDAY_R)
54
55#include <sys/reent.h>
56
57/*
58 *  "Reentrant" version
59 */
60int _gettimeofday_r(
61  struct _reent   *ignored_reentrancy_stuff __attribute__((unused)),
62  struct timeval  *tp,
63  struct timezone *tzp
64)
65{
66  return gettimeofday( tp, tzp );
67}
68#endif
69
70#if defined(RTEMS_NEWLIB) && !defined(HAVE__GETTIMEOFDAY)
71/*
72 *  "System call" version
73 */
74
75int _gettimeofday(
76  struct timeval  *tp,
77  struct timezone *tzp
78)
79{
80  return gettimeofday( tp, tzp );
81}
82#endif
83
84#endif /* defined(RTEMS_NEWLIB) */
Note: See TracBrowser for help on using the repository browser.