Skip to content

Commit 88c5a7c

Browse files
committed
more const
1 parent 7250b1f commit 88c5a7c

File tree

1 file changed

+25
-1
lines changed
  • crates/vm/src/stdlib

1 file changed

+25
-1
lines changed

crates/vm/src/stdlib/nt.rs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,31 @@ pub(crate) mod module {
3535
};
3636

3737
#[pyattr]
38-
use libc::{O_BINARY, O_TEMPORARY};
38+
use libc::{O_BINARY, O_NOINHERIT, O_RANDOM, O_SEQUENTIAL, O_TEMPORARY, O_TEXT};
39+
40+
// Windows spawn mode constants
41+
#[pyattr]
42+
const P_WAIT: i32 = 0;
43+
#[pyattr]
44+
const P_NOWAIT: i32 = 1;
45+
#[pyattr]
46+
const P_OVERLAY: i32 = 2;
47+
#[pyattr]
48+
const P_NOWAITO: i32 = 3;
49+
#[pyattr]
50+
const P_DETACH: i32 = 4;
51+
52+
// _O_SHORT_LIVED is not in libc, define manually
53+
#[pyattr]
54+
const O_SHORT_LIVED: i32 = 0x1000;
55+
56+
// Exit code constant
57+
#[pyattr]
58+
const EX_OK: i32 = 0;
59+
60+
// Maximum number of temporary files
61+
#[pyattr]
62+
const TMP_MAX: i32 = i32::MAX;
3963

4064
#[pyattr]
4165
use windows_sys::Win32::System::LibraryLoader::{

0 commit comments

Comments
 (0)