aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/io.c
diff options
context:
space:
mode:
authorMatthias Lang <[email protected]>2010-08-19 15:12:26 +0200
committerBjörn-Egil Dahlberg <[email protected]>2012-03-16 15:46:50 +0100
commitd4667d383964c1550e0a91d64b674e84f6d07e3b (patch)
tree68b0ff1251df66b2e211951ff8748d1ee72c0998 /erts/emulator/beam/io.c
parent8406f47252a5f1fd38cd771aa7fa692817677709 (diff)
downloadotp-d4667d383964c1550e0a91d64b674e84f6d07e3b.tar.gz
otp-d4667d383964c1550e0a91d64b674e84f6d07e3b.tar.bz2
otp-d4667d383964c1550e0a91d64b674e84f6d07e3b.zip
Extend erlang:port_info/1,2 to show the OS pid of a spawned process
When spawning OS (unix) processes with erlang:open_port, store the resulting unix pid so that it can be queried later on using erlang:port_info/1,2.
Diffstat (limited to 'erts/emulator/beam/io.c')
-rw-r--r--erts/emulator/beam/io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index b23b1f628d..3deb386621 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -425,6 +425,7 @@ setup_port(Port* prt, Eterm pid, erts_driver_t *driver,
sys_strcpy(new_name, name);
erts_smp_runq_lock(runq);
erts_smp_port_state_lock(prt);
+ prt->os_pid = -1;
prt->status = ERTS_PORT_SFLG_CONNECTED | xstatus;
prt->snapshot = erts_smp_atomic32_read_nob(&erts_ports_snapshot);
old_name = prt->name;