diff options
| author | djm <> | 2010-10-01 22:54:18 +0000 | 
|---|---|---|
| committer | djm <> | 2010-10-01 22:54:18 +0000 | 
| commit | 75291ae343a87368ad49c13ac02f85a88159417f (patch) | |
| tree | a55c90bd6ea9329d2afb5540220340cadd107178 /src/lib/libcrypto/rand/rand_os2.c | |
| parent | 40d5d67842948fbf904eb73da8f09a2ebcd2e243 (diff) | |
| download | openbsd-75291ae343a87368ad49c13ac02f85a88159417f.tar.gz openbsd-75291ae343a87368ad49c13ac02f85a88159417f.tar.bz2 openbsd-75291ae343a87368ad49c13ac02f85a88159417f.zip  | |
import OpenSSL-1.0.0a
Diffstat (limited to 'src/lib/libcrypto/rand/rand_os2.c')
| -rw-r--r-- | src/lib/libcrypto/rand/rand_os2.c | 6 | 
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/libcrypto/rand/rand_os2.c b/src/lib/libcrypto/rand/rand_os2.c index c3e36d4e5e..fc1e78b179 100644 --- a/src/lib/libcrypto/rand/rand_os2.c +++ b/src/lib/libcrypto/rand/rand_os2.c  | |||
| @@ -78,8 +78,10 @@ typedef struct _CPUUTIL { | |||
| 78 | ULONG ulIntrHigh; /* High 32 bits of interrupt time */ | 78 | ULONG ulIntrHigh; /* High 32 bits of interrupt time */ | 
| 79 | } CPUUTIL; | 79 | } CPUUTIL; | 
| 80 | 80 | ||
| 81 | #ifndef __KLIBC__ | ||
| 81 | APIRET APIENTRY(*DosPerfSysCall) (ULONG ulCommand, ULONG ulParm1, ULONG ulParm2, ULONG ulParm3) = NULL; | 82 | APIRET APIENTRY(*DosPerfSysCall) (ULONG ulCommand, ULONG ulParm1, ULONG ulParm2, ULONG ulParm3) = NULL; | 
| 82 | APIRET APIENTRY(*DosQuerySysState) (ULONG func, ULONG arg1, ULONG pid, ULONG _res_, PVOID buf, ULONG bufsz) = NULL; | 83 | APIRET APIENTRY(*DosQuerySysState) (ULONG func, ULONG arg1, ULONG pid, ULONG _res_, PVOID buf, ULONG bufsz) = NULL; | 
| 84 | #endif | ||
| 83 | HMODULE hDoscalls = 0; | 85 | HMODULE hDoscalls = 0; | 
| 84 | 86 | ||
| 85 | int RAND_poll(void) | 87 | int RAND_poll(void) | 
| @@ -91,6 +93,7 @@ int RAND_poll(void) | |||
| 91 | if (hDoscalls == 0) { | 93 | if (hDoscalls == 0) { | 
| 92 | ULONG rc = DosLoadModule(failed_module, sizeof(failed_module), "DOSCALLS", &hDoscalls); | 94 | ULONG rc = DosLoadModule(failed_module, sizeof(failed_module), "DOSCALLS", &hDoscalls); | 
| 93 | 95 | ||
| 96 | #ifndef __KLIBC__ | ||
| 94 | if (rc == 0) { | 97 | if (rc == 0) { | 
| 95 | rc = DosQueryProcAddr(hDoscalls, 976, NULL, (PFN *)&DosPerfSysCall); | 98 | rc = DosQueryProcAddr(hDoscalls, 976, NULL, (PFN *)&DosPerfSysCall); | 
| 96 | 99 | ||
| @@ -102,6 +105,7 @@ int RAND_poll(void) | |||
| 102 | if (rc) | 105 | if (rc) | 
| 103 | DosQuerySysState = NULL; | 106 | DosQuerySysState = NULL; | 
| 104 | } | 107 | } | 
| 108 | #endif | ||
| 105 | } | 109 | } | 
| 106 | 110 | ||
| 107 | /* Sample the hi-res timer, runs at around 1.1 MHz */ | 111 | /* Sample the hi-res timer, runs at around 1.1 MHz */ | 
| @@ -122,7 +126,9 @@ int RAND_poll(void) | |||
| 122 | RAND_add(&util, sizeof(util), 10); | 126 | RAND_add(&util, sizeof(util), 10); | 
| 123 | } | 127 | } | 
| 124 | else { | 128 | else { | 
| 129 | #ifndef __KLIBC__ | ||
| 125 | DosPerfSysCall = NULL; | 130 | DosPerfSysCall = NULL; | 
| 131 | #endif | ||
| 126 | } | 132 | } | 
| 127 | } | 133 | } | 
| 128 | 134 | ||
