diff options
Diffstat (limited to 'erts')
-rw-r--r-- | erts/configure.in | 106 | ||||
-rw-r--r-- | erts/doc/src/erlang.xml | 6 | ||||
-rw-r--r-- | erts/emulator/beam/atom.names | 10 | ||||
-rw-r--r-- | erts/emulator/beam/bif.tab | 10 | ||||
-rw-r--r-- | erts/emulator/beam/external.c | 10 | ||||
-rw-r--r-- | erts/emulator/beam/external.h | 10 | ||||
-rw-r--r-- | erts/emulator/test/binary_SUITE.erl | 10 | ||||
-rw-r--r-- | erts/epmd/src/epmd_int.h | 11 | ||||
-rw-r--r-- | erts/epmd/src/epmd_srv.c | 28 |
9 files changed, 113 insertions, 88 deletions
diff --git a/erts/configure.in b/erts/configure.in index faccf5f102..ea97d73aa8 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -1,20 +1,20 @@ dnl Process this file with autoconf to produce a configure script. -*-m4-*- dnl %CopyrightBegin% -dnl -dnl Copyright Ericsson AB 1997-2009. All Rights Reserved. -dnl +dnl +dnl Copyright Ericsson AB 1997-2010. All Rights Reserved. +dnl dnl The contents of this file are subject to the Erlang Public License, dnl Version 1.1, (the "License"); you may not use this file except in dnl compliance with the License. You should have received a copy of the dnl Erlang Public License along with this software. If not, it can be dnl retrieved online at http://www.erlang.org/. -dnl +dnl dnl Software distributed under the License is distributed on an "AS IS" dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See dnl the License for the specific language governing rights and limitations dnl under the License. -dnl +dnl dnl %CopyrightEnd% dnl The string "FIXME convbreak" means that there is a break of @@ -344,6 +344,9 @@ case $host_os in AC_MSG_WARN([Reverting to 32-bit time_t]) CPPFLAGS="$CPPFLAGS -D_USE_32BIT_TIME_T" ;; + darwin*) + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE" + ;; *) ;; esac @@ -2098,6 +2101,44 @@ if test X${enable_hipe} != Xno; then esac fi fi + +case $ARCH-$OPSYS in + amd64-darwin*|x86-darwin*) + AC_MSG_CHECKING([For modern (leopard) style mcontext_t]) + AC_TRY_COMPILE([ + #include <stdlib.h> + #include <sys/types.h> + #include <unistd.h> + #include <mach/mach.h> + #include <pthread.h> + #include <machine/signal.h> + #include <ucontext.h> + ],[ + #if defined(__APPLE__) && defined(__MACH__) && !defined(__DARWIN__) + #define __DARWIN__ 1 + #endif + + #ifndef __DARWIN__ + #error inpossible + #else + + mcontext_t mc = NULL; + int x = mc->__fs.__fpu_mxcsr; + + #endif + ],darwin_mcontext_leopard=yes, + darwin_mcontext_leopard=no) + if test X"$darwin_mcontext_leopard" = X"yes"; then + AC_DEFINE(DARWIN_MODERN_MCONTEXT,[],[Modern style mcontext_t in MacOSX]) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + ;; + *) + darwin_mcontext_leopard=no + ;; +esac if test X${enable_fp_exceptions} = Xauto ; then if test X${enable_hipe} = Xyes; then enable_fp_exceptions=yes @@ -2487,6 +2528,7 @@ static void fpe_sig_action(int sig, siginfo_t *si, void *puc) regs[PT_FPSCR] = 0x80|0x40|0x10; /* VE, OE, ZE; not UE or XE */ #endif #elif defined(__DARWIN__) +#if defined(DARWIN_MODERN_MCONTEXT) #if defined(__x86_64__) mcontext_t mc = uc->uc_mcontext; struct __darwin_x86_float_state64 *fpstate = &mc->__fs; @@ -2502,6 +2544,23 @@ static void fpe_sig_action(int sig, siginfo_t *si, void *puc) mc->ss.srr0 += 4; mc->fs.fpscr = 0x80|0x40|0x10; #endif +#else +#if defined(__x86_64__) + mcontext_t mc = uc->uc_mcontext; + struct x86_float_state64_t *fpstate = &mc->fs; + fpstate->fpu_mxcsr = 0x1F80; + *(unsigned short *)&fpstate->fpu_fsw &= ~0xFF; +#elif defined(__i386__) + mcontext_t mc = uc->uc_mcontext; + x86_float_state32_t *fpstate = &mc->fs; + fpstate->fpu_mxcsr = 0x1F80; + *(unsigned short *)&fpstate->fpu_fsw &= ~0xFF; +#elif defined(__ppc__) + mcontext_t mc = uc->uc_mcontext; + mc->ss.srr0 += 4; + mc->fs.fpscr = 0x80|0x40|0x10; +#endif +#endif #elif defined(__FreeBSD__) && defined(__x86_64__) mcontext_t *mc = &uc->uc_mcontext; struct savefpu *savefpu = (struct savefpu*)&mc->mc_fpstate; @@ -2615,43 +2674,6 @@ fi) fi fi -case $ARCH-$OPSYS in - amd64-darwin*|x86-darwin*) - AC_MSG_CHECKING([For modern (leopard) style mcontext_t]) - AC_TRY_COMPILE([ - #include <stdlib.h> - #include <sys/types.h> - #include <unistd.h> - #include <mach/mach.h> - #include <pthread.h> - #include <machine/signal.h> - #include <ucontext.h> - ],[ - #if defined(__APPLE__) && defined(__MACH__) && !defined(__DARWIN__) - #define __DARWIN__ 1 - #endif - - #ifndef __DARWIN__ - #error inpossible - #else - - mcontext_t mc = NULL; - int x = mc->__fs.__fpu_mxcsr; - - #endif - ],darwin_mcontext_leopard=yes, - darwin_mcontext_leopard=no) - if test X"$darwin_mcontext_leopard" = X"yes"; then - AC_DEFINE(DARWIN_MODERN_MCONTEXT,[],[Modern style mcontext_t in MacOSX]) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi - ;; - *) - darwin_mcontext_leopard=no - ;; -esac diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 2541aa700b..4a401156d1 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4,7 +4,7 @@ <erlref> <header> <copyright> - <year>1996</year><year>2009</year> + <year>1996</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>erlang</title> diff --git a/erts/emulator/beam/atom.names b/erts/emulator/beam/atom.names index 117c4767c1..3ce26c4a7a 100644 --- a/erts/emulator/beam/atom.names +++ b/erts/emulator/beam/atom.names @@ -1,19 +1,19 @@ # # %CopyrightBegin% -# -# Copyright Ericsson AB 1996-2009. All Rights Reserved. -# +# +# Copyright Ericsson AB 1996-2010. All Rights Reserved. +# # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in # compliance with the License. You should have received a copy of the # Erlang Public License along with this software. If not, it can be # retrieved online at http://www.erlang.org/. -# +# # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. -# +# # %CopyrightEnd% # diff --git a/erts/emulator/beam/bif.tab b/erts/emulator/beam/bif.tab index ecc6c4699f..b6fa06354a 100644 --- a/erts/emulator/beam/bif.tab +++ b/erts/emulator/beam/bif.tab @@ -1,19 +1,19 @@ # # %CopyrightBegin% -# -# Copyright Ericsson AB 1996-2009. All Rights Reserved. -# +# +# Copyright Ericsson AB 1996-2010. All Rights Reserved. +# # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in # compliance with the License. You should have received a copy of the # Erlang Public License along with this software. If not, it can be # retrieved online at http://www.erlang.org/. -# +# # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. -# +# # %CopyrightEnd% # diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c index 088a551329..f380e7732e 100644 --- a/erts/emulator/beam/external.c +++ b/erts/emulator/beam/external.c @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 1996-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ diff --git a/erts/emulator/beam/external.h b/erts/emulator/beam/external.h index 727333d539..eada6d4f27 100644 --- a/erts/emulator/beam/external.h +++ b/erts/emulator/beam/external.h @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 1996-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ diff --git a/erts/emulator/test/binary_SUITE.erl b/erts/emulator/test/binary_SUITE.erl index 83b815b883..44b6bbe785 100644 --- a/erts/emulator/test/binary_SUITE.erl +++ b/erts/emulator/test/binary_SUITE.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% diff --git a/erts/epmd/src/epmd_int.h b/erts/epmd/src/epmd_int.h index b120b44579..65fcf9bacb 100644 --- a/erts/epmd/src/epmd_int.h +++ b/erts/epmd/src/epmd_int.h @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 1998-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ /* @@ -294,6 +294,7 @@ struct enode { char protocol; /* 0 = tcp/ipv4 */ unsigned short highvsn; /* 0 = OTP-R3 erts-4.6.x, 1 = OTP-R4 erts-4.7.x*/ unsigned short lowvsn; + int extralen; char extra[MAXSYMLEN+1]; }; diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c index b71e27cffd..a033fab244 100644 --- a/erts/epmd/src/epmd_srv.c +++ b/erts/epmd/src/epmd_srv.c @@ -1,20 +1,20 @@ /* -*- c-indent-level: 2; c-continued-statement-offset: 2 -*- */ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 1998-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ @@ -99,7 +99,7 @@ static int conn_close_fd(EpmdVars*,int); static void node_init(EpmdVars*); static Node *node_reg(EpmdVars*,char*,int,int); -static Node *node_reg2(EpmdVars*,char*, int, int, unsigned char, unsigned char, int, int, char*); +static Node *node_reg2(EpmdVars*,char*, int, int, unsigned char, unsigned char, int, int, int, char*); static int node_unreg(EpmdVars*,char*); static int node_unreg_sock(EpmdVars*,int); @@ -558,11 +558,11 @@ static void do_request(g, fd, s, buf, bsize) } name = &buf[11]; name[namelen]='\000'; - extra = &buf[11+namelen+1]; + extra = &buf[11+namelen+2]; extra[extralen]='\000'; wbuf[0] = EPMD_ALIVE2_RESP; if ((node = node_reg2(g, name, fd, eport, nodetype, protocol, - highvsn, lowvsn, extra)) == NULL) { + highvsn, lowvsn, extralen, extra)) == NULL) { wbuf[1] = 1; /* error */ put_int16(99, wbuf+2); } else { @@ -622,10 +622,10 @@ static void do_request(g, fd, s, buf, bsize) offset = 12; strcpy(wbuf + offset,node->symname); offset += strlen(node->symname); - put_int16(strlen(node->extra),wbuf + offset); + put_int16(node->extralen,wbuf + offset); offset += 2; - strcpy(wbuf + offset,node->extra); - offset += (strlen(node->extra)-1); + memcpy(wbuf + offset,node->extra,node->extralen); + offset += node->extralen; if (reply(g, fd, wbuf, offset) != offset) { dbg_tty_printf(g,1,"** failed to send PORT2_RESP (ok) for \"%s\"",name); @@ -994,7 +994,7 @@ static int node_unreg_sock(EpmdVars *g,int fd) static Node *node_reg(EpmdVars *g,char *name,int fd, int port) { - return node_reg2(g, name, fd, port, 0, 0, 0, 0, NULL); + return node_reg2(g, name, fd, port, 0, 0, 0, 0, 0, NULL); } static Node *node_reg2(EpmdVars *g, @@ -1005,6 +1005,7 @@ static Node *node_reg2(EpmdVars *g, unsigned char protocol, int highvsn, int lowvsn, + int extralen, char* extra) { Node *prev; /* Point to previous node or NULL */ @@ -1103,7 +1104,8 @@ static Node *node_reg2(EpmdVars *g, node->protocol = protocol; node->highvsn = highvsn; node->lowvsn = lowvsn; - strcpy(node->extra,extra); + node->extralen = extralen; + memcpy(node->extra,extra,extralen); strcpy(node->symname,name); FD_SET(fd,&g->orig_read_mask); |