Changeset 246809 in webkit


Ignore:
Timestamp:
Jun 25, 2019 2:35:03 PM (5 years ago)
Author:
abarth@webkit.org
Message:

[fuchsia] Update to newer zx_clock_get syscall
https://bugs.webkit.org/show_bug.cgi?id=199191

Reviewed by Sam Weinig.

Fuchsia has changed the zx_clock_get syscall to return the clock value
via an out parameter rather than via its return value. This change
makes zx_clock_get consistent with all the other syscalls.

This patch updates our use of zx_clock_get to use the new syscall. The
old syscall is no longer supported by Fuchsia.

  • wtf/fuchsia/CPUTimeFuchsia.cpp:

(WTF::CPUTime::get): Switch to using the out parameter.
(WTF::CPUTime::forCurrentThread): Switch to using the out parameter.

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r246790 r246809  
     12019-06-25  Adam Barth  <abarth@webkit.org>
     2
     3        [fuchsia] Update to newer zx_clock_get syscall
     4        https://bugs.webkit.org/show_bug.cgi?id=199191
     5
     6        Reviewed by Sam Weinig.
     7
     8        Fuchsia has changed the zx_clock_get syscall to return the clock value
     9        via an out parameter rather than via its return value. This change
     10        makes zx_clock_get consistent with all the other syscalls.
     11
     12        This patch updates our use of zx_clock_get to use the new syscall. The
     13        old syscall is no longer supported by Fuchsia.
     14
     15        * wtf/fuchsia/CPUTimeFuchsia.cpp:
     16        (WTF::CPUTime::get): Switch to using the out parameter.
     17        (WTF::CPUTime::forCurrentThread): Switch to using the out parameter.
     18
    1192019-06-25  Michael Catanzaro  <mcatanzaro@igalia.com>
    220
  • trunk/Source/WTF/wtf/fuchsia/CPUTimeFuchsia.cpp

    r242776 r246809  
    4242    // times atomically and being able to separate ZX_CLOCK_THREAD into user and
    4343    // kernel time.
    44     zx_time_t thread = zx_clock_get(ZX_CLOCK_THREAD);
     44    zx_time_t thread = 0;
     45    zx_clock_get(ZX_CLOCK_THREAD, &thread);
    4546
    4647    return CPUTime { MonotonicTime::now(), timeToSeconds(thread), Seconds() };
     
    4950Seconds CPUTime::forCurrentThread()
    5051{
    51     return timeToSeconds(zx_clock_get(ZX_CLOCK_THREAD));
     52    zx_time_t thread = 0;
     53    zx_clock_get(ZX_CLOCK_THREAD, &thread)
     54    return timeToSeconds(thread);
    5255}
    5356
Note: See TracChangeset for help on using the changeset viewer.