Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/include/posix/time.h

    r7a08c70 r0dd4779  
    3737#define POSIX_TIME_H_
    3838
     39#ifndef __POSIX_DEF__
     40#define __POSIX_DEF__(x) x
     41#endif
     42
    3943#include "sys/types.h"
    4044
     
    4751#ifndef __locale_t_defined
    4852        #define __locale_t_defined
    49         typedef struct __posix_locale *locale_t;
     53        typedef struct __posix_locale *__POSIX_DEF__(locale_t);
     54        #ifndef LIBPOSIX_INTERNAL
     55                #define locale_t __POSIX_DEF__(locale_t)
     56        #endif
    5057#endif
    5158
    5259#ifndef POSIX_SIGNAL_H_
    53         struct sigevent;
     60        struct __POSIX_DEF__(sigevent);
     61        #ifndef LIBPOSIX_INTERNAL
     62                #define sigevent __POSIX_DEF__(sigevent)
     63        #endif
    5464#endif
    5565
    5666#undef CLOCK_REALTIME
    57 #define CLOCK_REALTIME ((clockid_t) 0)
     67#define CLOCK_REALTIME ((__POSIX_DEF__(clockid_t)) 0)
    5868
    59 struct timespec {
     69struct __POSIX_DEF__(timespec) {
    6070        time_t tv_sec; /* Seconds. */
    6171        long tv_nsec; /* Nanoseconds. */
    6272};
    6373
    64 struct itimerspec {
    65         struct timespec it_interval; /* Timer period. */
    66         struct timespec it_value; /* Timer expiration. */
     74struct __POSIX_DEF__(itimerspec) {
     75        struct __POSIX_DEF__(timespec) it_interval; /* Timer period. */
     76        struct __POSIX_DEF__(timespec) it_value; /* Timer expiration. */
    6777};
    6878
    69 typedef struct __posix_timer *timer_t;
     79typedef struct __posix_timer *__POSIX_DEF__(timer_t);
    7080
    7181/* Timezones */
    72 extern int daylight;
    73 extern long timezone;
    74 extern char *tzname[2];
    75 extern void tzset(void);
     82extern int __POSIX_DEF__(daylight);
     83extern long __POSIX_DEF__(timezone);
     84extern char *__POSIX_DEF__(tzname)[2];
     85extern void __POSIX_DEF__(tzset)(void);
    7686
    7787/* Time */
    78 extern time_t time(time_t *t);
     88extern time_t __POSIX_DEF__(time)(time_t *t);
    7989
    8090/* Broken-down Time */
    81 extern struct tm *gmtime_r(const time_t *__restrict__ timer,
     91extern struct tm *__POSIX_DEF__(gmtime_r)(const time_t *__restrict__ timer,
    8292    struct tm *__restrict__ result);
    83 extern struct tm *gmtime(const time_t *__restrict__ timep);
    84 extern struct tm *localtime_r(const time_t *__restrict__ timer,
     93extern struct tm *__POSIX_DEF__(gmtime)(const time_t *__restrict__ timep);
     94extern struct tm *__POSIX_DEF__(localtime_r)(const time_t *__restrict__ timer,
    8595    struct tm *__restrict__ result);
    86 extern struct tm *localtime(const time_t *__restrict__ timep);
     96extern struct tm *__POSIX_DEF__(localtime)(const time_t *__restrict__ timep);
    8797
    8898/* Formatting Calendar Time */
    89 extern char *asctime_r(const struct tm *__restrict__ timeptr,
     99extern char *__POSIX_DEF__(asctime_r)(const struct tm *__restrict__ timeptr,
    90100    char *__restrict__ buf);
    91 extern char *asctime(const struct tm *__restrict__ timeptr);
    92 extern char *ctime_r(const time_t *timer, char *buf);
    93 extern char *ctime(const time_t *timer);
     101extern char *__POSIX_DEF__(asctime)(const struct tm *__restrict__ timeptr);
     102extern char *__POSIX_DEF__(ctime_r)(const time_t *timer, char *buf);
     103extern char *__POSIX_DEF__(ctime)(const time_t *timer);
    94104extern time_t time(time_t *t);
    95105
    96106/* Clocks */
    97 extern int clock_getres(clockid_t clock_id,
    98     struct timespec *res);
    99 extern int clock_gettime(clockid_t clock_id,
    100     struct timespec *tp);
    101 extern int clock_settime(clockid_t clock_id,
    102     const struct timespec *tp);
    103 extern int clock_nanosleep(clockid_t clock_id, int flags,
    104     const struct timespec *rqtp, struct timespec *rmtp);
     107extern int __POSIX_DEF__(clock_getres)(__POSIX_DEF__(clockid_t) clock_id,
     108    struct __POSIX_DEF__(timespec) *res);
     109extern int __POSIX_DEF__(clock_gettime)(__POSIX_DEF__(clockid_t) clock_id,
     110    struct __POSIX_DEF__(timespec) *tp);
     111extern int __POSIX_DEF__(clock_settime)(__POSIX_DEF__(clockid_t) clock_id,
     112    const struct __POSIX_DEF__(timespec) *tp);
     113extern int __POSIX_DEF__(clock_nanosleep)(__POSIX_DEF__(clockid_t) clock_id, int flags,
     114    const struct __POSIX_DEF__(timespec) *rqtp, struct __POSIX_DEF__(timespec) *rmtp);
    105115
    106116/* CPU Time */
    107 extern clock_t clock(void);
     117extern __POSIX_DEF__(clock_t) __POSIX_DEF__(clock)(void);
    108118
    109119
Note: See TracChangeset for help on using the changeset viewer.