about summary refs log tree commit diff
path: root/src/libstd/sys/redox/syscall
diff options
context:
space:
mode:
authorIan Douglas Scott <ian@iandouglasscott.com>2017-07-17 18:37:54 -0700
committerIan Douglas Scott <ian@iandouglasscott.com>2017-07-17 19:17:48 -0700
commit6f80cd7bfc9b6141451a818daa4ac2fd9f4abad0 (patch)
tree2fc84acb6f6864a444dec7881b17e4dc5828af96 /src/libstd/sys/redox/syscall
parent2652ce6771b114189cdc1f9bd026a10af0a714e0 (diff)
downloadrust-6f80cd7bfc9b6141451a818daa4ac2fd9f4abad0.tar.gz
rust-6f80cd7bfc9b6141451a818daa4ac2fd9f4abad0.zip
redox: handle multiple paths in PATH
Diffstat (limited to 'src/libstd/sys/redox/syscall')
-rw-r--r--src/libstd/sys/redox/syscall/call.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/sys/redox/syscall/call.rs b/src/libstd/sys/redox/syscall/call.rs
index fadf7325d75..ec9005c2cc3 100644
--- a/src/libstd/sys/redox/syscall/call.rs
+++ b/src/libstd/sys/redox/syscall/call.rs
@@ -77,9 +77,9 @@ pub fn dup2(fd: usize, newfd: usize, buf: &[u8]) -> Result<usize> {
 }
 
 /// Replace the current process with a new executable
-pub fn execve(path: &str, args: &[[usize; 2]]) -> Result<usize> {
-    unsafe { syscall4(SYS_EXECVE, path.as_ptr() as usize, path.len(),
-                                  args.as_ptr() as usize, args.len()) }
+pub fn execve<T: AsRef<[u8]>>(path: T, args: &[[usize; 2]]) -> Result<usize> {
+    unsafe { syscall4(SYS_EXECVE, path.as_ref().as_ptr() as usize,
+                      path.as_ref().len(), args.as_ptr() as usize, args.len()) }
 }
 
 /// Exit the current process