summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/rand/rand_os2.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2010-10-01 22:54:00 +0000
committerdjm <djm@openbsd.org>2010-10-01 22:54:00 +0000
commitf1535dc82c407426dcbc37ddee0ceff3f0c94865 (patch)
treef73777171acb436d21ef5cb0f2cd241a939ab7f8 /lib/libcrypto/rand/rand_os2.c
parent- document new MODCPAN_MODULES (diff)
downloadwireguard-openbsd-f1535dc82c407426dcbc37ddee0ceff3f0c94865.tar.xz
wireguard-openbsd-f1535dc82c407426dcbc37ddee0ceff3f0c94865.zip
import OpenSSL-1.0.0a
Diffstat (limited to 'lib/libcrypto/rand/rand_os2.c')
-rw-r--r--lib/libcrypto/rand/rand_os2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libcrypto/rand/rand_os2.c b/lib/libcrypto/rand/rand_os2.c
index c3e36d4e5e3..fc1e78b1794 100644
--- a/lib/libcrypto/rand/rand_os2.c
+++ b/lib/libcrypto/rand/rand_os2.c
@@ -78,8 +78,10 @@ typedef struct _CPUUTIL {
ULONG ulIntrHigh; /* High 32 bits of interrupt time */
} CPUUTIL;
+#ifndef __KLIBC__
APIRET APIENTRY(*DosPerfSysCall) (ULONG ulCommand, ULONG ulParm1, ULONG ulParm2, ULONG ulParm3) = NULL;
APIRET APIENTRY(*DosQuerySysState) (ULONG func, ULONG arg1, ULONG pid, ULONG _res_, PVOID buf, ULONG bufsz) = NULL;
+#endif
HMODULE hDoscalls = 0;
int RAND_poll(void)
@@ -91,6 +93,7 @@ int RAND_poll(void)
if (hDoscalls == 0) {
ULONG rc = DosLoadModule(failed_module, sizeof(failed_module), "DOSCALLS", &hDoscalls);
+#ifndef __KLIBC__
if (rc == 0) {
rc = DosQueryProcAddr(hDoscalls, 976, NULL, (PFN *)&DosPerfSysCall);
@@ -102,6 +105,7 @@ int RAND_poll(void)
if (rc)
DosQuerySysState = NULL;
}
+#endif
}
/* Sample the hi-res timer, runs at around 1.1 MHz */
@@ -122,7 +126,9 @@ int RAND_poll(void)
RAND_add(&util, sizeof(util), 10);
}
else {
+#ifndef __KLIBC__
DosPerfSysCall = NULL;
+#endif
}
}