aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_bif_info.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2012-04-18 11:56:19 +0200
committerPatrik Nyblom <[email protected]>2012-04-18 11:56:19 +0200
commitcff02d4925bfd6ed88d9d7b897f4b4416e4643ce (patch)
treeedb748eddafa80d084cf5ef271d68b042d8f0a80 /erts/emulator/beam/erl_bif_info.c
parent00668f8cbae565d482e9ad72a63f846cef8e8071 (diff)
parenta76628f8f0de895e318c11585a53983e476d692c (diff)
downloadotp-cff02d4925bfd6ed88d9d7b897f4b4416e4643ce.tar.gz
otp-cff02d4925bfd6ed88d9d7b897f4b4416e4643ce.tar.bz2
otp-cff02d4925bfd6ed88d9d7b897f4b4416e4643ce.zip
Merge branch 'maint'
Conflicts: lib/hipe/cerl/erl_bif_types.erl
Diffstat (limited to 'erts/emulator/beam/erl_bif_info.c')
-rwxr-xr-x[-rw-r--r--]erts/emulator/beam/erl_bif_info.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index 060a52d220..2373dc7af4 100644..100755
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -2765,7 +2765,8 @@ port_info_1(BIF_ALIST_1)
am_id,
am_connected,
am_input,
- am_output
+ am_output,
+ am_os_pid
};
Eterm items[ASIZE(keys)];
Eterm result = NIL;
@@ -2822,6 +2823,7 @@ port_info_1(BIF_ALIST_1)
** name String
** input Number of bytes input from port program
** output Number of bytes output to the port program
+** os_pid The child's process ID
*/
BIF_RETTYPE port_info_2(BIF_ALIST_2)
@@ -2922,6 +2924,18 @@ static BIF_RETTYPE port_info(Process* p, Eterm portid, Eterm item)
hp = HAlloc(p, hsz);
res = erts_bld_uint(&hp, NULL, n);
}
+ else if (item == am_os_pid) {
+ if (prt->os_pid >= 0) {
+ Uint hsz = 3;
+ UWord n = prt->os_pid;
+ (void) erts_bld_uword(NULL, &hsz, n);
+ hp = HAlloc(p, hsz);
+ res = erts_bld_uword(&hp, NULL, n);
+ } else {
+ hp = HAlloc(p, 3);
+ res = am_undefined;
+ }
+ }
else if (item == am_registered_name) {
RegProc *reg;
reg = prt->reg;