From: Ulf Möller Date: Tue, 11 Apr 2006 21:34:21 +0000 (+0000) Subject: Add BeOS support. X-Git-Tag: OpenSSL_0_9_8k^2~1405 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4700aea951dcba9b1e3b724bf4d8f0c712578892;p=oweals%2Fopenssl.git Add BeOS support. PR: 1312 Submitted by: Oliver Tappe Reviewed by: Ulf Moeller --- diff --git a/CHANGES b/CHANGES index 472b83ab26..3ff6927ac2 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,13 @@ Changes between 0.9.8a and 0.9.9 [xx XXX xxxx] + *) BeOS support. + [Oliver Tappe ] + + *) New make target "install_html_docs" installs HTML renditions of the + manual pages. + [Oliver Tappe ] + *) New utility "genpkey" this is analagous to "genrsa" etc except it can generate keys for any algorithm. Extend and update EVP_PKEY_METHOD to support key and parameter generation and add initial key generation diff --git a/Configure b/Configure index e4124c4c24..04439a2ba3 100755 --- a/Configure +++ b/Configure @@ -381,6 +381,10 @@ my %table=( "qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:", "qnx6", "cc:-DL_ENDIAN -DTERMIOS::(unknown)::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:", +# BeOS +"beos-x86-r5", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -mcpu=pentium -Wall::-D_REENTRANT:BEOS:-lbe -lnet:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:beos:beos-shared:-fPIC -DPIC:-shared:.so", +"beos-x86-bone", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -mcpu=pentium -Wall::-D_REENTRANT:BEOS:-lbe -lbind -lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:beos:beos-shared:-fPIC:-shared:.so", + #### SCO/Caldera targets. # # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc. diff --git a/Makefile.shared b/Makefile.shared index ef1bfe1223..b44c7ead2a 100644 --- a/Makefile.shared +++ b/Makefile.shared @@ -170,6 +170,17 @@ link_a.gnu: link_app.gnu: @ $(DO_GNU_APP); $(LINK_APP) +DO_BEOS_SO= SHLIB=lib$(LIBNAME).so; \ + SHLIB_SUFFIX=; \ + ALLSYMSFLAGS='-Wl,--whole-archive'; \ + NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SUFFIX" + +link_o.beos: + @ $(DO_BEOS_SO); $(LINK_SO_O) +link_a.beos: + @ $(DO_BEOS_SO); $(LINK_SO_A) + link_o.bsd: @if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \ $(CALC_VERSIONS); \ @@ -543,7 +554,7 @@ symlink.hpux: expr $(PLATFORM) : '.*ia64' > /dev/null && SHLIB=lib$(LIBNAME).so; \ $(SYMLINK_SO) # The following lines means those specific architectures do no symlinks -symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath: +symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath symlink.beos: # Compatibility targets link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu @@ -601,3 +612,7 @@ link_o.reliantunix-shared: link_o.reliantunix link_a.reliantunix-shared: link_a.reliantunix link_app.reliantunix-shared: link_app.reliantunix symlink.reliantunix-shared: symlink.reliantunix +link_o.beos-shared: link_o.beos +link_a.beos-shared: link_a.beos +link_app.beos-shared: link_app.gnu +symlink.beos-shared: symlink.beos diff --git a/apps/s_client.c b/apps/s_client.c index 251da63ed5..93e640c463 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -169,6 +169,10 @@ typedef unsigned int u_int; #undef FIONBIO #endif +#if defined(OPENSSL_SYS_BEOS_R5) +#include +#endif + #undef PROG #define PROG s_client_main @@ -379,8 +383,11 @@ int MAIN(int argc, char **argv) char *engine_id=NULL; ENGINE *e=NULL; #endif -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5) struct timeval tv; +#if defined(OPENSSL_SYS_BEOS_R5) + int stdin_set = 0; +#endif #endif #ifndef OPENSSL_NO_TLSEXT @@ -949,7 +956,7 @@ re_start: if (!ssl_pending) { -#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) +#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) && !defined (OPENSSL_SYS_BEOS_R5) if (tty_on) { if (read_tty) FD_SET(fileno(stdin),&readfds); @@ -1009,6 +1016,25 @@ re_start: } else i=select(width,(void *)&readfds,(void *)&writefds, NULL,NULL); } +#elif defined(OPENSSL_SYS_BEOS_R5) + /* Under BeOS-R5 the situation is similar to DOS */ + i=0; + stdin_set = 0; + (void)fcntl(fileno(stdin), F_SETFL, O_NONBLOCK); + if(!write_tty) { + if(read_tty) { + tv.tv_sec = 1; + tv.tv_usec = 0; + i=select(width,(void *)&readfds,(void *)&writefds, + NULL,&tv); + if (read(fileno(stdin), sbuf, 0) >= 0) + stdin_set = 1; + if (!i && (stdin_set != 1 || !read_tty)) + continue; + } else i=select(width,(void *)&readfds,(void *)&writefds, + NULL,NULL); + } + (void)fcntl(fileno(stdin), F_SETFL, 0); #else i=select(width,(void *)&readfds,(void *)&writefds, NULL,NULL); @@ -1089,8 +1115,8 @@ re_start: goto shut; } } -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) - /* Assume Windows/DOS can always write */ +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5) + /* Assume Windows/DOS/BeOS can always write */ else if (!ssl_pending && write_tty) #else else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds)) @@ -1178,6 +1204,8 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240 #endif #elif defined (OPENSSL_SYS_NETWARE) else if (_kbhit()) +#elif defined(OPENSSL_SYS_BEOS_R5) + else if (stdin_set) #else else if (FD_ISSET(fileno(stdin),&readfds)) #endif diff --git a/apps/s_server.c b/apps/s_server.c index 9982d6ac7e..69a2f6caf4 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -193,6 +193,10 @@ typedef unsigned int u_int; #undef FIONBIO #endif +#if defined(OPENSSL_SYS_BEOS_R5) +#include +#endif + #ifndef OPENSSL_NO_RSA static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength); #endif @@ -1511,7 +1515,7 @@ static int sv_body(char *hostname, int s, unsigned char *context) unsigned long l; SSL *con=NULL; BIO *sbio; -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5) struct timeval tv; #endif @@ -1616,7 +1620,7 @@ static int sv_body(char *hostname, int s, unsigned char *context) if (!read_from_sslcon) { FD_ZERO(&readfds); -#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) +#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_BEOS_R5) FD_SET(fileno(stdin),&readfds); #endif FD_SET(s,&readfds); @@ -1638,6 +1642,17 @@ static int sv_body(char *hostname, int s, unsigned char *context) if((i < 0) || (!i && !_kbhit() ) )continue; if(_kbhit()) read_from_terminal = 1; +#elif defined(OPENSSL_SYS_BEOS_R5) + /* Under BeOS-R5 the situation is similar to DOS */ + tv.tv_sec = 1; + tv.tv_usec = 0; + (void)fcntl(fileno(stdin), F_SETFL, O_NONBLOCK); + i=select(width,(void *)&readfds,NULL,NULL,&tv); + if ((i < 0) || (!i && read(fileno(stdin), buf, 0) < 0)) + continue; + if (read(fileno(stdin), buf, 0) >= 0) + read_from_terminal = 1; + (void)fcntl(fileno(stdin), F_SETFL, 0); #else i=select(width,(void *)&readfds,NULL,NULL,NULL); if (i <= 0) continue; diff --git a/config b/config index 6583959479..3897473f48 100755 --- a/config +++ b/config @@ -122,6 +122,14 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in echo "${MACHINE}-ibm-aix3"; exit 0 ;; + BeOS:*:BePC) + if [ -e /boot/develop/headers/be/bone ]; then + echo "beos-x86-bone"; exit 0 + else + echo "beos-x86-r5"; exit 0 + fi + ;; + dgux:*) echo "${MACHINE}-dg-dgux"; exit 0 ;; @@ -759,6 +767,7 @@ case "$GUESSOS" in t3e-cray-unicosmk) OUT="cray-t3e" ;; j90-cray-unicos) OUT="cray-j90" ;; nsr-tandem-nsk) OUT="tandem-c89" ;; + beos-*) OUT="$GUESSOS" ;; *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;; esac diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index 710a8d6d96..c8ca5923c1 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -84,6 +84,11 @@ static int wsa_init_done=0; #endif +#if defined(OPENSSL_SYS_BEOS_BONE) +/* BONE's IP6 support is incomplete */ +#undef AF_INET6 +#endif + #if 0 static unsigned long BIO_ghbn_hits=0L; static unsigned long BIO_ghbn_miss=0L; @@ -220,6 +225,10 @@ int BIO_sock_error(int sock) int j,i; int size; +#if defined(OPENSSL_SYS_BEOS_R5) + return 0; +#endif + size=sizeof(int); /* Note: under Windows the third parameter is of type (char *) * whereas under other systems it is (void *) if you don't have @@ -799,7 +808,7 @@ int BIO_accept(int sock, char **addr) if (addr == NULL) goto end; #ifdef EAI_FAMILY -# ifdef OPENSSL_SYS_VMS +# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_BEOS_BONE) # define SOCKLEN_T size_t # else # define SOCKLEN_T socklen_t diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index c21a81dc91..771003e8ac 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -341,6 +341,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) memcpy(&(data->peer), to, sizeof(struct sockaddr)); break; +#if defined(SO_RCVTIMEO) case BIO_CTRL_DGRAM_SET_RECV_TIMEOUT: if ( setsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO, ptr, sizeof(struct timeval)) < 0) @@ -351,6 +352,8 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) ptr, (void *)&ret) < 0) { perror("getsockopt"); ret = -1; } break; +#endif +#if defined(SO_SNDTIMEO) case BIO_CTRL_DGRAM_SET_SEND_TIMEOUT: if ( setsockopt(b->num, SOL_SOCKET, SO_SNDTIMEO, ptr, sizeof(struct timeval)) < 0) @@ -361,6 +364,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) ptr, (void *)&ret) < 0) { perror("getsockopt"); ret = -1; } break; +#endif case BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP: /* fall-through */ case BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP: diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 6464c53705..aa19dd7f27 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -436,6 +436,8 @@ unsigned long CRYPTO_thread_id(void) ret=(unsigned long)GetCurrentThreadId(); #elif defined(GETPID_IS_MEANINGLESS) ret=1L; +#elif defined(OPENSSL_SYS_BEOS) + ret=(unsigned long)find_thread(NULL); #else ret=(unsigned long)getpid(); #endif diff --git a/crypto/dso/Makefile b/crypto/dso/Makefile index 07f5d8d159..105d1e056b 100644 --- a/crypto/dso/Makefile +++ b/crypto/dso/Makefile @@ -18,9 +18,9 @@ APPS= LIB=$(TOP)/libcrypto.a LIBSRC= dso_dl.c dso_dlfcn.c dso_err.c dso_lib.c dso_null.c \ - dso_openssl.c dso_win32.c dso_vms.c + dso_openssl.c dso_win32.c dso_vms.c dso_beos.c LIBOBJ= dso_dl.o dso_dlfcn.o dso_err.o dso_lib.o dso_null.o \ - dso_openssl.o dso_win32.o dso_vms.o + dso_openssl.o dso_win32.o dso_vms.o dso_beos.o SRC= $(LIBSRC) diff --git a/crypto/dso/dso.h b/crypto/dso/dso.h index 8934c4ee21..3aa4f7aee5 100644 --- a/crypto/dso/dso.h +++ b/crypto/dso/dso.h @@ -322,6 +322,9 @@ int DSO_pathbyaddr(void *addr,char *path,int sz); * itself or libsocket. */ void *DSO_global_lookup(const char *name); +/* If BeOS is defined, use shared images. If not, return NULL. */ +DSO_METHOD *DSO_METHOD_beos(void); + /* BEGIN ERROR CODES */ /* The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. @@ -331,6 +334,11 @@ void ERR_load_DSO_strings(void); /* Error codes for the DSO functions. */ /* Function codes. */ +#define DSO_F_BEOS_BIND_FUNC 130 +#define DSO_F_BEOS_BIND_VAR 131 +#define DSO_F_BEOS_LOAD 132 +#define DSO_F_BEOS_NAME_CONVERTER 133 +#define DSO_F_BEOS_UNLOAD 134 #define DSO_F_DLFCN_BIND_FUNC 100 #define DSO_F_DLFCN_BIND_VAR 101 #define DSO_F_DLFCN_LOAD 102 diff --git a/crypto/dso/dso_err.c b/crypto/dso/dso_err.c index 009a543445..d7c6087a9d 100644 --- a/crypto/dso/dso_err.c +++ b/crypto/dso/dso_err.c @@ -70,6 +70,11 @@ static ERR_STRING_DATA DSO_str_functs[]= { +{ERR_FUNC(DSO_F_BEOS_BIND_FUNC), "BEOS_BIND_FUNC"}, +{ERR_FUNC(DSO_F_BEOS_BIND_VAR), "BEOS_BIND_VAR"}, +{ERR_FUNC(DSO_F_BEOS_LOAD), "BEOS_LOAD"}, +{ERR_FUNC(DSO_F_BEOS_NAME_CONVERTER), "BEOS_NAME_CONVERTER"}, +{ERR_FUNC(DSO_F_BEOS_UNLOAD), "BEOS_UNLOAD"}, {ERR_FUNC(DSO_F_DLFCN_BIND_FUNC), "DLFCN_BIND_FUNC"}, {ERR_FUNC(DSO_F_DLFCN_BIND_VAR), "DLFCN_BIND_VAR"}, {ERR_FUNC(DSO_F_DLFCN_LOAD), "DLFCN_LOAD"}, diff --git a/crypto/dso/dso_openssl.c b/crypto/dso/dso_openssl.c index a4395ebffe..b17e8e8e9e 100644 --- a/crypto/dso/dso_openssl.c +++ b/crypto/dso/dso_openssl.c @@ -74,6 +74,8 @@ DSO_METHOD *DSO_METHOD_openssl(void) return(DSO_METHOD_win32()); #elif defined(DSO_VMS) return(DSO_METHOD_vms()); +#elif defined(DSO_BEOS) + return(DSO_METHOD_beos()); #else return(DSO_METHOD_null()); #endif diff --git a/crypto/rand/rand_egd.c b/crypto/rand/rand_egd.c index 50bce6caba..d53b916ebe 100644 --- a/crypto/rand/rand_egd.c +++ b/crypto/rand/rand_egd.c @@ -95,7 +95,7 @@ * RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255. */ -#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_VOS) +#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_VOS) || defined(OPENSSL_SYS_BEOS) int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes) { return(-1); diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c index c340642515..c4838b6b2e 100644 --- a/crypto/rand/rand_unix.c +++ b/crypto/rand/rand_unix.c @@ -205,6 +205,16 @@ int RAND_poll(void) do { +#if defined(OPENSSL_SYS_BEOS_R5) + /* select() is broken in BeOS R5, so we simply + * try to read something and snooze if we couldn't: */ + r=read(fd,(unsigned char *)tmpbuf+n, + ENTROPY_NEEDED-n); + if (r > 0) + n += r; + else if (r == 0) + snooze(t.tv_usec); +#else FD_ZERO(&fset); FD_SET(fd, &fset); r = -1; @@ -218,7 +228,7 @@ int RAND_poll(void) if (r > 0) n += r; } - +#endif /* Some Unixen will update t, some won't. For those who won't, give up here, otherwise, we will do @@ -267,6 +277,14 @@ int RAND_poll(void) l=time(NULL); RAND_add(&l,sizeof(l),0.0); +#if defined(OPENSSL_SYS_BEOS) + { + system_info sysInfo; + get_system_info(&sysInfo); + RAND_add(&sysInfo,sizeof(sysInfo),0); + } +#endif + #if defined(DEVRANDOM) || defined(DEVRANDOM_EGD) return 1; #else diff --git a/crypto/threads/mttest.c b/crypto/threads/mttest.c index f6f3df4b6a..eba7aa8a6e 100644 --- a/crypto/threads/mttest.c +++ b/crypto/threads/mttest.c @@ -117,11 +117,13 @@ 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 netware_locking_callback(int mode,int type,char *file,int line); +void beos_locking_callback(int mode,int type,const char *file,int line); unsigned long irix_thread_id(void ); unsigned long solaris_thread_id(void ); unsigned long pthreads_thread_id(void ); unsigned long netware_thread_id(void ); +unsigned long beos_thread_id(void ); #if defined(OPENSSL_SYS_NETWARE) static MPKMutex *lock_cs; @@ -1209,3 +1211,100 @@ unsigned long netware_thread_id(void) return(ret); } #endif /* NETWARE */ + +#ifdef BEOS_THREADS + +#include + +static BLocker** lock_cs; +static long* lock_count; + +void thread_setup(void) + { + int i; + + lock_cs=(BLocker**)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(BLocker*)); + lock_count=(long*)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); + for (i=0; iLock(); + lock_count[type]++; + } + else + { + lock_cs[type]->Unlock(); + } + } + +void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx) + { + SSL_CTX *ssl_ctx[2]; + thread_id thread_ctx[MAX_THREAD_NUMBER]; + int i; + + ssl_ctx[0]=s_ctx; + ssl_ctx[1]=c_ctx; + + for (i=0; ireferences,c_ctx->references); + } + +unsigned long beos_thread_id(void) + { + unsigned long ret; + + ret=(unsigned long)find_thread(NULL); + return(ret); + } + +#endif /* BEOS_THREADS */ diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c index 1f23a45a33..8eabb850ff 100644 --- a/crypto/ui/ui_openssl.c +++ b/crypto/ui/ui_openssl.c @@ -473,7 +473,7 @@ static int open_console(UI *ui) CRYPTO_w_lock(CRYPTO_LOCK_UI); is_a_tty = 1; -#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) +#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS) tty_in=stdin; tty_out=stderr; #else diff --git a/e_os.h b/e_os.h index 78753de970..b8a7e35d7e 100644 --- a/e_os.h +++ b/e_os.h @@ -178,6 +178,13 @@ extern "C" { #define closesocket(s) close(s) #define readsocket(s,b,n) read((s),(b),(n)) #define writesocket(s,b,n) write((s),(char *)(b),(n)) +#elif defined(OPENSSL_SYS_BEOS_R5) +#define get_last_socket_error() errno +#define clear_socket_error() errno=0 +#define FIONBIO SO_NONBLOCK +#define ioctlsocket(a,b,c) setsockopt((a),SOL_SOCKET,(b),(c),sizeof(*(c))) +#define readsocket(s,b,n) recv((s),(b),(n),0) +#define writesocket(s,b,n) send((s),(b),(n),0) #elif defined(OPENSSL_SYS_NETWARE) #if defined(NETWARE_BSDSOCK) #define get_last_socket_error() errno @@ -519,8 +526,10 @@ static unsigned int _strlen31(const char *str) # include /* Added for FIONBIO under unixware */ # endif # include +# if !defined(OPENSSL_SYS_BEOS_R5) # include # endif +# endif # if defined(NeXT) || defined(_NEXT_SOURCE) # include @@ -661,6 +670,15 @@ struct servent *getservbyname(const char *name, const char *proto); #endif /* end vxworks */ +/* beos */ +#if defined(OPENSSL_SYS_BEOS_R5) +#define SO_ERROR 0 +#define NO_SYS_UN +#define IPPROTO_IP 0 +#include +#endif + + #ifdef __cplusplus } #endif diff --git a/e_os2.h b/e_os2.h index 9da0b65448..3f72b06786 100644 --- a/e_os2.h +++ b/e_os2.h @@ -202,6 +202,17 @@ extern "C" { # define OPENSSL_SYS_VXWORKS #endif +/* --------------------------------- BeOS ---------------------------------- */ +#if defined(__BEOS__) +# define OPENSSL_SYS_BEOS +# include +# if defined(BONE_VERSION) +# define OPENSSL_SYS_BEOS_BONE +# else +# define OPENSSL_SYS_BEOS_R5 +# endif +#endif + /** * That's it for OS-specific stuff *****************************************************************************/ diff --git a/engines/Makefile b/engines/Makefile index 88f8390d0e..4f1b458980 100644 --- a/engines/Makefile +++ b/engines/Makefile @@ -93,6 +93,7 @@ install: ( echo installing $$l; \ if [ "$(PLATFORM)" != "Cygwin" ]; then \ case "$(CFLAGS)" in \ + *DSO_BEOS*) sfx="so";; \ *DSO_DLFCN*) sfx="so";; \ *DSO_DL*) sfx="sl";; \ *) sfx="bad";; \