00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _XENO_POSIX_TIME_H
00020 #define _XENO_POSIX_TIME_H
00021
00022 #if defined(__KERNEL__) || defined(__XENO_SIM__)
00023
00024 #include <nucleus/xenomai.h>
00025
00026 #ifdef __KERNEL__
00027 #include <linux/time.h>
00028 #define DELAYTIMER_MAX UINT_MAX
00029 #endif
00030
00031 #ifdef __XENO_SIM__
00032 #include <posix_overrides.h>
00033 #endif
00034
00035 #ifndef TIMER_ABSTIME
00036 #define TIMER_ABSTIME 1
00037 #endif
00038
00039 #else
00040
00041 #include_next <time.h>
00042
00043
00044 #include_next <time.h>
00045
00046 #endif
00047
00048 #ifndef CLOCK_MONOTONIC
00049
00050 #define CLOCK_MONOTONIC 1
00051 #endif
00052
00053
00054
00055
00056
00057
00058 #define CLOCK_HOST_REALTIME 42
00059
00060 #if defined(__KERNEL__) || defined(__XENO_SIM__)
00061
00062 struct sigevent;
00063
00064 struct timespec;
00065
00066 #ifdef __cplusplus
00067 extern "C" {
00068 #endif
00069
00070 int clock_getres(clockid_t clock_id,
00071 struct timespec *res);
00072
00073 int clock_gettime(clockid_t clock_id,
00074 struct timespec *tp);
00075
00076 int clock_settime(clockid_t clock_id,
00077 const struct timespec *tp);
00078
00079 int clock_nanosleep(clockid_t clock_id,
00080 int flags,
00081 const struct timespec *rqtp,
00082 struct timespec *rmtp);
00083
00084 int nanosleep(const struct timespec *rqtp,
00085 struct timespec *rmtp);
00086
00087 int timer_create(clockid_t clockid,
00088 const struct sigevent *__restrict__ evp,
00089 timer_t *__restrict__ timerid);
00090
00091 int timer_delete(timer_t timerid);
00092
00093 int timer_settime(timer_t timerid,
00094 int flags,
00095 const struct itimerspec *__restrict__ value,
00096 struct itimerspec *__restrict__ ovalue);
00097
00098 int timer_gettime(timer_t timerid, struct itimerspec *value);
00099
00100 int timer_getoverrun(timer_t timerid);
00101
00102 #ifdef __cplusplus
00103 }
00104 #endif
00105
00106 #else
00107
00108 #ifdef __cplusplus
00109 extern "C" {
00110 #endif
00111
00112 int __real_clock_getres(clockid_t clock_id,
00113 struct timespec *tp);
00114
00115 int __real_clock_gettime(clockid_t clock_id,
00116 struct timespec *tp);
00117
00118 int __real_clock_settime(clockid_t clock_id,
00119 const struct timespec *tp);
00120
00121 int __real_clock_nanosleep(clockid_t clock_id,
00122 int flags,
00123 const struct timespec *rqtp,
00124 struct timespec *rmtp);
00125
00126 int __real_nanosleep(const struct timespec *rqtp,
00127 struct timespec *rmtp);
00128
00129 int __real_timer_create (clockid_t clockid,
00130 struct sigevent *evp,
00131 timer_t *timerid);
00132
00133 int __real_timer_delete (timer_t timerid);
00134
00135 int __real_timer_settime(timer_t timerid,
00136 int flags,
00137 const struct itimerspec *value,
00138 struct itimerspec *ovalue);
00139
00140 int __real_timer_gettime(timer_t timerid,
00141 struct itimerspec *value);
00142
00143 int __real_timer_getoverrun(timer_t timerid);
00144
00145 #ifdef __cplusplus
00146 }
00147 #endif
00148
00149 #endif
00150
00151 #endif