Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
2832-erl_interface-Change-creation-arg-to-from-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2832-erl_interface-Change-creation-arg-to-from-16-to-32-b.patch of Package erlang
From dec550e30b316952578e93540491a41f0aa2e61b Mon Sep 17 00:00:00 2001 From: Sverker Eriksson <sverker@erlang.org> Date: Mon, 1 Nov 2021 23:21:52 +0100 Subject: [PATCH 2/8] erl_interface: Change 'creation' arg to from 16 to 32 bit integer This is technically an incompatible API change. But in practice with existing calling conventions it should work. We may get some garbage bits in the high 16 bits of the 'creation' argument, but that doesn't really matter as the actual value used for creation is not critical. --- lib/erl_interface/doc/src/ei_connect.xml | 20 ++++++++++++++------ lib/erl_interface/include/ei.h | 8 ++++---- lib/erl_interface/src/connect/ei_connect.c | 8 ++++---- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/lib/erl_interface/doc/src/ei_connect.xml b/lib/erl_interface/doc/src/ei_connect.xml index f380c95b38..c591c3a6da 100644 --- a/lib/erl_interface/doc/src/ei_connect.xml +++ b/lib/erl_interface/doc/src/ei_connect.xml @@ -541,10 +541,10 @@ fd = ei_xconnect(&ec, &addr, ALIVE); </func> <func> - <name since=""><ret>int</ret><nametext>ei_connect_init(ei_cnode* ec, const char* this_node_name, const char *cookie, short creation)</nametext></name> - <name since="OTP 21.3"><ret>int</ret><nametext>ei_connect_init_ussi(ei_cnode* ec, const char* this_node_name, const char *cookie, short creation, ei_socket_callbacks *cbs, int cbs_sz, void *setup_context)</nametext></name> - <name since=""><ret>int</ret><nametext>ei_connect_xinit(ei_cnode* ec, const char *thishostname, const char *thisalivename, const char *thisnodename, Erl_IpAddr thisipaddr, const char *cookie, short creation)</nametext></name> - <name since="OTP 21.3"><ret>int</ret><nametext>ei_connect_xinit_ussi(ei_cnode* ec, const char *thishostname, const char *thisalivename, const char *thisnodename, Erl_IpAddr thisipaddr, const char *cookie, short creation, ei_socket_callbacks *cbs, int cbs_sz, void *setup_context)</nametext></name> + <name since=""><ret>int</ret><nametext>ei_connect_init(ei_cnode* ec, const char* this_node_name, const char *cookie, unsigned creation)</nametext></name> + <name since="OTP 21.3"><ret>int</ret><nametext>ei_connect_init_ussi(ei_cnode* ec, const char* this_node_name, const char *cookie, unsigned creation, ei_socket_callbacks *cbs, int cbs_sz, void *setup_context)</nametext></name> + <name since=""><ret>int</ret><nametext>ei_connect_xinit(ei_cnode* ec, const char *thishostname, const char *thisalivename, const char *thisnodename, Erl_IpAddr thisipaddr, const char *cookie, unsigned creation)</nametext></name> + <name since="OTP 21.3"><ret>int</ret><nametext>ei_connect_xinit_ussi(ei_cnode* ec, const char *thishostname, const char *thisalivename, const char *thisnodename, Erl_IpAddr thisipaddr, const char *cookie, unsigned creation, ei_socket_callbacks *cbs, int cbs_sz, void *setup_context)</nametext></name> <fsummary>Initialize for a connection.</fsummary> <type> <v><seecref marker="#ei_cnode"><c>ei_cnode</c></seecref></v> @@ -573,7 +573,15 @@ fd = ei_xconnect(&ec, &addr, ALIVE); <item> <p><c>creation</c> identifies a specific instance of a C-node. It can help prevent the node from receiving messages - sent to an earlier process with the same registered name.</p> + sent to an earlier process with the same registered name.</p> + <note> + <p> + The type of the <c>creation</c> argument was changed from + <c>short</c> (16 bit) to <c>unsigned int</c> (32 bit) in OTP + 25. This should cause no practical problem other than maybe a + compiler warning. + </p> + </note> </item> <item> <p><c>thishostname</c> is the name of the machine we are @@ -620,7 +628,7 @@ fd = ei_xconnect(&ec, &addr, ALIVE); occurred.</p> <p><em>Example 1:</em></p> <code type="none"><![CDATA[ -int n = 0; +unsigned n = 0; struct in_addr addr; ei_cnode ec; addr.s_addr = inet_addr("150.236.14.75"); diff --git a/lib/erl_interface/include/ei.h b/lib/erl_interface/include/ei.h index f171bf1a8d..e174a113d2 100644 --- a/lib/erl_interface/include/ei.h +++ b/lib/erl_interface/include/ei.h @@ -397,20 +397,20 @@ typedef struct ei_x_buff_TAG { /* Handle the connection */ int ei_connect_init(ei_cnode* ec, const char* this_node_name, - const char *cookie, short creation); + const char *cookie, unsigned int creation); int ei_connect_xinit (ei_cnode* ec, const char *thishostname, const char *thisalivename, const char *thisnodename, Erl_IpAddr thisipaddr, const char *cookie, - const short creation); + unsigned int creation); int ei_connect_init_ussi(ei_cnode* ec, const char* this_node_name, - const char *cookie, short creation, + const char *cookie, unsigned int creation, ei_socket_callbacks *cbs, int cbs_sz, void *setup_context); int ei_connect_xinit_ussi(ei_cnode* ec, const char *thishostname, const char *thisalivename, const char *thisnodename, Erl_IpAddr thisipaddr, const char *cookie, - const short creation, ei_socket_callbacks *cbs, + unsigned int creation, ei_socket_callbacks *cbs, int cbs_sz, void *setup_context); int ei_connect(ei_cnode* ec, char *nodename); diff --git a/lib/erl_interface/src/connect/ei_connect.c b/lib/erl_interface/src/connect/ei_connect.c index d15fed23b3..c733ea348c 100644 --- a/lib/erl_interface/src/connect/ei_connect.c +++ b/lib/erl_interface/src/connect/ei_connect.c @@ -902,7 +902,7 @@ int ei_init_connect(void) int ei_connect_xinit_ussi(ei_cnode* ec, const char *thishostname, const char *thisalivename, const char *thisnodename, Erl_IpAddr thisipaddr, const char *cookie, - const short creation, ei_socket_callbacks *cbs, + unsigned int creation, ei_socket_callbacks *cbs, int cbs_sz, void *setup_context) { char *dbglevel; @@ -981,7 +981,7 @@ int ei_connect_xinit_ussi(ei_cnode* ec, const char *thishostname, int ei_connect_xinit(ei_cnode* ec, const char *thishostname, const char *thisalivename, const char *thisnodename, Erl_IpAddr thisipaddr, const char *cookie, - const short creation) + unsigned int creation) { return ei_connect_xinit_ussi(ec, thishostname, thisalivename, thisnodename, thisipaddr, cookie, creation, @@ -996,7 +996,7 @@ int ei_connect_xinit(ei_cnode* ec, const char *thishostname, * otherwise return -1. */ int ei_connect_init_ussi(ei_cnode* ec, const char* this_node_name, - const char *cookie, short creation, + const char *cookie, unsigned int creation, ei_socket_callbacks *cbs, int cbs_sz, void *setup_context) { @@ -1077,7 +1077,7 @@ int ei_connect_init_ussi(ei_cnode* ec, const char* this_node_name, } int ei_connect_init(ei_cnode* ec, const char* this_node_name, - const char *cookie, short creation) + const char *cookie, unsigned int creation) { return ei_connect_init_ussi(ec, this_node_name, cookie, creation, &ei_default_socket_callbacks, -- 2.31.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor