@@ -606,7 +606,12 @@ var SyscallsLibrary = {
606606 '_emscripten_proxy_newselect' ,
607607#endif
608608 ] ,
609+ #if ASYNCIFY
610+ __syscall__newselect__async : true ,
611+ __syscall__newselect : async ( nfds , readfds , writefds , exceptfds , timeoutInMillis ) => {
612+ #else
609613 __syscall__newselect: ( nfds , readfds , writefds , exceptfds , timeoutInMillis ) => {
614+ #endif
610615#if PTHREADS
611616 if ( ENVIRONMENT_IS_PTHREAD ) {
612617 return __emscripten_proxy_newselect ( nfds ,
@@ -631,7 +636,12 @@ var SyscallsLibrary = {
631636 '_emscripten_proxy_newselect_finish' ,
632637#endif
633638 ] ,
639+ #if ASYNCIFY
640+ _newselect_js__async : true ,
641+ _newselect_js : async ( ctx , arg , nfds , readfds , writefds , exceptfds , timeoutInMillis ) => {
642+ #else
634643 _newselect_js : ( ctx , arg , nfds , readfds , writefds , exceptfds , timeoutInMillis ) => {
644+ #endif
635645 // readfds are supported,
636646 // writefds checks socket open status
637647 // exceptfds are supported, although on web, such exceptional conditions never arise in web sockets
@@ -701,6 +711,11 @@ var SyscallsLibrary = {
701711#endif
702712 return stream . stream_ops . poll ( stream , timeoutInMillis ) ;
703713 } ) ( ) ;
714+
715+ #if ASYNCIFY
716+ /* poll is possibly a promise */
717+ flags = await flags ;
718+ #endif
704719 } else {
705720#if ASSERTIONS
706721 if ( timeoutInMillis != 0 ) warnOnce ( 'non-zero select() timeout not supported: ' + timeoutInMillis )
0 commit comments