File tree 3 files changed +22
-75
lines changed
3 files changed +22
-75
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
use crate :: mem;
2
2
3
+ // For WASI add a few symbols not in upstream `libc` just yet.
4
+ #[ cfg( target_os = "wasi" ) ]
5
+ mod libc {
6
+ use crate :: ffi;
7
+
8
+ #[ allow( non_camel_case_types) ]
9
+ pub type pthread_key_t = ffi:: c_uint ;
10
+
11
+ extern "C" {
12
+ pub fn pthread_key_create (
13
+ key : * mut pthread_key_t ,
14
+ destructor : unsafe extern "C" fn ( * mut ffi:: c_void ) ,
15
+ ) -> ffi:: c_int ;
16
+ #[ allow( dead_code) ]
17
+ pub fn pthread_getspecific ( key : pthread_key_t ) -> * mut ffi:: c_void ;
18
+ pub fn pthread_setspecific ( key : pthread_key_t , value : * const ffi:: c_void ) -> ffi:: c_int ;
19
+ pub fn pthread_key_delete ( key : pthread_key_t ) -> ffi:: c_int ;
20
+ }
21
+ }
22
+
3
23
pub type Key = libc:: pthread_key_t ;
4
24
5
25
#[ inline]
Original file line number Diff line number Diff line change @@ -85,11 +85,8 @@ pub(crate) mod guard {
85
85
} else if #[ cfg( target_os = "windows" ) ] {
86
86
mod windows;
87
87
pub ( crate ) use windows:: enable;
88
- } else if #[ cfg( all( target_os = "wasi" ) ) ] {
89
- mod wasi;
90
- pub ( crate ) use wasi:: enable;
91
88
} else if #[ cfg( any(
92
- target_family = "wasm" ,
89
+ all ( target_family = "wasm" , not ( target_os= "wasi" ) ) ,
93
90
target_os = "uefi" ,
94
91
target_os = "zkvm" ,
95
92
) ) ] {
@@ -138,6 +135,7 @@ pub(crate) mod key {
138
135
target_family = "unix" ,
139
136
) ,
140
137
target_os = "teeos" ,
138
+ target_os = "wasi" ,
141
139
) ) ] {
142
140
mod racy;
143
141
mod unix;
You can’t perform that action at this time.
0 commit comments