@@ -243,6 +243,17 @@ impl Error for VarError {
243
243
/// Sets the environment variable `k` to the value `v` for the currently running
244
244
/// process.
245
245
///
246
+ /// Note that while concurrent access to environment variables is safe in Rust,
247
+ /// some platforms only expose inherently unsafe non-threadsafe APIs for
248
+ /// inspecting the environment. As a result extra care needs to be taken when
249
+ /// auditing calls to unsafe external FFI functions to ensure that any external
250
+ /// environment accesses are properly synchronized with accesses in Rust.
251
+ ///
252
+ /// Discussion of this unsafety on Unix may be found in:
253
+ ///
254
+ /// - [Austin Group Bugzilla](http://austingroupbugs.net/view.php?id=188)
255
+ /// - [GNU C library Bugzilla](https://sourceware.org/bugzilla/show_bug.cgi?id=15607#c2)
256
+ ///
246
257
/// # Examples
247
258
///
248
259
/// ```
@@ -260,6 +271,17 @@ pub fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(k: K, v: V) {
260
271
261
272
/// Removes an environment variable from the environment of the currently running process.
262
273
///
274
+ /// Note that while concurrent access to environment variables is safe in Rust,
275
+ /// some platforms only expose inherently unsafe non-threadsafe APIs for
276
+ /// inspecting the environment. As a result extra care needs to be taken when
277
+ /// auditing calls to unsafe external FFI functions to ensure that any external
278
+ /// environment accesses are properly synchronized with accesses in Rust.
279
+ ///
280
+ /// Discussion of this unsafety on Unix may be found in:
281
+ ///
282
+ /// - [Austin Group Bugzilla](http://austingroupbugs.net/view.php?id=188)
283
+ /// - [GNU C library Bugzilla](https://sourceware.org/bugzilla/show_bug.cgi?id=15607#c2)
284
+ ///
263
285
/// # Examples
264
286
///
265
287
/// ```
0 commit comments