Add clock_settime and clock_nanosleep.

Add the missing prototypes, fix the existing prototypes to use clockid_t
rather than int, fix clock_nanosleep's failure behavior, and add simple
tests.

Bug: 17644443
Bug: https://code.google.com/p/android/issues/detail?id=77372
Change-Id: I03fba369939403918abcabae9551a7123953d780
Signed-off-by: Haruki Hasegawa <h6a.h4i.0@gmail.com>
diff --git a/libc/include/time.h b/libc/include/time.h
index 34a53b2..e34eb34 100644
--- a/libc/include/time.h
+++ b/libc/include/time.h
@@ -85,8 +85,10 @@
 
 extern clock_t clock(void) __LIBC_ABI_PUBLIC__;
 
-extern int clock_getres(int, struct timespec*) __LIBC_ABI_PUBLIC__;
-extern int clock_gettime(int, struct timespec*) __LIBC_ABI_PUBLIC__;
+extern int clock_getres(clockid_t, struct timespec*) __LIBC_ABI_PUBLIC__;
+extern int clock_gettime(clockid_t, struct timespec*) __LIBC_ABI_PUBLIC__;
+extern int clock_nanosleep(clockid_t, int, const struct timespec*, struct timespec*) __LIBC_ABI_PUBLIC__;
+extern int clock_settime(clockid_t, const struct timespec*) __LIBC_ABI_PUBLIC__;
 
 extern int timer_create(int, struct sigevent*, timer_t*) __LIBC_ABI_PUBLIC__;
 extern int timer_delete(timer_t) __LIBC_ABI_PUBLIC__;