diff --git a/vm/src/stdlib/os.rs b/vm/src/stdlib/os.rs index e70061bc26..8bfc4a5a8f 100644 --- a/vm/src/stdlib/os.rs +++ b/vm/src/stdlib/os.rs @@ -1194,6 +1194,11 @@ fn os_getpgid(pid: u32, vm: &VirtualMachine) -> PyResult { } } +#[cfg(unix)] +fn os_getpgrp(vm: &VirtualMachine) -> PyResult { + Ok(vm.new_int(unistd::getpgrp().as_raw())) +} + #[cfg(all(unix, not(target_os = "redox")))] fn os_getsid(pid: u32, vm: &VirtualMachine) -> PyResult { match unistd::getsid(Some(Pid::from_raw(pid as i32))) { @@ -1620,6 +1625,7 @@ fn extend_module_platform_specific(vm: &VirtualMachine, module: &PyObjectRef) { "getegid" => ctx.new_function(os_getegid), "getpgid" => ctx.new_function(os_getpgid), "getuid" => ctx.new_function(os_getuid), + "getpgrp" => ctx.new_function(os_getpgrp), "geteuid" => ctx.new_function(os_geteuid), "pipe" => ctx.new_function(os_pipe), //TODO: windows "set_blocking" => ctx.new_function(os_set_blocking),