aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/dist.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-02-26 15:36:34 +0100
committerSverker Eriksson <[email protected]>2018-03-02 19:16:48 +0100
commit337919abe6ed9a97e15d5f471ef8f79d44cb8363 (patch)
treeea9669087d2a27cf1fede34ba802995b9d0d56e1 /erts/emulator/beam/dist.c
parent9a472f2899519234198f677269c5e70362bec351 (diff)
downloadotp-337919abe6ed9a97e15d5f471ef8f79d44cb8363.tar.gz
otp-337919abe6ed9a97e15d5f471ef8f79d44cb8363.tar.bz2
otp-337919abe6ed9a97e15d5f471ef8f79d44cb8363.zip
erts,kernel: Add erts_internal:get_dflags/0
for kernel to ask erts about distribution flags and keep this info in one place.
Diffstat (limited to 'erts/emulator/beam/dist.c')
-rw-r--r--erts/emulator/beam/dist.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c
index 30390cdb5e..6f122273dc 100644
--- a/erts/emulator/beam/dist.c
+++ b/erts/emulator/beam/dist.c
@@ -641,6 +641,13 @@ trap_function(Eterm func, int arity)
return erts_export_put(am_erlang, func, arity);
}
+/*
+ * Sync with dist_util.erl:
+ *
+ * -record(erts_dflags, {default, mandatory, addable, rejectable}).
+ */
+static Eterm erts_dflags_record;
+
void init_dist(void)
{
init_nodes_monitors();
@@ -657,6 +664,15 @@ void init_dist(void)
dist_ctrl_put_data_trap = erts_export_put(am_erts_internal,
am_dist_ctrl_put_data,
2);
+ {
+ Eterm* hp = erts_alloc(ERTS_ALC_T_LITERAL, (1+5)*sizeof(Eterm));
+ erts_dflags_record = TUPLE5(hp, am_erts_dflags,
+ make_small(DFLAG_DIST_DEFAULT),
+ make_small(DFLAG_DIST_MANDATORY),
+ make_small(DFLAG_DIST_ADDABLE),
+ make_small(DFLAG_DIST_REJECTABLE));
+ erts_set_literal_tag(&erts_dflags_record, hp, (1+5));
+ }
}
#define ErtsDistOutputBuf2Binary(OB) \
@@ -3506,6 +3522,11 @@ BIF_RETTYPE setnode_3(BIF_ALIST_3)
goto done;
}
+BIF_RETTYPE erts_internal_get_dflags_0(BIF_ALIST_0)
+{
+ return erts_dflags_record;
+}
+
BIF_RETTYPE erts_internal_new_connection_1(BIF_ALIST_1)
{
DistEntry* dep;