Skip to content

Redox Support Preview #37702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 41 commits into from
Dec 15, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8b09e01
Add redox system
jackpot51 Oct 28, 2016
a5de9bb
Remove unsafe libc layer
jackpot51 Oct 28, 2016
68fd7ee
Can import unwind now
jackpot51 Oct 28, 2016
b1b35dd
Implement env, reentrant mutex, and partially implement scoped thread…
jackpot51 Oct 30, 2016
ea6f5aa
Implement rand and args, cleanup other modules
jackpot51 Oct 30, 2016
37bfef0
Implement thread
jackpot51 Oct 30, 2016
4edcddf
Implement TLS scoped keys, compiler builtins
jackpot51 Oct 30, 2016
c77979b
Fix for thread locals
jackpot51 Oct 31, 2016
123d08b
Merge branch 'master' of https://github.com/rust-lang/rust into redox
jackpot51 Oct 31, 2016
74dc845
Merge branch 'master' into redox
jackpot51 Nov 3, 2016
01e8378
Update to new sys requirements
jackpot51 Nov 3, 2016
ced32a0
Fix exec
jackpot51 Nov 10, 2016
a908509
Fixes for stdio and processes on Redox
jackpot51 Nov 11, 2016
79a8c27
Fix readdir
jackpot51 Nov 11, 2016
25e1a4a
Use target_os = redox for cfg
jackpot51 Nov 11, 2016
0bb9a95
Merge branch 'master' into redox
jackpot51 Nov 11, 2016
a0b5dfe
Add fcntl
jackpot51 Nov 14, 2016
18bf054
Fix redox prefix handling
jackpot51 Nov 14, 2016
de68ace
Add current_exe support
jackpot51 Nov 15, 2016
73f24d4
Simple implementation of read2
jackpot51 Nov 15, 2016
2e5c821
Add set_perm
jackpot51 Nov 15, 2016
267bc54
Use chmod instead of fcntl to change file perms
jackpot51 Nov 16, 2016
f01add1
Add signal support, better exec error handling
jackpot51 Nov 17, 2016
2556400
Replace setuid, setgid with setreuid, setregid
jackpot51 Nov 17, 2016
ae2029f
Merge branch 'master' into redox
jackpot51 Nov 20, 2016
b3c91df
Merge branch 'master' into redox
jackpot51 Nov 23, 2016
4a0bc71
Add File set_permissions
jackpot51 Nov 23, 2016
6733074
Allow setting nonblock on sockets
jackpot51 Nov 23, 2016
3a1bb2b
Use O_DIRECTORY
jackpot51 Nov 26, 2016
d73d32f
Fix canonicalize
jackpot51 Nov 26, 2016
746222f
Switch to using syscall crate directly - without import
jackpot51 Nov 29, 2016
2ec2132
Switch to using Prefix::Verbatim
jackpot51 Nov 29, 2016
1d0bba8
Move stdout/err flush into sys
jackpot51 Nov 29, 2016
6378c77
Remove file path from std::fs::File
jackpot51 Nov 29, 2016
e683933
Commit to fix make tidy
jackpot51 Nov 29, 2016
7294422
Cleanup env
jackpot51 Dec 1, 2016
056ebcc
Rollback prefix
jackpot51 Dec 12, 2016
c61baa0
Fix accidental removal of import
jackpot51 Dec 12, 2016
7e7775c
Merge branch 'master' into redox
jackpot51 Dec 12, 2016
daaa231
Fix tidy checks
jackpot51 Dec 12, 2016
3e15dc1
Merge branch 'master' into redox
jackpot51 Dec 14, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove file path from std::fs::File
  • Loading branch information
jackpot51 committed Nov 29, 2016
commit 6378c77716aa66a12af0fb41abf3dc000b81c2c7
10 changes: 0 additions & 10 deletions src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,16 +383,6 @@ impl File {
pub fn set_permissions(&self, perm: Permissions) -> io::Result<()> {
self.inner.set_permissions(perm.0)
}

/// Get the path that this file points to.
///
/// This function is only implemented on Redox, but could be
/// implemented on other operating systems using readlink
#[cfg(target_os = "redox")]
#[unstable(feature = "file_path", issue="0")]
pub fn path(&self) -> io::Result<PathBuf> {
self.inner.path()
}
}

impl AsInner<fs_imp::File> for File {
Expand Down
6 changes: 2 additions & 4 deletions src/libstd/sys/redox/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,8 @@ impl File {

pub fn path(&self) -> io::Result<PathBuf> {
let mut buf: [u8; 4096] = [0; 4096];
match syscall::fpath(*self.fd().as_inner() as usize, &mut buf) {
Ok(count) => Ok(PathBuf::from(unsafe { String::from_utf8_unchecked(Vec::from(&buf[0..count])) })),
Err(err) => Err(Error::from_raw_os_error(err.errno)),
}
let count = cvt(syscall::fpath(*self.fd().as_inner() as usize, &mut buf))?;
Ok(PathBuf::from(unsafe { String::from_utf8_unchecked(Vec::from(&buf[..count])) }))
}

pub fn fd(&self) -> &FileDesc { &self.0 }
Expand Down