aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2015-07-14 11:07:33 +0200
committerLukas Larsson <[email protected]>2015-12-15 10:05:43 +0100
commit91c1876f70870f450f7e8fd3b02f2396067e3cb8 (patch)
tree7b934e29cae28d7ab4467f4d37aaa6d769100555 /erts/emulator/beam
parent4b98e710b9c45481c1cdc7a4ee68f7ce7fca908a (diff)
downloadotp-91c1876f70870f450f7e8fd3b02f2396067e3cb8.tar.gz
otp-91c1876f70870f450f7e8fd3b02f2396067e3cb8.tar.bz2
otp-91c1876f70870f450f7e8fd3b02f2396067e3cb8.zip
erts: Add erl_drv_set_pid
OTP-13087
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_driver.h3
-rw-r--r--erts/emulator/beam/io.c11
2 files changed, 14 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_driver.h b/erts/emulator/beam/erl_driver.h
index 5f2115ef7f..3d663655a2 100644
--- a/erts/emulator/beam/erl_driver.h
+++ b/erts/emulator/beam/erl_driver.h
@@ -694,6 +694,9 @@ EXTERN int erl_drv_getenv(char *key, char *value, size_t *value_size);
/* spawn start init ack */
EXTERN void erl_drv_init_ack(ErlDrvPort ix, ErlDrvData res);
+/* set the pid seen in port_info */
+EXTERN void erl_drv_set_os_pid(ErlDrvPort ix, ErlDrvSInt pid);
+
#endif /* !ERL_DRIVER_TYPES_ONLY */
#ifdef WIN32_DYNAMIC_ERL_DRIVER
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index 409df846e9..2a3759212e 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -2789,6 +2789,17 @@ erl_drv_init_ack(ErlDrvPort ix, ErlDrvData res) {
}
}
+void
+erl_drv_set_os_pid(ErlDrvPort ix, ErlDrvSInt pid) {
+ Port *port = erts_drvport2port(ix);
+
+ if (port == ERTS_INVALID_ERL_DRV_PORT)
+ return;
+
+ port->os_pid = (SWord)pid;
+
+}
+
void erts_init_io(int port_tab_size,
int port_tab_size_ignore_files,
int legacy_port_tab)