File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -660,12 +660,23 @@ __wasi_errno_t __wasi_sock_shutdown(
660
660
}
661
661
662
662
#ifdef _REENTRANT
663
- int32_t __imported_wasi_thread_spawn (int32_t arg0 ) __attribute__((
663
+ void __imported_wasi_thread_spawn (int32_t arg0 , int32_t arg1 ) __attribute__((
664
664
__import_module__ ("wasi" ),
665
- __import_name__ ("thread_spawn " )
665
+ __import_name__ ("thread-spawn " )
666
666
));
667
667
668
668
int32_t __wasi_thread_spawn (void * start_arg ) {
669
- return __imported_wasi_thread_spawn ((int32_t ) start_arg );
669
+ struct {
670
+ uint8_t is_error ;
671
+ union {
672
+ uint8_t error ;
673
+ uint32_t tid ;
674
+ } u ;
675
+ } error_or_tid ;
676
+ __imported_wasi_thread_spawn ((int32_t ) start_arg , (int32_t )(intptr_t )& error_or_tid );
677
+ if (error_or_tid .is_error ) {
678
+ return - (int )error_or_tid .u .error ;
679
+ }
680
+ return error_or_tid .u .tid ;
670
681
}
671
682
#endif
You can’t perform that action at this time.
0 commit comments