Add umask
This commit is contained in:
Generated
+9
-15
@@ -176,7 +176,7 @@ dependencies = [
|
||||
name = "ralloc_shim"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -213,12 +213,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.1.40"
|
||||
source = "git+https://gitlab.redox-os.org/redox-os/syscall.git?branch=relibc#739aef47b8e6b300874945c3c33bb9550414b5b8"
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.1.40"
|
||||
version = "0.1.42"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@@ -226,7 +221,7 @@ name = "redox_termios"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -241,7 +236,7 @@ dependencies = [
|
||||
"posix-regex 0.1.0",
|
||||
"ralloc 1.0.0",
|
||||
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_syscall 0.1.40 (git+https://gitlab.redox-os.org/redox-os/syscall.git?branch=relibc)",
|
||||
"redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"spin 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"va_list 0.1.0",
|
||||
@@ -265,7 +260,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "0.2.6"
|
||||
version = "0.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@@ -311,7 +306,7 @@ version = "1.0.33"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -376,7 +371,7 @@ version = "1.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -477,12 +472,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
|
||||
"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372"
|
||||
"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db"
|
||||
"checksum redox_syscall 0.1.40 (git+https://gitlab.redox-os.org/redox-os/syscall.git?branch=relibc)" = "<none>"
|
||||
"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
|
||||
"checksum redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "cf8fb82a4d1c9b28f1c26c574a5b541f5ffb4315f6c9a791fa47b6a04438fe93"
|
||||
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
|
||||
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
|
||||
"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
|
||||
"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7"
|
||||
"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
|
||||
"checksum sc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4ebbb026ba4a707c25caec2db5ef59ad8b41f7ad77cad06257e06229c891f376"
|
||||
"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
|
||||
"checksum serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "15c141fc7027dd265a47c090bf864cf62b42c4d228bbcf4e51a0c9e2b0d3f7ef"
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ optional = true
|
||||
sc = "0.2.2"
|
||||
|
||||
[target.'cfg(target_os = "redox")'.dependencies]
|
||||
redox_syscall = { git = "https://gitlab.redox-os.org/redox-os/syscall.git", branch = "relibc" }
|
||||
redox_syscall = "0.1"
|
||||
spin = "0.4.10"
|
||||
|
||||
[features]
|
||||
|
||||
@@ -131,7 +131,7 @@ pub extern "C" fn stat(file: *const c_char, buf: *mut stat) -> c_int {
|
||||
res
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
// pub extern "C" fn umask(mask: mode_t) -> mode_t {
|
||||
// Sys::umask(mask)
|
||||
// }
|
||||
#[no_mangle]
|
||||
pub extern "C" fn umask(mask: mode_t) -> mode_t {
|
||||
Sys::umask(mask)
|
||||
}
|
||||
|
||||
@@ -61,10 +61,6 @@ impl Sys {
|
||||
// unsafe { syscall!(TIMES, out) as clock_t }
|
||||
// }
|
||||
|
||||
fn umask(mask: mode_t) -> mode_t {
|
||||
unsafe { syscall!(UMASK, mask) as mode_t }
|
||||
}
|
||||
|
||||
pub fn uname(utsname: *mut utsname) -> c_int {
|
||||
e(unsafe { syscall!(UNAME, utsname, 0) }) as c_int
|
||||
}
|
||||
@@ -386,6 +382,10 @@ impl Pal for Sys {
|
||||
Self::ioctl(fd, TCSETS + act as c_ulong, value as *mut c_void)
|
||||
}
|
||||
|
||||
fn umask(mask: mode_t) -> mode_t {
|
||||
unsafe { syscall!(UMASK, mask) as mode_t }
|
||||
}
|
||||
|
||||
fn unlink(path: &CStr) -> c_int {
|
||||
e(unsafe { syscall!(UNLINKAT, AT_FDCWD, path.as_ptr(), 0) }) as c_int
|
||||
}
|
||||
|
||||
@@ -137,6 +137,8 @@ pub trait Pal {
|
||||
|
||||
fn tcsetattr(fd: c_int, act: c_int, value: *const termios) -> c_int;
|
||||
|
||||
fn umask(mask: mode_t) -> mode_t;
|
||||
|
||||
fn unlink(path: &CStr) -> c_int;
|
||||
|
||||
fn waitpid(pid: pid_t, stat_loc: *mut c_int, options: c_int) -> pid_t;
|
||||
|
||||
@@ -899,6 +899,10 @@ impl Pal for Sys {
|
||||
0
|
||||
}
|
||||
|
||||
fn umask(mask: mode_t) -> mode_t {
|
||||
e(syscall::umask(mask as usize)) as mode_t
|
||||
}
|
||||
|
||||
fn unlink(path: &CStr) -> c_int {
|
||||
e(syscall::unlink(path.to_bytes())) as c_int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user