summaryrefslogtreecommitdiff
path: root/nuttx/include/time.h
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-12-12 20:12:33 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-12-12 20:12:33 -0600
commit599e2d697b461695f74e595b439c0107c4dc112d (patch)
tree4cd92eab1184dbb5f8368922f55d7c17d2d06104 /nuttx/include/time.h
parentb47637171ea85e8fb1b97a3533d18267771faaa6 (diff)
downloadnuttx-599e2d697b461695f74e595b439c0107c4dc112d.tar.gz
nuttx-599e2d697b461695f74e595b439c0107c4dc112d.tar.bz2
nuttx-599e2d697b461695f74e595b439c0107c4dc112d.zip
Add nanosleep()
Diffstat (limited to 'nuttx/include/time.h')
-rw-r--r--nuttx/include/time.h45
1 files changed, 25 insertions, 20 deletions
diff --git a/nuttx/include/time.h b/nuttx/include/time.h
index 623f9afb2..f89b0ad29 100644
--- a/nuttx/include/time.h
+++ b/nuttx/include/time.h
@@ -1,7 +1,7 @@
/********************************************************************************
* include/time.h
*
- * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@
* Pre-processor Definitions
********************************************************************************/
-/* Clock tick of the system (frequency Hz).
+/* Clock tick of the system (frequency Hz).
*
* NOTE: This symbolic name CLK_TCK has been removed from the standard. It is
* replaced with CLOCKS_PER_SEC. Both are defined here.
@@ -100,7 +100,7 @@
#define localtime_r(c,r) gmtime_r(c,r)
/********************************************************************************
- * Global Type Declarations
+ * Public Types
********************************************************************************/
typedef uint32_t time_t; /* Holds time in seconds */
@@ -147,13 +147,13 @@ struct itimerspec
struct sigevent;
/********************************************************************************
- * Global Variables
+ * Public Data
********************************************************************************/
/* extern char *tznames[]; not supported */
/********************************************************************************
- * Global Function Prototypes
+ * Public Function Prototypes
********************************************************************************/
#undef EXTERN
@@ -164,25 +164,30 @@ extern "C" {
#define EXTERN extern
#endif
-EXTERN clock_t clock(void);
+clock_t clock(void);
-EXTERN int clock_settime(clockid_t clockid, const struct timespec *tp);
-EXTERN int clock_gettime(clockid_t clockid, struct timespec *tp);
-EXTERN int clock_getres(clockid_t clockid, struct timespec *res);
+int clock_settime(clockid_t clockid, FAR const struct timespec *tp);
+int clock_gettime(clockid_t clockid, FAR struct timespec *tp);
+int clock_getres(clockid_t clockid, FAR struct timespec *res);
-EXTERN time_t mktime(const struct tm *tp);
-EXTERN FAR struct tm *gmtime(FAR const time_t *timer);
-EXTERN FAR struct tm *gmtime_r(FAR const time_t *timer, FAR struct tm *result);
-EXTERN size_t strftime(char *s, size_t max, const char *format, const struct tm *tm);
+time_t mktime(FAR const struct tm *tp);
+FAR struct tm *gmtime(FAR const time_t *timer);
+FAR struct tm *gmtime_r(FAR const time_t *timer, FAR struct tm *result);
+size_t strftime(char *s, size_t max, FAR const char *format,
+ FAR const struct tm *tm);
-EXTERN time_t time(time_t *tloc);
+time_t time(FAR time_t *tloc);
-EXTERN int timer_create(clockid_t clockid, FAR struct sigevent *evp, FAR timer_t *timerid);
-EXTERN int timer_delete(timer_t timerid);
-EXTERN int timer_settime(timer_t timerid, int flags, FAR const struct itimerspec *value,
- FAR struct itimerspec *ovalue);
-EXTERN int timer_gettime(timer_t timerid, FAR struct itimerspec *value);
-EXTERN int timer_getoverrun(timer_t timerid);
+int timer_create(clockid_t clockid, FAR struct sigevent *evp,
+ FAR timer_t *timerid);
+int timer_delete(timer_t timerid);
+int timer_settime(timer_t timerid, int flags,
+ FAR const struct itimerspec *value,
+ FAR struct itimerspec *ovalue);
+int timer_gettime(timer_t timerid, FAR struct itimerspec *value);
+int timer_getoverrun(timer_t timerid);
+
+int nanosleep(FAR const struct timespec *rqtp, FAR struct timespec *rmtp);
#undef EXTERN
#if defined(__cplusplus)