OLD | NEW |
1 #include <errno.h> | 1 #include <errno.h> |
2 #include <time.h> | 2 #include <time.h> |
3 | 3 |
4 #include <irt_syscalls.h> | 4 #include <irt_syscalls.h> |
5 | 5 |
| 6 /* |
| 7 * Please note that we do not support the general case via the TCB |
| 8 * (pthread_getcpuclockid) which means that CLOCK_THREAD_CPUTIME_ID |
| 9 * will behave differently from pthread_getcpuclockid(pthread_self()). |
| 10 */ |
| 11 |
6 #define SYSDEP_GETTIME \ | 12 #define SYSDEP_GETTIME \ |
7 case CLOCK_REALTIME: \ | 13 case CLOCK_REALTIME: \ |
8 case CLOCK_MONOTONIC: \ | 14 case CLOCK_MONOTONIC: \ |
| 15 case CLOCK_PROCESS_CPUTIME_ID: \ |
| 16 case CLOCK_THREAD_CPUTIME_ID: \ |
9 { \ | 17 { \ |
10 int result = __nacl_irt_clock_gettime (clock_id, tp); \ | 18 int result = __nacl_irt_clock_gettime (clock_id, tp); \ |
11 if (result != 0) \ | 19 if (result != 0) \ |
12 { \ | 20 { \ |
13 __set_errno (result); \ | 21 __set_errno (result); \ |
14 retval = -1; \ | 22 retval = -1; \ |
15 } \ | 23 } \ |
16 else \ | 24 else \ |
17 retval = 0; \ | 25 retval = 0; \ |
18 } \ | 26 } \ |
19 break; | 27 break; |
20 | 28 |
21 #define HANDLED_REALTIME | 29 #define HANDLED_REALTIME |
| 30 #define HANDLED_CPUTIME |
22 | 31 |
23 #include <sysdeps/unix/clock_gettime.c> | 32 #include <sysdeps/unix/clock_gettime.c> |
OLD | NEW |