Index: uspace/lib/posix/time.c
===================================================================
--- uspace/lib/posix/time.c	(revision 3f466c33de0de672c03cfdba923d8079460d710a)
+++ uspace/lib/posix/time.c	(revision 4cf8ca61cc35aeda46798f204c02a5e2e8af6c09)
@@ -31,5 +31,5 @@
  * @{
  */
-/** @file
+/** @file Time measurement support.
  */
 
@@ -63,4 +63,9 @@
 #define SECS_PER_DAY (SECS_PER_HOUR * HOURS_PER_DAY)
 
+/**
+ *
+ * @param year
+ * @return
+ */
 static bool _is_leap_year(time_t year)
 {
@@ -76,4 +81,10 @@
 }
 
+/**
+ *
+ * @param year
+ * @param mon
+ * @return
+ */
 static int _days_in_month(time_t year, time_t mon)
 {
@@ -92,4 +103,11 @@
 }
 
+/**
+ *
+ * @param year
+ * @param mon
+ * @param mday
+ * @return
+ */
 static int _day_of_year(time_t year, time_t mon, time_t mday)
 {
@@ -102,5 +120,10 @@
 }
 
-/* Integer division that rounds to negative infinity.
+/**
+ * Integer division that rounds to negative infinity.
+ *
+ * @param op1
+ * @param op2
+ * @return
  */
 static time_t _floor_div(time_t op1, time_t op2)
@@ -113,5 +136,10 @@
 }
 
-/* Modulo that rounds to negative infinity.
+/**
+ * Modulo that rounds to negative infinity.
+ *
+ * @param op1
+ * @param op2
+ * @return
  */
 static time_t _floor_mod(time_t op1, time_t op2)
@@ -132,4 +160,11 @@
 }
 
+/**
+ *
+ * @param year
+ * @param mon
+ * @param mday
+ * @return
+ */
 static time_t _days_since_epoch(time_t year, time_t mon, time_t mday)
 {
@@ -139,5 +174,10 @@
 }
 
-/* Assumes normalized broken-down time. */
+/**
+ * Assumes normalized broken-down time.
+ *
+ * @param tm
+ * @return
+ */
 static time_t _secs_since_epoch(const struct posix_tm *tm)
 {
@@ -147,4 +187,11 @@
 }
 
+/**
+ * 
+ * @param year
+ * @param mon
+ * @param mday
+ * @return
+ */
 static int _day_of_week(time_t year, time_t mon, time_t mday)
 {
@@ -165,4 +212,9 @@
 };
 
+/**
+ *
+ * @param ltm
+ * @param ptm
+ */
 static void _posix_to_long_tm(struct _long_tm *ltm, struct posix_tm *ptm)
 {
@@ -179,4 +231,9 @@
 }
 
+/**
+ *
+ * @param ptm
+ * @param ltm
+ */
 static void _long_to_posix_tm(struct posix_tm *ptm, struct _long_tm *ltm)
 {
@@ -196,4 +253,8 @@
 }
 
+/**
+ * 
+ * @param tm
+ */
 static void _normalize_time(struct _long_tm *tm)
 {
@@ -241,6 +302,10 @@
 }
 
-/* Which day the week-based year starts on relative to the first calendar day.
+/**
+ * Which day the week-based year starts on relative to the first calendar day.
  * E.g. if the year starts on December 31st, the return value is -1.
+ *
+ * @param year
+ * @return
  */
 static int _wbyear_offset(int year)
@@ -250,6 +315,10 @@
 }
 
-/* Returns week-based year of the specified time.
+/**
+ * Returns week-based year of the specified time.
  * Assumes normalized broken-down time.
+ *
+ * @param tm
+ * @return
  */
 static int _wbyear(const struct posix_tm *tm)
@@ -268,7 +337,8 @@
 }
 
-/** Week number of the year, assuming weeks start on sunday.
- *  The first Sunday of January is the first day of week 1;
- *  days in the new year before this are in week 0.
+/**
+ * Week number of the year, assuming weeks start on sunday.
+ * The first Sunday of January is the first day of week 1;
+ * days in the new year before this are in week 0.
  *
  * @param tm Normalized broken-down time.
@@ -281,9 +351,10 @@
 }
 
-/** Week number of the year, assuming weeks start on monday.
- *  If the week containing January 1st has four or more days in the new year,
- *  then it is considered week 1. Otherwise, it is the last week of the previous
- *  year, and the next week is week 1. Both January 4th and the first Thursday
- *  of January are always in week 1.
+/**
+ * Week number of the year, assuming weeks start on monday.
+ * If the week containing January 1st has four or more days in the new year,
+ * then it is considered week 1. Otherwise, it is the last week of the previous
+ * year, and the next week is week 1. Both January 4th and the first Thursday
+ * of January are always in week 1.
  *
  * @param tm Normalized broken-down time.
@@ -305,7 +376,8 @@
 }
 
-/** Week number of the year, assuming weeks start on monday.
- *  The first Monday of January is the first day of week 1;
- *  days in the new year before this are in week 0. 
+/**
+ * Week number of the year, assuming weeks start on monday.
+ * The first Monday of January is the first day of week 1;
+ * days in the new year before this are in week 0. 
  *
  * @param tm Normalized broken-down time.
@@ -324,4 +396,7 @@
 char *posix_tzname[2];
 
+/**
+ * 
+ */
 void posix_tzset(void)
 {
@@ -333,4 +408,10 @@
 }
 
