summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2022-10-16 12:04:02 +0100
committerDavid Carlier <devnexen@gmail.com>2022-10-16 12:04:09 +0100
commit44450feaff7e378f871932b6e7a013841e1a9cd9 (patch)
tree8938d337e63206a78b51150ed4a6499f04c02e6b
parente4e865d1c3bd3b7741fa408da8e145e7dd8724b3 (diff)
downloadrust-libc-44450feaff7e378f871932b6e7a013841e1a9cd9.tar.gz
adds putenv call to win32.
closes #2926.
-rw-r--r--libc-test/semver/windows.txt4
-rw-r--r--src/windows/mod.rs8
2 files changed, 12 insertions, 0 deletions
diff --git a/libc-test/semver/windows.txt b/libc-test/semver/windows.txt
index ddb97a8d8e..1ddf031b14 100644
--- a/libc-test/semver/windows.txt
+++ b/libc-test/semver/windows.txt
@@ -261,6 +261,8 @@ popen
printf
ptrdiff_t
putchar
+putenv
+putenv_s
puts
raise
rand
@@ -340,6 +342,8 @@ wexecve
wexecvp
wexecvpe
wopen
+wputenv
+wputenv_s
write
wrmdir
wsetlocale
diff --git a/src/windows/mod.rs b/src/windows/mod.rs
index acb0de9895..916019b1f2 100644
--- a/src/windows/mod.rs
+++ b/src/windows/mod.rs
@@ -509,6 +509,14 @@ extern "C" {
pub fn aligned_malloc(size: size_t, alignment: size_t) -> *mut c_void;
#[link_name = "_aligned_free"]
pub fn aligned_free(ptr: *mut ::c_void);
+ #[link_name = "_putenv"]
+ pub fn putenv(envstring: *const ::c_char) -> ::c_int;
+ #[link_name = "_wputenv"]
+ pub fn wputenv(envstring: *const ::wchar_t) -> ::c_int;
+ #[link_name = "_putenv_s"]
+ pub fn putenv_s(envstring: *const ::c_char, value_string: *const ::c_char) -> ::errno_t;
+ #[link_name = "_wputenv_s"]
+ pub fn wputenv_s(envstring: *const ::wchar_t, value_string: *const ::wchar_t) -> ::errno_t;
}
extern "system" {