Back to index

glibc  2.9
Classes | Defines | Functions
timeb.h File Reference
#include <features.h>
#include <time.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  timeb


#define __need_time_t


int ftime (struct timeb *__timebuf)

Class Documentation

struct timeb

Definition at line 32 of file timeb.h.

Class Members
short int dstflag
unsigned short int millitm
time_t time
short int timezone

Define Documentation

#define __need_time_t

Definition at line 24 of file timeb.h.

Function Documentation

int ftime ( struct timeb __timebuf)

Definition at line 23 of file ftime.c.

  struct timeval tv;
  struct timezone tz;

  if (__gettimeofday (&tv, &tz) < 0)
    return -1;

  timebuf->time = tv.tv_sec;
  timebuf->millitm = (tv.tv_usec + 500) / 1000;
  if (timebuf->millitm == 1000)
      timebuf->millitm = 0;
  timebuf->timezone = tz.tz_minuteswest;
  timebuf->dstflag = tz.tz_dsttime;
  return 0;

Here is the call graph for this function: