aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2017-01-05 17:17:52 +0100
committerBjörn-Egil Dahlberg <[email protected]>2017-02-02 09:40:27 +0100
commit120f04387ade07ef5b8b6d20a04de7d21e0c40ca (patch)
tree9346ab9a010e0c6ceeed53224b8b37c4c185545a /erts/emulator/beam
parentafbec46949f0d31448386234efa89cec78b905e1 (diff)
downloadotp-120f04387ade07ef5b8b6d20a04de7d21e0c40ca.tar.gz
otp-120f04387ade07ef5b8b6d20a04de7d21e0c40ca.tar.bz2
otp-120f04387ade07ef5b8b6d20a04de7d21e0c40ca.zip
erts: Use generic signal handler
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/atom.names14
-rw-r--r--erts/emulator/beam/bif.c14
-rw-r--r--erts/emulator/beam/bif.tab1
-rw-r--r--erts/emulator/beam/global.h3
4 files changed, 30 insertions, 2 deletions
diff --git a/erts/emulator/beam/atom.names b/erts/emulator/beam/atom.names
index 668abfaaee..72a7b9e312 100644
--- a/erts/emulator/beam/atom.names
+++ b/erts/emulator/beam/atom.names
@@ -194,6 +194,7 @@ atom current_stacktrace
atom data
atom debug_flags
atom decimals
+atom default
atom delay_trap
atom dexit
atom depth
@@ -306,6 +307,7 @@ atom global
atom Gt='>'
atom grun
atom group_leader
+atom handle
atom have_dt_utag
atom heap_block_size
atom heap_size
@@ -566,7 +568,7 @@ atom running_procs
atom runtime
atom safe
atom save_calls
-atom scheduler
+atom scheduler
atom scheduler_id
atom schedulers_online
atom scheme
@@ -594,6 +596,16 @@ atom shared
atom sighup
atom sigterm
atom sigusr1
+atom sigusr2
+atom sigill
+atom sigchld
+atom sigabrt
+atom sigalrm
+atom sigstop
+atom sigint
+atom sigsegv
+atom sigtstp
+atom sigquit
atom silent
atom size
atom sl_alloc
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c
index d886c2985e..452bfef71a 100644
--- a/erts/emulator/beam/bif.c
+++ b/erts/emulator/beam/bif.c
@@ -5273,7 +5273,7 @@ BIF_RETTYPE dt_restore_tag_1(BIF_ALIST_1)
SEQ_TRACE_TOKEN(BIF_P) = am_have_dt_utag;
}
}
-#else
+#else
if (BIF_ARG_1 != am_true) {
BIF_ERROR(BIF_P,BADARG);
}
@@ -5281,4 +5281,16 @@ BIF_RETTYPE dt_restore_tag_1(BIF_ALIST_1)
BIF_RET(am_true);
}
+BIF_RETTYPE erts_internal_set_signal_2(BIF_ALIST_2) {
+ if (is_atom(BIF_ARG_1) && ((BIF_ARG_2 == am_ignore) ||
+ (BIF_ARG_2 == am_default) ||
+ (BIF_ARG_2 == am_handle))) {
+ if (!erts_set_signal(BIF_ARG_1, BIF_ARG_2))
+ goto error;
+
+ BIF_RET(am_true);
+ }
+error:
+ BIF_ERROR(BIF_P, BADARG);
+}
diff --git a/erts/emulator/beam/bif.tab b/erts/emulator/beam/bif.tab
index 32600f4338..318a4fd264 100644
--- a/erts/emulator/beam/bif.tab
+++ b/erts/emulator/beam/bif.tab
@@ -668,6 +668,7 @@ gcbif erlang:ceil/1
bif math:floor/1
bif math:ceil/1
bif math:fmod/2
+bif erts_internal:set_signal/2
#
# Obsolete
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index 2b2f3c5cdc..f0f959e97a 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -1070,6 +1070,9 @@ void print_process_info(fmtfn_t, void *, Process*);
void info(fmtfn_t, void *);
void loaded(fmtfn_t, void *);
+/* sighandler sys.c */
+int erts_set_signal(Eterm signal, Eterm type);
+
/* erl_arith.c */
double erts_get_positive_zero_float(void);