• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

include/posix/time.h

00001 /*
00002  * Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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 /* __KERNEL__ */
00030 
00031 #ifdef __XENO_SIM__
00032 #include <posix_overrides.h>
00033 #endif /* __XENO_SIM__ */
00034 
00035 #ifndef TIMER_ABSTIME
00036 #define TIMER_ABSTIME 1
00037 #endif
00038 
00039 #else /* !(__KERNEL__ || __XENO_SIM__) */
00040 
00041 #include_next <time.h>
00042 /* In case time.h is included for a side effect of an __need* macro, include it
00043    a second time to get all definitions. */
00044 #include_next <time.h>
00045 
00046 #endif /* !(__KERNEL__ || __XENO_SIM__) */
00047 
00048 #ifndef CLOCK_MONOTONIC
00049 /* Some archs do not implement this, but Xenomai always does. */
00050 #define CLOCK_MONOTONIC 1
00051 #endif /* CLOCK_MONOTONIC */
00052 
00053 /*
00054  * This number is supposed to not collide with any of the POSIX and
00055  * Linux kernel definitions so that no ambiguities arise when porting
00056  * applications in both directions.
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 /* !(__KERNEL__ || __XENO_SIM__) */
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 /* !(__KERNEL__ || __XENO_SIM__) */
00150 
00151 #endif /* _XENO_POSIX_TIME_H */

Generated on Wed Jan 23 2013 13:24:01 for Xenomai API by  doxygen 1.7.1