| OLD | NEW |
| 1 /* e_os.h */ | 1 /* e_os.h */ |
| 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * This package is an SSL implementation written | 5 * This package is an SSL implementation written |
| 6 * by Eric Young (eay@cryptsoft.com). | 6 * by Eric Young (eay@cryptsoft.com). |
| 7 * The implementation was written so as to conform with Netscapes SSL. | 7 * The implementation was written so as to conform with Netscapes SSL. |
| 8 * | 8 * |
| 9 * This library is free for commercial and non-commercial use as long as | 9 * This library is free for commercial and non-commercial use as long as |
| 10 * the following conditions are aheared to. The following conditions | 10 * the following conditions are aheared to. The following conditions |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 # define NO_CHMOD | 105 # define NO_CHMOD |
| 106 # define NO_SYSLOG | 106 # define NO_SYSLOG |
| 107 # undef DEVRANDOM | 107 # undef DEVRANDOM |
| 108 # define GETPID_IS_MEANINGLESS | 108 # define GETPID_IS_MEANINGLESS |
| 109 # endif | 109 # endif |
| 110 #endif | 110 #endif |
| 111 | 111 |
| 112 /******************************************************************** | 112 /******************************************************************** |
| 113 The Microsoft section | 113 The Microsoft section |
| 114 ********************************************************************/ | 114 ********************************************************************/ |
| 115 /* The following is used becaue of the small stack in some | 115 /* The following is used because of the small stack in some |
| 116 * Microsoft operating systems */ | 116 * Microsoft operating systems */ |
| 117 #if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYSNAME_WIN32) | 117 #if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYSNAME_WIN32) |
| 118 # define MS_STATIC static | 118 # define MS_STATIC static |
| 119 #else | 119 #else |
| 120 # define MS_STATIC | 120 # define MS_STATIC |
| 121 #endif | 121 #endif |
| 122 | 122 |
| 123 #if defined(OPENSSL_SYS_WIN32) && !defined(WIN32) | 123 #if defined(OPENSSL_SYS_WIN32) && !defined(WIN32) |
| 124 # define WIN32 | 124 # define WIN32 |
| 125 #endif | 125 #endif |
| 126 #if defined(OPENSSL_SYS_WIN16) && !defined(WIN16) | |
| 127 # define WIN16 | |
| 128 #endif | |
| 129 #if defined(OPENSSL_SYS_WINDOWS) && !defined(WINDOWS) | 126 #if defined(OPENSSL_SYS_WINDOWS) && !defined(WINDOWS) |
| 130 # define WINDOWS | 127 # define WINDOWS |
| 131 #endif | 128 #endif |
| 132 #if defined(OPENSSL_SYS_MSDOS) && !defined(MSDOS) | 129 #if defined(OPENSSL_SYS_MSDOS) && !defined(MSDOS) |
| 133 # define MSDOS | 130 # define MSDOS |
| 134 #endif | 131 #endif |
| 135 | 132 |
| 136 #if defined(MSDOS) && !defined(GETPID_IS_MEANINGLESS) | 133 #if defined(MSDOS) && !defined(GETPID_IS_MEANINGLESS) |
| 137 # define GETPID_IS_MEANINGLESS | 134 # define GETPID_IS_MEANINGLESS |
| 138 #endif | 135 #endif |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 #define closesocket(s) close(s) | 170 #define closesocket(s) close(s) |
| 174 #define readsocket(s,b,n) recv((s),(b),(n),0) | 171 #define readsocket(s,b,n) recv((s),(b),(n),0) |
| 175 #define writesocket(s,b,n) send((s),(b),(n),0) | 172 #define writesocket(s,b,n) send((s),(b),(n),0) |
| 176 #elif defined(OPENSSL_SYS_VXWORKS) | 173 #elif defined(OPENSSL_SYS_VXWORKS) |
| 177 #define get_last_socket_error() errno | 174 #define get_last_socket_error() errno |
| 178 #define clear_socket_error() errno=0 | 175 #define clear_socket_error() errno=0 |
| 179 #define ioctlsocket(a,b,c) ioctl((a),(b),(int)(c)) | 176 #define ioctlsocket(a,b,c) ioctl((a),(b),(int)(c)) |
| 180 #define closesocket(s) close(s) | 177 #define closesocket(s) close(s) |
| 181 #define readsocket(s,b,n) read((s),(b),(n)) | 178 #define readsocket(s,b,n) read((s),(b),(n)) |
| 182 #define writesocket(s,b,n) write((s),(char *)(b),(n)) | 179 #define writesocket(s,b,n) write((s),(char *)(b),(n)) |
| 180 #elif defined(OPENSSL_SYS_BEOS_R5) |
| 181 #define get_last_socket_error() errno |
| 182 #define clear_socket_error() errno=0 |
| 183 #define FIONBIO SO_NONBLOCK |
| 184 #define ioctlsocket(a,b,c) setsockopt((a),SOL_SOCKET,(b),(c),size
of(*(c))) |
| 185 #define readsocket(s,b,n) recv((s),(b),(n),0) |
| 186 #define writesocket(s,b,n) send((s),(b),(n),0) |
| 183 #elif defined(OPENSSL_SYS_NETWARE) | 187 #elif defined(OPENSSL_SYS_NETWARE) |
| 184 #if defined(NETWARE_BSDSOCK) | 188 #if defined(NETWARE_BSDSOCK) |
| 185 #define get_last_socket_error() errno | 189 #define get_last_socket_error() errno |
| 186 #define clear_socket_error() errno=0 | 190 #define clear_socket_error() errno=0 |
| 187 #define closesocket(s) close(s) | 191 #define closesocket(s) close(s) |
| 188 #define ioctlsocket(a,b,c) ioctl(a,b,c) | 192 #define ioctlsocket(a,b,c) ioctl(a,b,c) |
| 189 #if defined(NETWARE_LIBC) | 193 #if defined(NETWARE_LIBC) |
| 190 #define readsocket(s,b,n) recv((s),(b),(n),0) | 194 #define readsocket(s,b,n) recv((s),(b),(n),0) |
| 191 #define writesocket(s,b,n) send((s),(b),(n),0) | 195 #define writesocket(s,b,n) send((s),(b),(n),0) |
| 192 #else | 196 #else |
| 193 #define readsocket(s,b,n) recv((s),(char*)(b),(n),0) | 197 #define readsocket(s,b,n) recv((s),(char*)(b),(n),0) |
| 194 #define writesocket(s,b,n) send((s),(char*)(b),(n),0) | 198 #define writesocket(s,b,n) send((s),(char*)(b),(n),0) |
| 195 #endif | 199 #endif |
| 196 #else | 200 #else |
| 197 #define get_last_socket_error() WSAGetLastError() | 201 #define get_last_socket_error() WSAGetLastError() |
| 198 #define clear_socket_error() WSASetLastError(0) | 202 #define clear_socket_error() WSASetLastError(0) |
| 199 #define readsocket(s,b,n) recv((s),(b),(n),0) | 203 #define readsocket(s,b,n) recv((s),(b),(n),0) |
| 200 #define writesocket(s,b,n) send((s),(b),(n),0) | 204 #define writesocket(s,b,n) send((s),(b),(n),0) |
| 201 #endif | 205 #endif |
| 202 #else | 206 #else |
| 203 #define get_last_socket_error() errno | 207 #define get_last_socket_error() errno |
| 204 #define clear_socket_error() errno=0 | 208 #define clear_socket_error() errno=0 |
| 205 #define ioctlsocket(a,b,c) ioctl(a,b,c) | 209 #define ioctlsocket(a,b,c) ioctl(a,b,c) |
| 206 #define closesocket(s) close(s) | 210 #define closesocket(s) close(s) |
| 207 #define readsocket(s,b,n) read((s),(b),(n)) | 211 #define readsocket(s,b,n) read((s),(b),(n)) |
| 208 #define writesocket(s,b,n) write((s),(b),(n)) | 212 #define writesocket(s,b,n) write((s),(b),(n)) |
| 209 #endif | 213 #endif |
| 210 | 214 |
| 211 #ifdef WIN16 | 215 #ifdef WIN16 /* never the case */ |
| 212 # define MS_CALLBACK _far _loadds | 216 # define MS_CALLBACK _far _loadds |
| 213 # define MS_FAR _far | 217 # define MS_FAR _far |
| 214 #else | 218 #else |
| 215 # define MS_CALLBACK | 219 # define MS_CALLBACK |
| 216 # define MS_FAR | 220 # define MS_FAR |
| 217 #endif | 221 #endif |
| 218 | 222 |
| 219 #ifdef OPENSSL_NO_STDIO | 223 #ifdef OPENSSL_NO_STDIO |
| 220 # undef OPENSSL_NO_FP_API | 224 # undef OPENSSL_NO_FP_API |
| 221 # define OPENSSL_NO_FP_API | 225 # define OPENSSL_NO_FP_API |
| (...skipping 25 matching lines...) Expand all Loading... |
| 247 # if !defined(WINNT) && !defined(__DJGPP__) | 251 # if !defined(WINNT) && !defined(__DJGPP__) |
| 248 # define NO_SYSLOG | 252 # define NO_SYSLOG |
| 249 # endif | 253 # endif |
| 250 # define NO_DIRENT | 254 # define NO_DIRENT |
| 251 | 255 |
| 252 # ifdef WINDOWS | 256 # ifdef WINDOWS |
| 253 # if !defined(_WIN32_WCE) && !defined(_WIN32_WINNT) | 257 # if !defined(_WIN32_WCE) && !defined(_WIN32_WINNT) |
| 254 /* | 258 /* |
| 255 * Defining _WIN32_WINNT here in e_os.h implies certain "discipline." | 259 * Defining _WIN32_WINNT here in e_os.h implies certain "discipline." |
| 256 * Most notably we ought to check for availability of each specific | 260 * Most notably we ought to check for availability of each specific |
| 257 » * routine with GetProcAddress() and/or quard NT-specific calls with | 261 » * routine with GetProcAddress() and/or guard NT-specific calls with |
| 258 * GetVersion() < 0x80000000. One can argue that in latter "or" case | 262 * GetVersion() < 0x80000000. One can argue that in latter "or" case |
| 259 * we ought to /DELAYLOAD some .DLLs in order to protect ourselves | 263 * we ought to /DELAYLOAD some .DLLs in order to protect ourselves |
| 260 * against run-time link errors. This doesn't seem to be necessary, | 264 * against run-time link errors. This doesn't seem to be necessary, |
| 261 * because it turned out that already Windows 95, first non-NT Win32 | 265 * because it turned out that already Windows 95, first non-NT Win32 |
| 262 * implementation, is equipped with at least NT 3.51 stubs, dummy | 266 * implementation, is equipped with at least NT 3.51 stubs, dummy |
| 263 * routines with same name, but which do nothing. Meaning that it's | 267 * routines with same name, but which do nothing. Meaning that it's |
| 264 » * apparently appropriate to guard generic NT calls with GetVersion | 268 » * apparently sufficient to guard "vanilla" NT calls with GetVersion |
| 265 » * alone, while NT 4.0 and above calls ought to be additionally | 269 » * alone, while NT 4.0 and above interfaces ought to be linked with |
| 266 » * checked upon with GetProcAddress. | 270 » * GetProcAddress at run-time. |
| 267 */ | 271 */ |
| 268 # define _WIN32_WINNT 0x0400 | 272 # define _WIN32_WINNT 0x0400 |
| 269 # endif | 273 # endif |
| 274 # if !defined(OPENSSL_NO_SOCK) && defined(_WIN32_WINNT) |
| 275 /* |
| 276 * Just like defining _WIN32_WINNT including winsock2.h implies |
| 277 * certain "discipline" for maintaining [broad] binary compatibility. |
| 278 * As long as structures are invariant among Winsock versions, |
| 279 * it's sufficient to check for specific Winsock2 API availability |
| 280 * at run-time [DSO_global_lookup is recommended]... |
| 281 */ |
| 282 # include <winsock2.h> |
| 283 # include <ws2tcpip.h> |
| 284 /* yes, they have to be #included prior to <windows.h> */ |
| 285 # endif |
| 270 # include <windows.h> | 286 # include <windows.h> |
| 271 # include <stdio.h> | 287 # include <stdio.h> |
| 272 # include <stddef.h> | 288 # include <stddef.h> |
| 273 # include <errno.h> | 289 # include <errno.h> |
| 274 # include <string.h> | 290 # include <string.h> |
| 275 # ifdef _WIN64 | 291 # ifdef _WIN64 |
| 276 # define strlen(s) _strlen31(s) | 292 # define strlen(s) _strlen31(s) |
| 277 /* cut strings to 2GB */ | 293 /* cut strings to 2GB */ |
| 278 static unsigned int _strlen31(const char *str) | 294 static unsigned int _strlen31(const char *str) |
| 279 { | 295 { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 300 # define stdin (&__iob_func()[0]) | 316 # define stdin (&__iob_func()[0]) |
| 301 # define stdout (&__iob_func()[1]) | 317 # define stdout (&__iob_func()[1]) |
| 302 # define stderr (&__iob_func()[2]) | 318 # define stderr (&__iob_func()[2]) |
| 303 # elif defined(I_CAN_LIVE_WITH_LNK4049) | 319 # elif defined(I_CAN_LIVE_WITH_LNK4049) |
| 304 # undef stdin | 320 # undef stdin |
| 305 # undef stdout | 321 # undef stdout |
| 306 # undef stderr | 322 # undef stderr |
| 307 /* pre-1300 has __p__iob(), but it's available only in msvcrt.lib, | 323 /* pre-1300 has __p__iob(), but it's available only in msvcrt.lib, |
| 308 * or in other words with /MD. Declaring implicit import, i.e. | 324 * or in other words with /MD. Declaring implicit import, i.e. |
| 309 * with _imp_ prefix, works correctly with all compiler options, | 325 * with _imp_ prefix, works correctly with all compiler options, |
| 310 * but without /MD results in LINK warning LNK4049: | 326 » * but without /MD results in LINK warning LNK4049: |
| 311 * 'locally defined symbol "__iob" imported'. | 327 » * 'locally defined symbol "__iob" imported'. |
| 312 */ | 328 */ |
| 313 extern FILE *_imp___iob; | 329 extern FILE *_imp___iob; |
| 314 # define stdin (&_imp___iob[0]) | 330 # define stdin (&_imp___iob[0]) |
| 315 # define stdout (&_imp___iob[1]) | 331 # define stdout (&_imp___iob[1]) |
| 316 # define stderr (&_imp___iob[2]) | 332 # define stderr (&_imp___iob[2]) |
| 317 # endif | 333 # endif |
| 318 # endif | 334 # endif |
| 319 # endif | 335 # endif |
| 320 # include <io.h> | 336 # include <io.h> |
| 321 # include <fcntl.h> | 337 # include <fcntl.h> |
| 322 | 338 |
| 323 # ifdef OPENSSL_SYS_WINCE | 339 # ifdef OPENSSL_SYS_WINCE |
| 324 # include <winsock_extras.h> | 340 # define OPENSSL_NO_POSIX_IO |
| 325 # endif | 341 # endif |
| 326 | 342 |
| 327 # define ssize_t long | 343 # define ssize_t long |
| 328 | 344 |
| 329 # if defined (__BORLANDC__) | 345 # if defined (__BORLANDC__) |
| 330 # define _setmode setmode | 346 # define _setmode setmode |
| 331 # define _O_TEXT O_TEXT | 347 # define _O_TEXT O_TEXT |
| 332 # define _O_BINARY O_BINARY | 348 # define _O_BINARY O_BINARY |
| 333 # define _int64 __int64 | 349 # define _int64 __int64 |
| 334 # define _kbhit kbhit | 350 # define _kbhit kbhit |
| 335 # endif | 351 # endif |
| 336 | 352 |
| 337 # if defined(WIN16) && defined(SSLEAY) && defined(_WINEXITNOPERSIST) | 353 # define EXIT(n) exit(n) |
| 338 # define EXIT(n) _wsetexit(_WINEXITNOPERSIST) | |
| 339 # define OPENSSL_EXIT(n) do { if (n == 0) EXIT(n); return(n); } while(0) | |
| 340 # else | |
| 341 # define EXIT(n) exit(n) | |
| 342 # endif | |
| 343 # define LIST_SEPARATOR_CHAR ';' | 354 # define LIST_SEPARATOR_CHAR ';' |
| 344 # ifndef X_OK | 355 # ifndef X_OK |
| 345 # define X_OK 0 | 356 # define X_OK 0 |
| 346 # endif | 357 # endif |
| 347 # ifndef W_OK | 358 # ifndef W_OK |
| 348 # define W_OK 2 | 359 # define W_OK 2 |
| 349 # endif | 360 # endif |
| 350 # ifndef R_OK | 361 # ifndef R_OK |
| 351 # define R_OK 4 | 362 # define R_OK 4 |
| 352 # endif | 363 # endif |
| 353 # define OPENSSL_CONF "openssl.cnf" | 364 # define OPENSSL_CONF "openssl.cnf" |
| 354 # define SSLEAY_CONF OPENSSL_CONF | 365 # define SSLEAY_CONF OPENSSL_CONF |
| 355 # define NUL_DEV "nul" | 366 # define NUL_DEV "nul" |
| 356 # define RFILE ".rnd" | 367 # define RFILE ".rnd" |
| 357 # ifdef OPENSSL_SYS_WINCE | 368 # ifdef OPENSSL_SYS_WINCE |
| 358 # define DEFAULT_HOME "" | 369 # define DEFAULT_HOME "" |
| 359 # else | 370 # else |
| 360 # define DEFAULT_HOME "C:" | 371 # define DEFAULT_HOME "C:" |
| 361 # endif | 372 # endif |
| 362 | 373 |
| 363 #else /* The non-microsoft world world */ | 374 #else /* The non-microsoft world */ |
| 364 | 375 |
| 365 # ifdef OPENSSL_SYS_VMS | 376 # ifdef OPENSSL_SYS_VMS |
| 366 # define VMS 1 | 377 # define VMS 1 |
| 367 /* some programs don't include stdlib, so exit() and others give implicit | 378 /* some programs don't include stdlib, so exit() and others give implicit |
| 368 function warnings */ | 379 function warnings */ |
| 369 # include <stdlib.h> | 380 # include <stdlib.h> |
| 370 # if defined(__DECC) | 381 # if defined(__DECC) |
| 371 # include <unistd.h> | 382 # include <unistd.h> |
| 372 # else | 383 # else |
| 373 # include <unixlib.h> | 384 # include <unixlib.h> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 # elif defined(OPENSSL_SYS_NETWARE) | 417 # elif defined(OPENSSL_SYS_NETWARE) |
| 407 # include <fcntl.h> | 418 # include <fcntl.h> |
| 408 # include <unistd.h> | 419 # include <unistd.h> |
| 409 # define NO_SYS_TYPES_H | 420 # define NO_SYS_TYPES_H |
| 410 # undef DEVRANDOM | 421 # undef DEVRANDOM |
| 411 # ifdef NETWARE_CLIB | 422 # ifdef NETWARE_CLIB |
| 412 # define getpid GetThreadID | 423 # define getpid GetThreadID |
| 413 extern int GetThreadID(void); | 424 extern int GetThreadID(void); |
| 414 /* # include <conio.h> */ | 425 /* # include <conio.h> */ |
| 415 extern int kbhit(void); | 426 extern int kbhit(void); |
| 416 extern void delay(unsigned milliseconds); | |
| 417 # else | 427 # else |
| 418 # include <screen.h> | 428 # include <screen.h> |
| 419 # endif | 429 # endif |
| 420 # define NO_SYSLOG | 430 # define NO_SYSLOG |
| 421 # define _setmode setmode | 431 # define _setmode setmode |
| 422 # define _kbhit kbhit | 432 # define _kbhit kbhit |
| 423 # define _O_TEXT O_TEXT | 433 # define _O_TEXT O_TEXT |
| 424 # define _O_BINARY O_BINARY | 434 # define _O_BINARY O_BINARY |
| 425 # define OPENSSL_CONF "openssl.cnf" | 435 # define OPENSSL_CONF "openssl.cnf" |
| 426 # define SSLEAY_CONF OPENSSL_CONF | 436 # define SSLEAY_CONF OPENSSL_CONF |
| (...skipping 19 matching lines...) Expand all Loading... |
| 446 * (unless when compiling with -D_POSIX_SOURCE, | 456 * (unless when compiling with -D_POSIX_SOURCE, |
| 447 * which doesn't work for us) */ | 457 * which doesn't work for us) */ |
| 448 # endif | 458 # endif |
| 449 # if defined(NeXT) || defined(OPENSSL_SYS_NEWS4) || defined(OPENSSL_SYS_SUNOS
) | 459 # if defined(NeXT) || defined(OPENSSL_SYS_NEWS4) || defined(OPENSSL_SYS_SUNOS
) |
| 450 # define ssize_t int /* ditto */ | 460 # define ssize_t int /* ditto */ |
| 451 # endif | 461 # endif |
| 452 # ifdef OPENSSL_SYS_NEWS4 /* setvbuf is missing on mips-sony-bsd */ | 462 # ifdef OPENSSL_SYS_NEWS4 /* setvbuf is missing on mips-sony-bsd */ |
| 453 # define setvbuf(a, b, c, d) setbuffer((a), (b), (d)) | 463 # define setvbuf(a, b, c, d) setbuffer((a), (b), (d)) |
| 454 typedef unsigned long clock_t; | 464 typedef unsigned long clock_t; |
| 455 # endif | 465 # endif |
| 466 # ifdef OPENSSL_SYS_WIN32_CYGWIN |
| 467 # include <io.h> |
| 468 # include <fcntl.h> |
| 469 # endif |
| 456 | 470 |
| 457 # define OPENSSL_CONF "openssl.cnf" | 471 # define OPENSSL_CONF "openssl.cnf" |
| 458 # define SSLEAY_CONF OPENSSL_CONF | 472 # define SSLEAY_CONF OPENSSL_CONF |
| 459 # define RFILE ".rnd" | 473 # define RFILE ".rnd" |
| 460 # define LIST_SEPARATOR_CHAR ':' | 474 # define LIST_SEPARATOR_CHAR ':' |
| 461 # define NUL_DEV "/dev/null" | 475 # define NUL_DEV "/dev/null" |
| 462 # define EXIT(n) exit(n) | 476 # define EXIT(n) exit(n) |
| 463 # endif | 477 # endif |
| 464 | 478 |
| 465 # define SSLeay_getpid() getpid() | 479 # define SSLeay_getpid() getpid() |
| 466 | 480 |
| 467 #endif | 481 #endif |
| 468 | 482 |
| 469 | 483 |
| 470 /*************/ | 484 /*************/ |
| 471 | 485 |
| 472 #ifdef USE_SOCKETS | 486 #ifdef USE_SOCKETS |
| 473 # if defined(WINDOWS) || defined(MSDOS) | 487 # if defined(WINDOWS) || defined(MSDOS) |
| 474 /* windows world */ | 488 /* windows world */ |
| 475 | 489 |
| 476 # ifdef OPENSSL_NO_SOCK | 490 # ifdef OPENSSL_NO_SOCK |
| 477 # define SSLeay_Write(a,b,c) (-1) | 491 # define SSLeay_Write(a,b,c) (-1) |
| 478 # define SSLeay_Read(a,b,c) (-1) | 492 # define SSLeay_Read(a,b,c) (-1) |
| 479 # define SHUTDOWN(fd) close(fd) | 493 # define SHUTDOWN(fd) close(fd) |
| 480 # define SHUTDOWN2(fd) close(fd) | 494 # define SHUTDOWN2(fd) close(fd) |
| 481 # elif !defined(__DJGPP__) | 495 # elif !defined(__DJGPP__) |
| 482 # include <winsock.h> | 496 # if defined(_WIN32_WCE) && _WIN32_WCE<410 |
| 483 extern HINSTANCE _hInstance; | 497 # define getservbyname _masked_declaration_getservbyname |
| 498 # endif |
| 499 # if !defined(IPPROTO_IP) |
| 500 /* winsock[2].h was included already? */ |
| 501 # include <winsock.h> |
| 502 # endif |
| 503 # ifdef getservbyname |
| 504 # undef getservbyname |
| 505 /* this is used to be wcecompat/include/winsock_extras.h */ |
| 506 struct servent* PASCAL getservbyname(const char*,const char*); |
| 507 # endif |
| 508 |
| 484 # ifdef _WIN64 | 509 # ifdef _WIN64 |
| 485 /* | 510 /* |
| 486 * Even though sizeof(SOCKET) is 8, it's safe to cast it to int, because | 511 * Even though sizeof(SOCKET) is 8, it's safe to cast it to int, because |
| 487 * the value constitutes an index in per-process table of limited size | 512 * the value constitutes an index in per-process table of limited size |
| 488 * and not a real pointer. | 513 * and not a real pointer. |
| 489 */ | 514 */ |
| 490 # define socket(d,t,p) ((int)socket(d,t,p)) | 515 # define socket(d,t,p) ((int)socket(d,t,p)) |
| 491 # define accept(s,f,l) ((int)accept(s,f,l)) | 516 # define accept(s,f,l) ((int)accept(s,f,l)) |
| 492 # endif | 517 # endif |
| 493 # define SSLeay_Write(a,b,c) send((a),(b),(c),0) | 518 # define SSLeay_Write(a,b,c) send((a),(b),(c),0) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 # if defined(OPENSSL_SYS_VMS_NODECC) | 570 # if defined(OPENSSL_SYS_VMS_NODECC) |
| 546 # include <socket.h> | 571 # include <socket.h> |
| 547 # include <in.h> | 572 # include <in.h> |
| 548 # include <inet.h> | 573 # include <inet.h> |
| 549 # else | 574 # else |
| 550 # include <sys/socket.h> | 575 # include <sys/socket.h> |
| 551 # ifdef FILIO_H | 576 # ifdef FILIO_H |
| 552 # include <sys/filio.h> /* Added for FIONBIO under unixware */ | 577 # include <sys/filio.h> /* Added for FIONBIO under unixware */ |
| 553 # endif | 578 # endif |
| 554 # include <netinet/in.h> | 579 # include <netinet/in.h> |
| 580 # if !defined(OPENSSL_SYS_BEOS_R5) |
| 555 # include <arpa/inet.h> | 581 # include <arpa/inet.h> |
| 556 # endif | 582 # endif |
| 583 # endif |
| 557 | 584 |
| 558 # if defined(NeXT) || defined(_NEXT_SOURCE) | 585 # if defined(NeXT) || defined(_NEXT_SOURCE) |
| 559 # include <sys/fcntl.h> | 586 # include <sys/fcntl.h> |
| 560 # include <sys/types.h> | 587 # include <sys/types.h> |
| 561 # endif | 588 # endif |
| 562 | 589 |
| 563 # ifdef OPENSSL_SYS_AIX | 590 # ifdef OPENSSL_SYS_AIX |
| 564 # include <sys/select.h> | 591 # include <sys/select.h> |
| 565 # endif | 592 # endif |
| 566 | 593 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 589 # endif | 616 # endif |
| 590 | 617 |
| 591 # define SSLeay_Read(a,b,c) read((a),(b),(c)) | 618 # define SSLeay_Read(a,b,c) read((a),(b),(c)) |
| 592 # define SSLeay_Write(a,b,c) write((a),(b),(c)) | 619 # define SSLeay_Write(a,b,c) write((a),(b),(c)) |
| 593 # define SHUTDOWN(fd) { shutdown((fd),0); closesocket((fd)); } | 620 # define SHUTDOWN(fd) { shutdown((fd),0); closesocket((fd)); } |
| 594 # define SHUTDOWN2(fd) { shutdown((fd),2); closesocket((fd)); } | 621 # define SHUTDOWN2(fd) { shutdown((fd),2); closesocket((fd)); } |
| 595 # ifndef INVALID_SOCKET | 622 # ifndef INVALID_SOCKET |
| 596 # define INVALID_SOCKET (-1) | 623 # define INVALID_SOCKET (-1) |
| 597 # endif /* INVALID_SOCKET */ | 624 # endif /* INVALID_SOCKET */ |
| 598 # endif | 625 # endif |
| 626 |
| 627 /* Some IPv6 implementations are broken, disable them in known bad |
| 628 * versions. |
| 629 */ |
| 630 # if !defined(OPENSSL_USE_IPV6) |
| 631 # if defined(AF_INET6) && !defined(OPENSSL_SYS_BEOS_BONE) && !defined(NETWARE
_CLIB) |
| 632 # define OPENSSL_USE_IPV6 1 |
| 633 # else |
| 634 # define OPENSSL_USE_IPV6 0 |
| 635 # endif |
| 636 # endif |
| 637 |
| 599 #endif | 638 #endif |
| 600 | 639 |
| 601 #if defined(__ultrix) | 640 #if defined(__ultrix) |
| 602 # ifndef ssize_t | 641 # ifndef ssize_t |
| 603 # define ssize_t int | 642 # define ssize_t int |
| 604 # endif | 643 # endif |
| 605 #endif | 644 #endif |
| 606 | 645 |
| 607 #if defined(sun) && !defined(__svr4__) && !defined(__SVR4) | 646 #if defined(sun) && !defined(__svr4__) && !defined(__SVR4) |
| 608 /* include headers first, so our defines don't break it */ | 647 /* include headers first, so our defines don't break it */ |
| (...skipping 13 matching lines...) Expand all Loading... |
| 622 #ifndef OPENSSL_EXIT | 661 #ifndef OPENSSL_EXIT |
| 623 # if defined(MONOLITH) && !defined(OPENSSL_C) | 662 # if defined(MONOLITH) && !defined(OPENSSL_C) |
| 624 # define OPENSSL_EXIT(n) return(n) | 663 # define OPENSSL_EXIT(n) return(n) |
| 625 # else | 664 # else |
| 626 # define OPENSSL_EXIT(n) do { EXIT(n); return(n); } while(0) | 665 # define OPENSSL_EXIT(n) do { EXIT(n); return(n); } while(0) |
| 627 # endif | 666 # endif |
| 628 #endif | 667 #endif |
| 629 | 668 |
| 630 /***********************************************/ | 669 /***********************************************/ |
| 631 | 670 |
| 632 /* do we need to do this for getenv. | |
| 633 * Just define getenv for use under windows */ | |
| 634 | |
| 635 #ifdef WIN16 | |
| 636 /* How to do this needs to be thought out a bit more.... */ | |
| 637 /*char *GETENV(char *); | |
| 638 #define Getenv GETENV*/ | |
| 639 #define Getenv getenv | |
| 640 #else | |
| 641 #define Getenv getenv | |
| 642 #endif | |
| 643 | |
| 644 #define DG_GCC_BUG /* gcc < 2.6.3 on DGUX */ | 671 #define DG_GCC_BUG /* gcc < 2.6.3 on DGUX */ |
| 645 | 672 |
| 646 #ifdef sgi | 673 #ifdef sgi |
| 647 #define IRIX_CC_BUG /* all version of IRIX I've tested (4.* 5.*) */ | 674 #define IRIX_CC_BUG /* all version of IRIX I've tested (4.* 5.*) */ |
| 648 #endif | 675 #endif |
| 649 #ifdef OPENSSL_SYS_SNI | 676 #ifdef OPENSSL_SYS_SNI |
| 650 #define IRIX_CC_BUG /* CDS++ up to V2.0Bsomething suffered from the same bug
.*/ | 677 #define IRIX_CC_BUG /* CDS++ up to V2.0Bsomething suffered from the same bug
.*/ |
| 651 #endif | 678 #endif |
| 652 | 679 |
| 653 #if defined(OPENSSL_SYS_WINDOWS) | 680 #if defined(OPENSSL_SYS_WINDOWS) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 /* NOTE: these are implemented by helpers in database app! | 722 /* NOTE: these are implemented by helpers in database app! |
| 696 * if the database is not linked, we need to implement them | 723 * if the database is not linked, we need to implement them |
| 697 * elswhere */ | 724 * elswhere */ |
| 698 struct hostent *gethostbyname(const char *name); | 725 struct hostent *gethostbyname(const char *name); |
| 699 struct hostent *gethostbyaddr(const char *addr, int length, int type); | 726 struct hostent *gethostbyaddr(const char *addr, int length, int type); |
| 700 struct servent *getservbyname(const char *name, const char *proto); | 727 struct servent *getservbyname(const char *name, const char *proto); |
| 701 | 728 |
| 702 #endif | 729 #endif |
| 703 /* end vxworks */ | 730 /* end vxworks */ |
| 704 | 731 |
| 732 /* beos */ |
| 733 #if defined(OPENSSL_SYS_BEOS_R5) |
| 734 #define SO_ERROR 0 |
| 735 #define NO_SYS_UN |
| 736 #define IPPROTO_IP 0 |
| 737 #include <OS.h> |
| 738 #endif |
| 739 |
| 740 |
| 705 #ifdef __cplusplus | 741 #ifdef __cplusplus |
| 706 } | 742 } |
| 707 #endif | 743 #endif |
| 708 | 744 |
| 709 #endif | 745 #endif |
| 710 | 746 |
| OLD | NEW |