Commit graph

18 commits

Author SHA1 Message Date
Jeremy Soller
a30092fbf6 Split FL and FD fcntls 2017-07-29 09:31:18 -06:00
Mark Simulacrum
b43f58bc25 Rollup merge of #43304 - ids1024:path2, r=aturon
redox: handle multiple paths in PATH
2017-07-18 09:41:34 -06:00
Ian Douglas Scott
6f80cd7bfc
redox: handle multiple paths in PATH 2017-07-17 19:17:48 -07:00
NODA, Kai
2e8859ce4e
libstd: remove redundant & from &Path::new(...)
fn Path::new<S: AsRef ...>(s: &S) -> &Path

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2017-07-18 00:07:09 +08:00
Josh Stone
9debe91675 Add conversions from File and Child* handles to Stdio
`Stdio` now implements `From<ChildStdin>`, `From<ChildStdout>`,
`From<ChildStderr>`, and `From<File>`.

The `Command::stdin`/`stdout`/`stderr` methods now take any type that
implements `Into<Stdio>`.

This makes it much easier to write shell-like command chains, piping to
one another and redirecting to and from files.  Otherwise one would need
to use the unsafe and OS-specific `from_raw_fd` or `from_raw_handle`.
2017-06-06 15:42:55 -07:00
Jeremy Soller
1bc9e5da23 Fix stdio descriptors in exec by removing cloexec if present. Use dup2 instead of dup 2017-04-16 09:33:32 -06:00
Corey Farwell
97a1b6a055 Update usages of 'OSX' (and other old names) to 'macOS'.
As of last year with version 'Sierra', the Mac operating system is now
called 'macOS'.
2017-03-12 14:59:04 -04:00
Jack O'Connor
2a345bbcc1 make Child::try_wait return io::Result<Option<ExitStatus>>
This is much nicer for callers who want to short-circuit real I/O errors
with `?`, because they can write this

    if let Some(status) = foo.try_wait()? {
        ...
    } else {
        ...
    }

instead of this

    match foo.try_wait() {
        Ok(status) => {
            ...
        }
        Err(err) if err.kind() == io::ErrorKind::WouldBlock => {
            ...
        }
        Err(err) => return Err(err),
    }

The original design of `try_wait` was patterned after the `Read` and
`Write` traits, which support both blocking and non-blocking
implementations in a single API. But since `try_wait` is never blocking,
it makes sense to optimize for the non-blocking case.

Tracking issue: https://github.com/rust-lang/rust/issues/38903
2017-02-06 23:04:47 -05:00
Jeremy Soller
b10e06166e Add try_wait to Redox process 2017-01-13 15:41:50 -07:00
Jeremy Soller
e68393397a Commit to fix make tidy 2016-11-28 21:07:26 -07:00
Jeremy Soller
746222fd9d Switch to using syscall crate directly - without import 2016-11-28 18:07:19 -07:00
Jeremy Soller
2556400a5d Replace setuid, setgid with setreuid, setregid 2016-11-17 14:15:58 -07:00
Jeremy Soller
f01add1a3b Add signal support, better exec error handling 2016-11-17 10:22:07 -07:00
Jeremy Soller
a90850995f Fixes for stdio and processes on Redox 2016-11-10 19:33:59 -07:00
Jeremy Soller
ced32a08f3 Fix exec 2016-11-09 20:52:30 -07:00
Jeremy Soller
ea6f5aa1b1 Implement rand and args, cleanup other modules 2016-10-29 21:46:49 -06:00
Jeremy Soller
a5de9bb591 Remove unsafe libc layer 2016-10-28 14:17:34 -06:00
Jeremy Soller
8b09e01fef Add redox system 2016-10-27 20:57:49 -06:00