Commit 17cb4f9
time.c: Fix overflow in high-precision thread time.
Using the generic syscall() to obtain the high-precision thread time
is problematic because its declared return type is only int, which is
inadequate for a runtime in nanoseconds. What was originally missed
is that a proper function wrapper already exists in the 10.10+
libSystem, albeit undocumented and with no published prototype. The
correct approach is simply to provide the missing prototype and call
the function.
Thanks to Un1q32@github for the bug report.
TESTED:
Passes all tests, including updated clock test with "slowness".1 parent 361b32f commit 17cb4f9
1 file changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | 319 | | |
321 | 320 | | |
322 | 321 | | |
| |||
616 | 615 | | |
617 | 616 | | |
618 | 617 | | |
619 | | - | |
| 618 | + | |
620 | 619 | | |
621 | 620 | | |
622 | 621 | | |
| |||
685 | 684 | | |
686 | 685 | | |
687 | 686 | | |
688 | | - | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
689 | 691 | | |
690 | 692 | | |
691 | 693 | | |
692 | | - | |
| 694 | + | |
693 | 695 | | |
694 | 696 | | |
695 | 697 | | |
| |||
698 | 700 | | |
699 | 701 | | |
700 | 702 | | |
701 | | - | |
| 703 | + | |
702 | 704 | | |
703 | 705 | | |
704 | 706 | | |
| |||
0 commit comments