Changeset 1ab8539 in mainline for uspace/lib/c/include/sys/time.h


Ignore:
Timestamp:
2014-11-14T19:16:23Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5042706
Parents:
9696b01
Message:

remove system.uptime sysinfo entry since it is redundant
cleanup the time handling routines

  • still more cleanup is needed here, the code is a wild combination of quasi-POSIX API (with all the brain-dead types, etc.) and HelenOS API
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/sys/time.h

    r9696b01 r1ab8539  
    4040#include <sys/types.h>
    4141
    42 #define DST_NONE 0
    43 #define ASCTIME_BUF_LEN 26
     42#define DST_NONE  0
     43#define ASCTIME_BUF_LEN  26
    4444
    4545typedef long time_t;
     
    5050
    5151struct tm {
    52         int tm_sec;         /* Seconds [0,60]. */
    53         int tm_min;         /* Minutes [0,59]. */
    54         int tm_hour;        /* Hour [0,23]. */
    55         int tm_mday;        /* Day of month [1,31]. */
    56         int tm_mon;         /* Month of year [0,11]. */
    57         int tm_year;        /* Years since 1900. */
    58         int tm_wday;        /* Day of week [0,6] (Sunday = 0). */
    59         int tm_yday;        /* Day of year [0,365]. */
    60         int tm_isdst;       /* Daylight Savings flag. */
     52        int tm_sec;    /* Seconds [0,60]. */
     53        int tm_min;    /* Minutes [0,59]. */
     54        int tm_hour;   /* Hour [0,23]. */
     55        int tm_mday;   /* Day of month [1,31]. */
     56        int tm_mon;    /* Month of year [0,11]. */
     57        int tm_year;   /* Years since 1900. */
     58        int tm_wday;   /* Day of week [0,6] (Sunday = 0). */
     59        int tm_yday;   /* Day of year [0,365]. */
     60        int tm_isdst;  /* Daylight Savings flag. */
    6161};
    6262
     
    7171};
    7272
    73 extern void tv_add(struct timeval *tv, suseconds_t usecs);
    74 extern suseconds_t tv_sub(struct timeval *tv1, struct timeval *tv2);
    75 extern int tv_gt(struct timeval *tv1, struct timeval *tv2);
    76 extern int tv_gteq(struct timeval *tv1, struct timeval *tv2);
    77 extern int gettimeofday(struct timeval *tv, struct timezone *tz);
    78 extern int getuptime(struct timeval *tv);
     73extern void tv_add(struct timeval *, suseconds_t);
     74extern suseconds_t tv_sub(struct timeval *, struct timeval *);
     75extern int tv_gt(struct timeval *, struct timeval *);
     76extern int tv_gteq(struct timeval *, struct timeval *);
     77extern void gettimeofday(struct timeval *, struct timezone *);
     78extern void getuptime(struct timeval *);
    7979
    8080extern void udelay(useconds_t);
    8181
    82 extern time_t mktime(struct tm *tm);
    83 extern int time_utc2tm(const time_t time, struct tm *result);
    84 extern int time_utc2str(const time_t time, char *buf);
    85 extern void time_tm2str(const struct tm *timeptr, char *buf);
    86 extern int time_local2tm(const time_t time, struct tm *result);
    87 extern int time_local2str(const time_t time, char *buf);
    88 extern double difftime(time_t time1, time_t time0);
    89 extern size_t strftime(char *restrict s, size_t maxsize,
    90     const char *restrict format, const struct tm *restrict tm);
     82extern time_t mktime(struct tm *);
     83extern int time_utc2tm(const time_t, struct tm *);
     84extern int time_utc2str(const time_t, char *);
     85extern void time_tm2str(const struct tm *, char *);
     86extern int time_local2tm(const time_t, struct tm *);
     87extern int time_local2str(const time_t, char *);
     88extern double difftime(time_t, time_t);
     89extern size_t strftime(char *restrict, size_t, const char *restrict,
     90    const struct tm *restrict);
    9191
    9292#endif
Note: See TracChangeset for help on using the changeset viewer.