Back to index

glibc  2.9
Classes | Defines | Functions | Variables
time.h File Reference
#include <features.h>
#include <stddef.h>
#include <bits/time.h>
#include <bits/types.h>

Go to the source code of this file.

Classes

struct  tm

Defines

#define _TIME_H   1
#define __need_size_t
#define __need_NULL
#define CLK_TCK   CLOCKS_PER_SEC
#define __clock_t_defined   1
#define __time_t_defined   1
#define __isleap(year)   ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))

Functions

__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD clock_t 
clock (void) __THROW
time_t time (time_t *__timer) __THROW
double difftime (time_t __time1, time_t __time0) __THROW __attribute__((__const__))
time_t mktime (struct tm *__tp) __THROW
size_t strftime (char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp) __THROW
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD struct
tm
gmtime (__const time_t *__timer) __THROW
struct tmlocaltime (__const time_t *__timer) __THROW
__END_NAMESPACE_STD
__BEGIN_NAMESPACE_STD char * 
asctime (__const struct tm *__tp) __THROW
char * ctime (__const time_t *__timer) __THROW

Variables

__BEGIN_NAMESPACE_STD typedef
__clock_t 
clock_t
__BEGIN_NAMESPACE_STD typedef
__time_t 
time_t
__END_NAMESPACE_STD char * __tzname [2]
int __daylight
long int __timezone

Class Documentation

struct tm

Definition at line 134 of file time.h.

Class Members
long int __tm_gmtoff
__const char * __tm_zone
int tm_hour
int tm_isdst
int tm_mday
int tm_min
int tm_mon
int tm_sec
int tm_wday
int tm_yday
int tm_year

Define Documentation

#define __clock_t_defined   1

Definition at line 55 of file time.h.

#define __isleap (   year)    ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))

Definition at line 303 of file time.h.

#define __need_NULL

Definition at line 38 of file time.h.

#define __need_size_t

Definition at line 37 of file time.h.

#define __time_t_defined   1

Definition at line 71 of file time.h.

#define _TIME_H   1

Definition at line 28 of file time.h.

#define CLK_TCK   CLOCKS_PER_SEC

Definition at line 48 of file time.h.


Function Documentation

Here is the caller graph for this function:

Definition at line 28 of file clock.c.

{
  struct task_basic_info bi;
  struct task_thread_times_info tti;
  mach_msg_type_number_t count;
  clock_t total;
  error_t err;

  count = TASK_BASIC_INFO_COUNT;
  err = __task_info (__mach_task_self (), TASK_BASIC_INFO,
                   (task_info_t) &bi, &count);
  if (err)
    return __hurd_fail (err);

  count = TASK_THREAD_TIMES_INFO_COUNT;
  err = __task_info (__mach_task_self (), TASK_THREAD_TIMES_INFO,
                   (task_info_t) &tti, &count);
  if (err)
    return __hurd_fail (err);

  total = bi.user_time.seconds * 1000000 + bi.user_time.microseconds;
  total += tti.user_time.seconds * 1000000 + tti.user_time.microseconds;
  total += bi.system_time.seconds * 1000000 + bi.system_time.microseconds;
  total += tti.system_time.seconds * 1000000 + tti.system_time.microseconds;

  return total;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* ctime ( __const time_t __timer)
double difftime ( time_t  __time1,
time_t  __time0 
) const

Here is the caller graph for this function:

struct tm* localtime ( __const time_t __timer) [read]

Here is the caller graph for this function:

time_t mktime ( struct tm __tp)

Definition at line 509 of file mktime.c.

{
#ifdef _LIBC
  /* POSIX.1 8.1.1 requires that whenever mktime() is called, the
     time zone names contained in the external variable `tzname' shall
     be set as if the tzset() function had been called.  */
  __tzset ();
#endif

  return __mktime_internal (tp, __localtime_r, &localtime_offset);
}

Here is the call graph for this function:

Here is the caller graph for this function:

size_t strftime ( char *__restrict  __s,
size_t  __maxsize,
__const char *__restrict  __format,
__const struct tm *__restrict  __tp 
)
time_t time ( time_t __timer)

Definition at line 27 of file time.c.

{
  struct timeval tv;
  time_t result;

  if (__gettimeofday (&tv, (struct timezone *) NULL))
    result = (time_t) -1;
  else
    result = (time_t) tv.tv_sec;

  if (t != NULL)
    *t = result;
  return result;
}

Variable Documentation

Definition at line 33 of file tzset.c.

Definition at line 34 of file tzset.c.

Definition at line 32 of file tzset.c.

Definition at line 61 of file time.h.

Definition at line 77 of file time.h.