Skip to content

Commit a80d48b

Browse files
committed
add getpgrp support in os mod
1 parent fef6eb4 commit a80d48b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vm/src/stdlib/os.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,11 @@ fn os_getpgid(pid: u32, vm: &VirtualMachine) -> PyResult {
11941194
}
11951195
}
11961196

1197+
#[cfg(unix)]
1198+
fn os_getpgrp(vm: &VirtualMachine) -> PyResult {
1199+
Ok(vm.new_int(unistd::getpgrp().as_raw()))
1200+
}
1201+
11971202
#[cfg(all(unix, not(target_os = "redox")))]
11981203
fn os_getsid(pid: u32, vm: &VirtualMachine) -> PyResult {
11991204
match unistd::getsid(Some(Pid::from_raw(pid as i32))) {
@@ -1620,6 +1625,7 @@ fn extend_module_platform_specific(vm: &VirtualMachine, module: &PyObjectRef) {
16201625
"getegid" => ctx.new_function(os_getegid),
16211626
"getpgid" => ctx.new_function(os_getpgid),
16221627
"getuid" => ctx.new_function(os_getuid),
1628+
"getpgrp" => ctx.new_function(os_getpgrp),
16231629
"geteuid" => ctx.new_function(os_geteuid),
16241630
"pipe" => ctx.new_function(os_pipe), //TODO: windows
16251631
"set_blocking" => ctx.new_function(os_set_blocking),

0 commit comments

Comments
 (0)