/*++
-Copyright (c) 2004 - 2009, Intel Corporation
-Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.
-All rights reserved. This program and the accompanying materials
+Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
+Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
+This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
- ((UINT64)settimer_timeval.tv_sec * 1000)
- (settimer_timeval.tv_usec / 1000);
settimer_timeval = timeval;
- if (settimer_callback)
- (*settimer_callback)(delta);
+
+ if (settimer_callback) {
+#ifdef __APPLE__
+ ReverseGasketUint64 (settimer_callback, delta);
+#else
+ (*settimer_callback)(delta);
+#endif
+ }
}
VOID
void
msSleep (unsigned long Milliseconds)
{
- struct timespec ts;
+ struct timespec rq, rm;
- ts.tv_sec = Milliseconds / 1000;
- ts.tv_nsec = (Milliseconds % 1000) * 1000000;
+ rq.tv_sec = Milliseconds / 1000;
+ rq.tv_nsec = (Milliseconds % 1000) * 1000000;
- while (nanosleep (&ts, &ts) != 0 && errno == EINTR)
- ;
+ while (nanosleep (&rq, &rm) != -1) {
+ if (errno != EINTR) {
+ break;
+ }
+ rq = rm;
+ }
+
}
void
Gasketgmtime,
GasketGetTimeZone,
GasketGetDayLight,
- (UnixPoll)Gasketpoll,
- (UnixRead)Gasketread,
- (UnixWrite)Gasketwrite,
+ Gasketpoll,
+ Gasketread,
+ Gasketwrite,
Gasketgetenv,
- (UnixOpen)Gasketopen,
- (UnixSeek)Gasketlseek,
- (UnixFtruncate)Gasketftruncate,
+ Gasketopen,
+ Gasketlseek,
+ Gasketftruncate,
Gasketclose,
Gasketmkdir,
Gasketrmdir,
Gasketunlink,
GasketGetErrno,
Gasketopendir,
- (UnixRewindDir)Gasketrewinddir,
+ Gasketrewinddir,
Gasketreaddir,
Gasketclosedir,
Gasketstat,
Gasketcfsetospeed,
Gaskettcgetattr,
Gaskettcsetattr,
-
- dlopen, // Update me with a gasket
- dlerror, // Update me with a gasket
- dlsym, // Update me with a gasket
-
- SecPeCoffGetEntryPoint, // Update me with a gasket
- SecPeCoffRelocateImageExtraAction, // Update me with a gasket
- SecPeCoffLoaderUnloadImageExtraAction // Update me with a gasket
+ GasketUnixPeCoffGetEntryPoint,
+ GasketUnixPeCoffRelocateImageExtraAction,
+ GasketUnixPeCoffUnloadImageExtraAction
#else
msSleep, /* Sleep */
cfsetospeed,
tcgetattr,
tcsetattr,
- dlopen,
- dlerror,
- dlsym,
SecPeCoffGetEntryPoint,
SecPeCoffRelocateImageExtraAction,
SecPeCoffLoaderUnloadImageExtraAction