aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/nif_SUITE_data
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-02-01 11:01:40 +0100
committerLukas Larsson <[email protected]>2016-03-29 14:57:11 +0200
commit209c5cf22b5cdc70eb48e6afdcddfa7132471aab (patch)
tree7995d9164900ec2bba0a864ea78520e0e908ad4f /erts/emulator/test/nif_SUITE_data
parent1bd56e2b5141a3afdca4e854e9b667807bf4e2f3 (diff)
downloadotp-209c5cf22b5cdc70eb48e6afdcddfa7132471aab.tar.gz
otp-209c5cf22b5cdc70eb48e6afdcddfa7132471aab.tar.bz2
otp-209c5cf22b5cdc70eb48e6afdcddfa7132471aab.zip
erts: Add enif_port_command
Diffstat (limited to 'erts/emulator/test/nif_SUITE_data')
-rw-r--r--erts/emulator/test/nif_SUITE_data/nif_SUITE.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/erts/emulator/test/nif_SUITE_data/nif_SUITE.c b/erts/emulator/test/nif_SUITE_data/nif_SUITE.c
index 9db7614405..317f440257 100644
--- a/erts/emulator/test/nif_SUITE_data/nif_SUITE.c
+++ b/erts/emulator/test/nif_SUITE_data/nif_SUITE.c
@@ -2079,6 +2079,18 @@ static ERL_NIF_TERM binary_to_term(ErlNifEnv* env, int argc, const ERL_NIF_TERM
}
}
+static ERL_NIF_TERM port_command(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ ErlNifPort port;
+
+ if (!enif_get_local_port(env, argv[0], &port))
+ return enif_make_badarg(env);
+
+ if (!enif_port_command(env, &port, NULL, argv[1]))
+ return enif_make_badarg(env);
+ return atom_true;
+}
+
static ErlNifFunc nif_funcs[] =
{
{"lib_version", 0, lib_version},
@@ -2158,7 +2170,8 @@ static ErlNifFunc nif_funcs[] =
{"is_process_alive_nif", 1, is_process_alive},
{"is_port_alive_nif", 1, is_port_alive},
{"term_to_binary_nif", 2, term_to_binary},
- {"binary_to_term_nif", 2, binary_to_term}
+ {"binary_to_term_nif", 2, binary_to_term},
+ {"port_command_nif", 2, port_command}
};
ERL_NIF_INIT(nif_SUITE,nif_funcs,load,reload,upgrade,unload)