We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aff0e3c commit 2f08be5Copy full SHA for 2f08be5
vm/src/stdlib/os.rs
@@ -776,6 +776,19 @@ mod _os {
776
Ok(())
777
}
778
779
+ #[cfg(unix)]
780
+ #[pyfunction]
781
+ fn nice(increment: i32, vm: &VirtualMachine) -> PyResult<i32> {
782
+ use nix::errno::{errno, Errno};
783
+ Errno::clear();
784
+ let res = unsafe { libc::nice(increment) };
785
+ if res == -1 && errno() != 0 {
786
+ Err(errno_err(vm))
787
+ } else {
788
+ Ok(res)
789
+ }
790
791
+
792
#[pyfunction]
793
fn readlink(path: PyPathLike, dir_fd: DirFd<0>, vm: &VirtualMachine) -> PyResult {
794
let mode = path.mode;
0 commit comments