diff options
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 | ||