forked from mono/mono
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6af822
commit b77b32e
Showing
6 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* gclock_nanosleep.c: Clock nanosleep on platforms that have clock_nanosleep(). | ||
* | ||
* Copyright 2022 Microsoft | ||
* Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
*/ | ||
|
||
#include <config.h> | ||
#include <glib.h> | ||
#include <errno.h> | ||
|
||
gint | ||
g_clock_nanosleep (clockid_t clockid, gint flags, const struct timespec *request, struct timespec *remain) | ||
{ | ||
gint ret = 0; | ||
|
||
#if defined(HAVE_CLOCK_NANOSLEEP) && !defined(__PASE__) | ||
ret = clock_nanosleep (clockid, flags, request, remain); | ||
#else | ||
g_assert_not_reached (); | ||
#endif | ||
|
||
#ifdef HOST_ANDROID | ||
// Workaround for incorrect implementation of clock_nanosleep return value on old Android (<=5.1) | ||
// See https://github.com/xamarin/xamarin-android/issues/6600 | ||
if (ret == -1) | ||
ret = errno; | ||
#endif | ||
|
||
return ret; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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