From: Richard Levitte Date: Wed, 4 Dec 2002 23:13:07 +0000 (+0000) Subject: Fixes for VxWorks. Are these needed for 0.9.7 and up as well? X-Git-Tag: OpenSSL_0_9_6h~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e5040378dfb831e7cb6ba020f20e42b53ed0053e;p=oweals%2Fopenssl.git Fixes for VxWorks. Are these needed for 0.9.7 and up as well? PR: 374 --- diff --git a/apps/ca.c b/apps/ca.c index 7e64a75e8d..b8487208c6 100644 --- a/apps/ca.c +++ b/apps/ca.c @@ -606,12 +606,14 @@ bad: that to access(). However, time's too short to do that just now. */ +#ifndef VXWORKS if (access(outdir,R_OK|W_OK|X_OK) != 0) { BIO_printf(bio_err,"I am unable to access the %s directory\n",outdir); perror(outdir); goto err; } +#endif if (stat(outdir,&sb) != 0) { diff --git a/apps/s_server.c b/apps/s_server.c index 0839ac07da..e6ecafd4ed 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -1250,7 +1250,7 @@ static int www_body(char *hostname, int s, unsigned char *context) else { BIO_printf(bio_s_out,"read R BLOCK\n"); -#ifndef MSDOS +#if !defined(MSDOS) && !defined(VXWORKS) sleep(1); #endif continue; diff --git a/apps/s_time.c b/apps/s_time.c index c8719a6a22..895741d4cd 100644 --- a/apps/s_time.c +++ b/apps/s_time.c @@ -116,6 +116,11 @@ #include #endif +#ifdef VXWORKS +#include +#undef SIGALRM +#endif + /* The following if from times(3) man page. It may need to be changed */ #ifndef HZ diff --git a/crypto/rand/rand_egd.c b/crypto/rand/rand_egd.c index e17060fe90..ce16936785 100644 --- a/crypto/rand/rand_egd.c +++ b/crypto/rand/rand_egd.c @@ -59,7 +59,7 @@ /* Query the EGD . */ -#if defined(WIN32) || defined(MSDOS) || defined(VMS) || defined(__VMS) +#if defined(WIN32) || defined(MSDOS) || defined(VMS) || defined(__VMS) || defined(VXWORKS) int RAND_egd(const char *path) { return(-1); diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c index 92befcd798..3e148ad4d2 100644 --- a/crypto/rand/rand_win.c +++ b/crypto/rand/rand_win.c @@ -732,8 +732,10 @@ int RAND_poll(void) /* put in some default random data, we need more than just this */ l=curr_pid; RAND_add(&l,sizeof(l),0); +#ifndef VXWORKS l=getuid(); RAND_add(&l,sizeof(l),0); +#endif l=time(NULL); RAND_add(&l,sizeof(l),0); diff --git a/crypto/threads/mttest.c b/crypto/threads/mttest.c index 100165948c..3d1b212b1c 100644 --- a/crypto/threads/mttest.c +++ b/crypto/threads/mttest.c @@ -77,6 +77,10 @@ #ifdef PTHREADS #include #endif +#ifdef VXWORKS +#include +#include +#endif #include #include #include @@ -105,10 +109,12 @@ void irix_locking_callback(int mode,int type,char *file,int line); void solaris_locking_callback(int mode,int type,char *file,int line); void win32_locking_callback(int mode,int type,char *file,int line); void pthreads_locking_callback(int mode,int type,char *file,int line); +void vxworks_locking_callback(int mode,int type,char *file,int line); unsigned long irix_thread_id(void ); unsigned long solaris_thread_id(void ); unsigned long pthreads_thread_id(void ); +unsigned long vxworks_thread_id(void ); BIO *bio_err=NULL; BIO *bio_stdout=NULL; @@ -1097,4 +1103,119 @@ unsigned long pthreads_thread_id(void) #endif /* PTHREADS */ +#ifdef VXWORKS + +#define DEFAULT_TASK_NAME NULL +#define DEFAULT_TASK_PRIORITY 100 +#define DEFAULT_TASK_OPTIONS 0 +#define DEFAULT_TASK_STACK_BYTES 32768 + +static SEM_ID *lock_cs; +static long *lock_count; + +extern int sysClkRateGet(); + +void thread_setup(void) + { + int i; + + lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(SEM_ID)); + lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); + for (i=0; ireferences,c_ctx->references); + } + +unsigned long vxworks_thread_id(void) + { + return((unsigned long)taskIdSelf()); + } +#endif /* VXWORKS */ diff --git a/crypto/tmdiff.c b/crypto/tmdiff.c index 830092210f..fc38e139a7 100644 --- a/crypto/tmdiff.c +++ b/crypto/tmdiff.c @@ -105,6 +105,11 @@ #include #endif +#ifdef VXWORKS +#include +#include +#endif + /* The following if from times(3) man page. It may need to be changed */ #ifndef HZ # ifndef CLK_TCK diff --git a/crypto/uid.c b/crypto/uid.c index b5b61b76d4..4bd283592c 100644 --- a/crypto/uid.c +++ b/crypto/uid.c @@ -64,7 +64,7 @@ int OPENSSL_issetugid(void) return issetugid(); } -#elif defined(WIN32) +#elif defined(WIN32) || defined(VXWORKS) int OPENSSL_issetugid(void) {