This repository was archived by the owner on Feb 8, 2024. It is now read-only.
Solaris time unittest fix: unimplemented clock types checking added.#78
Open
nykytenko wants to merge 1 commit intoldc-developers:ldcfrom
tethyslab:solaris-clocktypes
Open
Solaris time unittest fix: unimplemented clock types checking added.#78nykytenko wants to merge 1 commit intoldc-developers:ldcfrom tethyslab:solaris-clocktypes
nykytenko wants to merge 1 commit intoldc-developers:ldcfrom
tethyslab:solaris-clocktypes
Conversation
Member
|
Is the definition of ClockType for Solaris wrong then? Should it be changed instead and the Solaris comments above it? |
Author
Not quite. In Solaris kernel present declaration of these Clock types: #define __CLOCK_REALTIME0 0 /* obsolete; same as CLOCK_REALTIME */
#define CLOCK_VIRTUAL 1 /* thread's user-level CPU clock */
#define CLOCK_THREAD_CPUTIME_ID 2 /* thread's user+system CPU clock */
#define CLOCK_REALTIME 3 /* wall clock */
#define CLOCK_MONOTONIC 4 /* high resolution monotonic clock */
#define CLOCK_PROCESS_CPUTIME_ID 5 /* process's user+system CPU clock */
#define CLOCK_HIGHRES CLOCK_MONOTONIC /* alternate name */
#define CLOCK_PROF CLOCK_THREAD_CPUTIME_ID /* alternate name */But implemented only two types: /* CLOCK_REALTIME and CLOCK_HIGHRES (CLOCK_MONOTONIC) are the only two
* clock backends currently implemented on illumos. Functions in the kernel
* that use the CLOCK_BACKEND macro will return an error for any clock type
* that does not exist in the clock_backend array. These functions are
* clock_settime, clock_gettime, clock_getres and timer_create.
*
* For reference, the kernel's clock_backend array looks like this:
*
* clock_backend[CLOCK_MAX] (6 entries)
* 0 __CLOCK_REALTIME0 valid ptr. (obs. same as CLOCK_REALTIME)
* 1 CLOCK_VIRTUAL NULL
* 2 CLOCK_THREAD_CPUTIME_ID NULL
* 3 CLOCK_REALTIME valid ptr.
* 4 CLOCK_MONOTONIC (CLOCK_HIGHRES) valid ptr.
* 5 CLOCK_PROCESS_CPUTIME_ID NULL
*/So druntime definition of ClockType can save the same as in Solaris for the future. |
Member
|
So is this a general Solaris shortcoming or just true for illumos, the OpenSolaris fork? |
Author
|
I don't know for latest Oracle Solaris 11, but for Solaris 10 and Illumos this is true. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The only two clock types currently implemented on Solaris and illumos.