| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2013 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #include "native_client/src/nonsfi/irt/irt_interfaces.h" | 7 #include "native_client/src/nonsfi/irt/irt_interfaces.h" |
| 8 | 8 |
| 9 #include <assert.h> | 9 #include <assert.h> |
| 10 #include <errno.h> | 10 #include <errno.h> |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 *count = result; | 467 *count = result; |
| 468 return 0; | 468 return 0; |
| 469 } | 469 } |
| 470 #endif | 470 #endif |
| 471 | 471 |
| 472 #if defined(__linux__) || defined(__native_client__) | 472 #if defined(__linux__) || defined(__native_client__) |
| 473 static int irt_clock_getres(nacl_irt_clockid_t clk_id, | 473 static int irt_clock_getres(nacl_irt_clockid_t clk_id, |
| 474 struct timespec *time_nacl) { | 474 struct timespec *time_nacl) { |
| 475 struct timespec time; | 475 struct timespec time; |
| 476 int result = check_error(clock_getres(clk_id, &time)); | 476 int result = check_error(clock_getres(clk_id, &time)); |
| 477 convert_to_nacl_timespec(time_nacl, &time); | 477 /* |
| 478 * The timespec pointer is allowed to be NULL for clock_getres() though |
| 479 * not for clock_gettime(). |
| 480 */ |
| 481 if (time_nacl != NULL) |
| 482 convert_to_nacl_timespec(time_nacl, &time); |
| 478 return result; | 483 return result; |
| 479 } | 484 } |
| 480 | 485 |
| 481 static int irt_clock_gettime(nacl_irt_clockid_t clk_id, | 486 static int irt_clock_gettime(nacl_irt_clockid_t clk_id, |
| 482 struct timespec *time_nacl) { | 487 struct timespec *time_nacl) { |
| 483 struct timespec time; | 488 struct timespec time; |
| 484 int result = check_error(clock_gettime(clk_id, &time)); | 489 int result = check_error(clock_gettime(clk_id, &time)); |
| 485 convert_to_nacl_timespec(time_nacl, &time); | 490 convert_to_nacl_timespec(time_nacl, &time); |
| 486 return result; | 491 return result; |
| 487 } | 492 } |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 nacl_entry_func_t entry_func = | 733 nacl_entry_func_t entry_func = |
| 729 #if defined(__APPLE__) | 734 #if defined(__APPLE__) |
| 730 _start; | 735 _start; |
| 731 #else | 736 #else |
| 732 _user_start; | 737 _user_start; |
| 733 #endif | 738 #endif |
| 734 | 739 |
| 735 return nacl_irt_nonsfi_entry(argc, argv, environ, entry_func); | 740 return nacl_irt_nonsfi_entry(argc, argv, environ, entry_func); |
| 736 } | 741 } |
| 737 #endif | 742 #endif |
| OLD | NEW |