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/beam/global.h | 1 + 1 file changed, 1 insertion(+) (limited to 'erts/emulator/beam/global.h') diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h index fc4c0ba121..9f99afd641 100644 --- a/erts/emulator/beam/global.h +++ b/erts/emulator/beam/global.h @@ -173,6 +173,7 @@ struct port { char *name; /* String used in the open */ erts_driver_t* drv_ptr; UWord drv_data; + pid_t os_pid; /* Child process ID */ ErtsProcList *suspended; /* List of suspended processes. */ LineBuf *linebuf; /* Buffer to hold data not ready for process to get (line oriented I/O)*/ -- cgit v1.2.3 From 3985e56bfa82083b23978e06809b8ab0cf9d52d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 16 Mar 2012 17:59:00 +0100 Subject: Make port_info(Port,os_pid) work on Windows --- erts/emulator/beam/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 erts/emulator/beam/global.h (limited to 'erts/emulator/beam/global.h') diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h old mode 100644 new mode 100755 index 9f99afd641..894872dbc0 --- a/erts/emulator/beam/global.h +++ b/erts/emulator/beam/global.h @@ -173,7 +173,7 @@ struct port { char *name; /* String used in the open */ erts_driver_t* drv_ptr; UWord drv_data; - pid_t os_pid; /* Child process ID */ + SWord os_pid; /* Child process ID */ ErtsProcList *suspended; /* List of suspended processes. */ LineBuf *linebuf; /* Buffer to hold data not ready for process to get (line oriented I/O)*/ -- cgit v1.2.3