Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
redox-os
redox-ssh
Commits
8cf8b607
Commit
8cf8b607
authored
May 02, 2018
by
Jeremy Soller
Browse files
Fix compilation on Redox
parent
fa05c153
Changes
2
Hide whitespace changes
Inline
Side-by-side
Cargo.lock
View file @
8cf8b607
[root]
name = "redox-ssh"
version = "0.1.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"num-bigint 0.1.39 (git+https://github.com/rust-num/num)",
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "byteorder"
version = "1.1.0"
...
...
@@ -72,6 +59,19 @@ dependencies = [
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "redox-ssh"
version = "0.1.0"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"num-bigint 0.1.39 (git+https://github.com/rust-num/num)",
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "redox_syscall"
version = "0.1.26"
...
...
src/channel.rs
View file @
8cf8b607
...
...
@@ -86,10 +86,17 @@ impl Channel {
);
self
.read_thread
=
Some
(
thread
::
spawn
(
move
||
{
#[cfg(target_os
=
"redox"
)]
use
syscall
::
dup
;
#[cfg(target_os
=
"redox"
)]
let
master2
=
unsafe
{
dup
(
master_fd
,
&
[])
.unwrap_or
(
!
0
)
};
#[cfg(not(target_os
=
"redox"
))]
use
libc
::
dup
;
#[cfg(not(target_os
=
"redox"
))]
let
master2
=
unsafe
{
dup
(
master_fd
)
};
println!
(
"dup result: {}"
,
dup
as
u32
);
println!
(
"dup result: {}"
,
master2
as
u32
);
let
mut
master
=
unsafe
{
File
::
from_raw_fd
(
master2
)
};
loop
{
use
std
::
str
::
from_utf8_unchecked
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment