From 15d920770841879de8f5f970669c546d7c8a4ec3 Mon Sep 17 00:00:00 2001 From: Andy Caldwell Date: Mon, 30 Nov 2015 00:06:52 +0000 Subject: [PATCH 1/2] Add umask (POSIX.1-2001) --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index d03b2f8375c06..50f35766fe017 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -217,6 +217,7 @@ extern { pub fn strerror(n: c_int) -> *mut c_char; pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; + pub fn umask(mask: mode_t) -> mode_t; pub fn wcslen(buf: *const wchar_t) -> size_t; pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; From dd54f29a29ee2ac59f52681ba64af49e06597b0f Mon Sep 17 00:00:00 2001 From: Andy Caldwell Date: Mon, 30 Nov 2015 00:24:15 +0000 Subject: [PATCH 2/2] Only applicable on unix systems --- src/lib.rs | 1 - src/unix/mod.rs | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 50f35766fe017..d03b2f8375c06 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -217,7 +217,6 @@ extern { pub fn strerror(n: c_int) -> *mut c_char; pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; - pub fn umask(mask: mode_t) -> mode_t; pub fn wcslen(buf: *const wchar_t) -> size_t; pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 3339003dd16c5..56c9cfb4037a8 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -292,6 +292,7 @@ extern { link_name = "pwrite$UNIX2003")] pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t; + pub fn umask(mask: mode_t) -> mode_t; pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int; #[cfg_attr(all(target_os = "macos", target_arch = "x86"),