diff options
author | Matthias Lang <[email protected]> | 2010-08-19 15:12:26 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2012-03-16 15:46:50 +0100 |
commit | d4667d383964c1550e0a91d64b674e84f6d07e3b (patch) | |
tree | 68b0ff1251df66b2e211951ff8748d1ee72c0998 /erts/emulator/sys/unix | |
parent | 8406f47252a5f1fd38cd771aa7fa692817677709 (diff) | |
download | otp-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/sys/unix')
-rw-r--r-- | erts/emulator/sys/unix/sys.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |