OLD | NEW |
1 /* crypto/rand/rand_vms.c -*- mode:C; c-file-style: "eay" -*- */ | 1 /* crypto/rand/rand_vms.c -*- mode:C; c-file-style: "eay" -*- */ |
2 /* Written by Richard Levitte <richard@levitte.org> for the OpenSSL | 2 /* Written by Richard Levitte <richard@levitte.org> for the OpenSSL |
3 * project 2000. | 3 * project 2000. |
4 */ | 4 */ |
5 /* ==================================================================== | 5 /* ==================================================================== |
6 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. | 6 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #if defined(OPENSSL_SYS_VMS) | 62 #if defined(OPENSSL_SYS_VMS) |
63 | 63 |
64 #include <descrip.h> | 64 #include <descrip.h> |
65 #include <jpidef.h> | 65 #include <jpidef.h> |
66 #include <ssdef.h> | 66 #include <ssdef.h> |
67 #include <starlet.h> | 67 #include <starlet.h> |
68 #ifdef __DECC | 68 #ifdef __DECC |
69 # pragma message disable DOLLARID | 69 # pragma message disable DOLLARID |
70 #endif | 70 #endif |
71 | 71 |
| 72 /* Use 32-bit pointers almost everywhere. Define the type to which to |
| 73 * cast a pointer passed to an external function. |
| 74 */ |
| 75 #if __INITIAL_POINTER_SIZE == 64 |
| 76 # define PTR_T __void_ptr64 |
| 77 # pragma pointer_size save |
| 78 # pragma pointer_size 32 |
| 79 #else /* __INITIAL_POINTER_SIZE == 64 */ |
| 80 # define PTR_T void * |
| 81 #endif /* __INITIAL_POINTER_SIZE == 64 [else] */ |
| 82 |
72 static struct items_data_st | 83 static struct items_data_st |
73 { | 84 { |
74 short length, code; /* length is amount of bytes */ | 85 short length, code; /* length is amount of bytes */ |
75 } items_data[] = | 86 } items_data[] = |
76 { { 4, JPI$_BUFIO }, | 87 { { 4, JPI$_BUFIO }, |
77 { 4, JPI$_CPUTIM }, | 88 { 4, JPI$_CPUTIM }, |
78 { 4, JPI$_DIRIO }, | 89 { 4, JPI$_DIRIO }, |
79 { 8, JPI$_LOGINTIM }, | 90 { 8, JPI$_LOGINTIM }, |
80 { 4, JPI$_PAGEFLTS }, | 91 { 4, JPI$_PAGEFLTS }, |
81 { 4, JPI$_PID }, | 92 { 4, JPI$_PID }, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 * Scan through all the processes in the system and add entropy with | 129 * Scan through all the processes in the system and add entropy with |
119 * results from the processes that were possible to look at. | 130 * results from the processes that were possible to look at. |
120 * However, view the information as only half trustable. | 131 * However, view the information as only half trustable. |
121 */ | 132 */ |
122 pid = -1; /* search context */ | 133 pid = -1; /* search context */ |
123 while ((status = sys$getjpiw(0, &pid, 0, item, iosb, 0, 0)) | 134 while ((status = sys$getjpiw(0, &pid, 0, item, iosb, 0, 0)) |
124 != SS$_NOMOREPROC) | 135 != SS$_NOMOREPROC) |
125 { | 136 { |
126 if (status == SS$_NORMAL) | 137 if (status == SS$_NORMAL) |
127 { | 138 { |
128 » » » RAND_add(data_buffer, total_length, total_length/2); | 139 » » » RAND_add( (PTR_T)data_buffer, total_length, |
| 140 » » » total_length/2); |
129 } | 141 } |
130 } | 142 } |
131 sys$gettim(iosb); | 143 sys$gettim(iosb); |
132 » RAND_add((unsigned char *)iosb, sizeof(iosb), sizeof(iosb)/2); | 144 » RAND_add( (PTR_T)iosb, sizeof(iosb), sizeof(iosb)/2); |
133 return 1; | 145 return 1; |
134 } | 146 } |
135 | 147 |
136 #endif | 148 #endif |
OLD | NEW |