From 348f3f2ee2d2707e30658c3600e05309ad0e72bf Mon Sep 17 00:00:00 2001
From: Lukas Larsson
Date: Thu, 10 Dec 2015 10:59:34 +0100
Subject: erts: Add enif_is_process/port_alive
---
erts/doc/src/erl_nif.xml | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
(limited to 'erts/doc')
diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml
index e62f5792a5..6befdc124b 100644
--- a/erts/doc/src/erl_nif.xml
+++ b/erts/doc/src/erl_nif.xml
@@ -532,6 +532,14 @@ typedef struct {
environment. ErlNifPid
is an opaque type.
+ ErlNifPort
+ -
+
ErlNifPort is a port identifier. In contrast to
+ port id terms (instances of ERL_NIF_TERM), ErlNifPort's are self
+ contained and not bound to any
+ environment. ErlNifPort
+ is an opaque type.
+
ErlNifResourceType
-
@@ -801,6 +809,12 @@ typedef enum {
pid variable *pid from it and return true. Otherwise return false.
No check if the process is alive is done.
+ intenif_get_local_port(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPort* port_id)
+ Read an local port term
+
If term is the port of a node local port, initialize the
+ port variable *port_id from it and return true. Otherwise return false.
+ No check if the port is alive is done.
+
intenif_get_list_cell(ErlNifEnv* env, ERL_NIF_TERM list, ERL_NIF_TERM* head, ERL_NIF_TERM* tail)
Get head and tail from a list
Set *head and *tail from
@@ -969,6 +983,17 @@ typedef enum {
Determine if a term is a port
Return true if term is a port.
+ intenif_is_port_alive(ErlNifEnv* env, ErlNifPort *port_id)
+ Determine if a local port is alive or not.
+ Return true if port_id is currently alive.
+ This function can only be used in a from a NIF-calling thread.
+
+ intenif_is_process_alive(ErlNifEnv* env, ErlNifPid *pid)
+ Determine if a local process is alive or not.
+ Return true if pid is currently alive.
+ This function is only thread-safe when the emulator with SMP support is used.
+ It can only be used in a non-SMP emulator from a NIF-calling thread.
+
intenif_is_ref(ErlNifEnv* env, ERL_NIF_TERM term)
Determine if a term is a reference
Return true if term is a reference.
--
cgit v1.2.3