add getpgrp support in os mod
@@ -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),
