about summary refs log tree commit diff
path: root/library/std/src/sys
diff options
context:
space:
mode:
authorAyush Singh <ayush@beagleboard.org>2025-04-10 10:40:50 +0530
committerAyush Singh <ayush@beagleboard.org>2025-04-13 23:22:59 +0530
commitd994fef7495ecbc1e18c95588253869f3a765edf (patch)
tree583b87f1925c5da76fba25bd69e1541aaee0e233 /library/std/src/sys
parentaf25995d11f8630a071a7f4776f0798d22942a9f (diff)
downloadrust-d994fef7495ecbc1e18c95588253869f3a765edf.tar.gz
rust-d994fef7495ecbc1e18c95588253869f3a765edf.zip
std: sys: process: uefi: Allow specifying Stdin
Stdio::MakePipe is not supported.

For Stdio::Null, return UNSUPPORTED. This is treated as read(0).
Additionally, have infinte loop on the notify function to prevent
wait_for_key from returning.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Diffstat (limited to 'library/std/src/sys')
-rw-r--r--library/std/src/sys/process/uefi.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/library/std/src/sys/process/uefi.rs b/library/std/src/sys/process/uefi.rs
index fb5aa5ca266..5f922292d05 100644
--- a/library/std/src/sys/process/uefi.rs
+++ b/library/std/src/sys/process/uefi.rs
@@ -23,6 +23,7 @@ pub struct Command {
     args: Vec<OsString>,
     stdout: Option<Stdio>,
     stderr: Option<Stdio>,
+    stdin: Option<Stdio>,
     env: CommandEnv,
 }
 
@@ -48,6 +49,7 @@ impl Command {
             args: Vec::new(),
             stdout: None,
             stderr: None,
+            stdin: None,
             env: Default::default(),
         }
     }
@@ -64,8 +66,8 @@ impl Command {
         panic!("unsupported")
     }
 
-    pub fn stdin(&mut self, _stdin: Stdio) {
-        panic!("unsupported")
+    pub fn stdin(&mut self, stdin: Stdio) {
+        self.stdin = Some(stdin);
     }
 
     pub fn stdout(&mut self, stdout: Stdio) {
@@ -166,7 +168,8 @@ impl Command {
         };
 
         // Setup Stdin
-        let stdin = Self::create_stdin(Stdio::Null)?;
+        let stdin = self.stdin.unwrap_or(Stdio::Null);
+        let stdin = Self::create_stdin(stdin)?;
         if let Some(con) = stdin {
             cmd.stdin_init(con)
         } else {