+/**
+ * 
+ * @param time1
+ * @param time0
+ * @return
+ */
 double posix_difftime(time_t time1, time_t time0)
 {
@@ -338,9 +419,10 @@
 }
 
-/** This function first normalizes the provided broken-down time
- *  (moves all values to their proper bounds) and then tries to
- *  calculate the appropriate time_t representation.
- *
- * @param timeptr Broken-down time.
+/**
+ * This function first normalizes the provided broken-down time
+ * (moves all values to their proper bounds) and then tries to
+ * calculate the appropriate time_t representation.
+ *
+ * @param tm Broken-down time.
  * @return time_t representation of the time, undefined value on overflow
  */
@@ -358,4 +440,9 @@
 }
 
+/**
+ *
+ * @param timer
+ * @return
+ */
 struct posix_tm *posix_gmtime(const time_t *timer)
 {
@@ -364,4 +451,10 @@
 }
 
+/**
+ * 
+ * @param timer
+ * @param result
+ * @return
+ */
 struct posix_tm *posix_gmtime_r(const time_t *restrict timer,
     struct posix_tm *restrict result)
@@ -394,5 +487,5 @@
 /**
  *
- * @param timep
+ * @param timer
  * @return
  */
@@ -403,4 +496,10 @@
 }
 
+/**
+ * 
+ * @param timer
+ * @param result
+ * @return
+ */
 struct posix_tm *posix_localtime_r(const time_t *restrict timer,
     struct posix_tm *restrict result)
@@ -413,5 +512,5 @@
 /**
  *
- * @param tm
+ * @param timeptr
  * @return
  */
@@ -422,4 +521,10 @@
 }
 
+/**
+ * 
+ * @param timeptr
+ * @param buf
+ * @return
+ */
 char *posix_asctime_r(const struct posix_tm *restrict timeptr,
     char *restrict buf)
@@ -448,5 +553,5 @@
 /**
  * 
- * @param timep
+ * @param timer
  * @return
  */
@@ -460,4 +565,10 @@
 }
 
+/**
+ * 
+ * @param timer
+ * @param buf
+ * @return
+ */
 char *posix_ctime_r(const time_t *timer, char *buf)
 {
@@ -477,6 +588,6 @@
  * @return
  */
-size_t posix_strftime(char *s, size_t maxsize,
-    const char *format, const struct posix_tm *tm)
+size_t posix_strftime(char *restrict s, size_t maxsize,
+    const char *restrict format, const struct posix_tm *restrict tm)
 {
 	// TODO: use locale
@@ -655,4 +766,27 @@
 }
 
+/**
+ * 
+ * @param s
+ * @param maxsize
+ * @param format
+ * @param tm
+ * @param loc
+ * @return
+ */
+extern size_t posix_strftime_l(char *restrict s, size_t maxsize,
+    const char *restrict format, const struct posix_tm *restrict tm,
+    posix_locale_t loc)
+{
+	// TODO
+	not_implemented();
+}
+
+/**
+ *
+ * @param clock_id
+ * @param res
+ * @return
+ */
 int posix_clock_getres(posix_clockid_t clock_id, struct posix_timespec *res)
 {
@@ -670,4 +804,10 @@
 }
 
+/**
+ * 
+ * @param clock_id
+ * @param tp
+ * @return
+ */
 int posix_clock_gettime(posix_clockid_t clock_id, struct posix_timespec *tp)
 {
@@ -688,4 +828,10 @@
 }
 
+/**
+ * 
+ * @param clock_id
+ * @param tp
+ * @return
+ */
 int posix_clock_settime(posix_clockid_t clock_id,
     const struct posix_timespec *tp)
@@ -706,4 +852,12 @@
 }
 
+/**
+ * 
+ * @param clock_id
+ * @param flags
+ * @param rqtp
+ * @param rmtp
+ * @return
+ */
 int posix_clock_nanosleep(posix_clockid_t clock_id, int flags,
     const struct posix_timespec *rqtp, struct posix_timespec *rmtp)
@@ -735,4 +889,11 @@
 };
 
+/**
+ * 
+ * @param clockid
+ * @param evp
+ * @param timerid
+ * @return
+ */
 int posix_timer_create(posix_clockid_t clockid,
     struct posix_sigevent *restrict evp,
@@ -743,4 +904,9 @@
 }
 
+/**
+ * 
+ * @param timerid
+ * @return
+ */
 int posix_timer_delete(posix_timer_t timerid)
 {
@@ -749,4 +915,9 @@
 }
 
+/**
+ * 
+ * @param timerid
+ * @return
+ */
 int posix_timer_getoverrun(posix_timer_t timerid)
 {
@@ -755,4 +926,10 @@
 }
 
+/**
+ * 
+ * @param timerid
+ * @param value
+ * @return
+ */
 int posix_timer_gettime(posix_timer_t timerid,
     struct posix_itimerspec *value)
@@ -762,4 +939,12 @@
 }
 
+/**
+ * 
+ * @param timerid
+ * @param flags
+ * @param value
+ * @param ovalue
+ * @return
+ */
 int posix_timer_settime(posix_timer_t timerid, int flags,
     const struct posix_itimerspec *restrict value,
