From e2277e240790930563b0833854e7bc6a8338cf5c Mon Sep 17 00:00:00 2001 From: Matthias Lang Date: Thu, 19 Aug 2010 15:12:26 +0200 Subject: 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. --- erts/emulator/sys/unix/sys.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'erts/emulator/sys/unix/sys.c') diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c index f94e0f2296..bf69f3bf90 100644 --- a/erts/emulator/sys/unix/sys.c +++ b/erts/emulator/sys/unix/sys.c @@ -1163,6 +1163,8 @@ static int set_driver_data(int port_num, report_exit_list = report_exit; } + erts_port[port_num].os_pid = pid; + if (read_write & DO_READ) { driver_data[ifd].packet_bytes = packet_bytes; driver_data[ifd].port_num = port_num; -- cgit v1.2.3