@@ -1119,7 +1119,7 @@ static i64 SysReadImpl(struct Machine *m, struct Fd *fd, i64 addr, u64 size) {
1119
1119
unassert (fd -> cb );
1120
1120
InitIovs (& iv );
1121
1121
if ((rc = AppendIovsReal (m , & iv , addr , size )) != -1 ) {
1122
- INTERRUPTIBLE (rc = IB ( fd -> cb -> readv ) (fd -> systemfd , iv .p , iv .i ));
1122
+ INTERRUPTIBLE (rc = fd -> cb -> readv (fd -> systemfd , iv .p , iv .i ));
1123
1123
if (rc != -1 ) SetWriteAddr (m , addr , rc );
1124
1124
}
1125
1125
FreeIovs (& iv );
@@ -1132,7 +1132,7 @@ static i64 SysWriteImpl(struct Machine *m, struct Fd *fd, i64 addr, u64 size) {
1132
1132
unassert (fd -> cb );
1133
1133
InitIovs (& iv );
1134
1134
if ((rc = AppendIovsReal (m , & iv , addr , size )) != -1 ) {
1135
- INTERRUPTIBLE (rc = IB ( fd -> cb -> writev ) (fd -> systemfd , iv .p , iv .i ));
1135
+ INTERRUPTIBLE (rc = fd -> cb -> writev (fd -> systemfd , iv .p , iv .i ));
1136
1136
if (rc != -1 ) SetReadAddr (m , addr , rc );
1137
1137
}
1138
1138
FreeIovs (& iv );
@@ -1213,7 +1213,7 @@ static i64 SysReadv(struct Machine *m, i32 fildes, i64 iovaddr, i32 iovlen) {
1213
1213
unassert (fd -> cb );
1214
1214
InitIovs (& iv );
1215
1215
if ((rc = AppendIovsGuest (m , & iv , iovaddr , iovlen )) != -1 ) {
1216
- INTERRUPTIBLE (rc = IB ( fd -> cb -> readv ) (fd -> systemfd , iv .p , iv .i ));
1216
+ INTERRUPTIBLE (rc = fd -> cb -> readv (fd -> systemfd , iv .p , iv .i ));
1217
1217
}
1218
1218
UnlockFd (fd );
1219
1219
FreeIovs (& iv );
@@ -1228,7 +1228,7 @@ static i64 SysWritev(struct Machine *m, i32 fildes, i64 iovaddr, i32 iovlen) {
1228
1228
unassert (fd -> cb );
1229
1229
InitIovs (& iv );
1230
1230
if ((rc = AppendIovsGuest (m , & iv , iovaddr , iovlen )) != -1 ) {
1231
- INTERRUPTIBLE (rc = IB ( fd -> cb -> writev ) (fd -> systemfd , iv .p , iv .i ));
1231
+ INTERRUPTIBLE (rc = fd -> cb -> writev (fd -> systemfd , iv .p , iv .i ));
1232
1232
}
1233
1233
UnlockFd (fd );
1234
1234
FreeIovs (& iv );
@@ -1412,7 +1412,7 @@ static int SysIoctl(struct Machine *m, int fildes, u64 request, i64 addr) {
1412
1412
int (* func )(int , unsigned long , ...);
1413
1413
if (!(fd = GetAndLockFd (m , fildes ))) return -1 ;
1414
1414
unassert (fd -> cb );
1415
- func = IB ( fd -> cb -> ioctl ) ;
1415
+ func = fd -> cb -> ioctl ;
1416
1416
systemfd = atomic_load_explicit (& fd -> systemfd , memory_order_relaxed );
1417
1417
switch (request ) {
1418
1418
case TIOCGWINSZ_LINUX :
@@ -1761,7 +1761,12 @@ static int SysWait4(struct Machine *m, int pid, i64 opt_out_wstatus_addr,
1761
1761
struct rusage hrusage ;
1762
1762
struct rusage_linux grusage ;
1763
1763
if ((options = XlatWait (options )) == -1 ) return -1 ;
1764
+ #if !defined(__EMSCRIPTEN__ )
1764
1765
INTERRUPTIBLE (rc = wait4 (pid , & wstatus , options , & hrusage ));
1766
+ #else
1767
+ memset (& hrusage , 0 , sizeof (hrusage ));
1768
+ INTERRUPTIBLE (rc = waitpid (pid , & wstatus , options ));
1769
+ #endif
1765
1770
if (rc != -1 ) {
1766
1771
if (opt_out_wstatus_addr ) {
1767
1772
CopyToUserWrite (m , opt_out_wstatus_addr , & wstatus , sizeof (wstatus ));
@@ -2191,7 +2196,7 @@ static int SysPoll(struct Machine *m, i64 fdsaddr, u64 nfds, i32 timeout_ms) {
2191
2196
hfds [0 ].events = (((ev & POLLIN_LINUX ) ? POLLIN : 0 ) |
2192
2197
((ev & POLLOUT_LINUX ) ? POLLOUT : 0 ) |
2193
2198
((ev & POLLPRI_LINUX ) ? POLLPRI : 0 ));
2194
- switch (IB ( fd -> cb -> poll ) (hfds , 1 , 0 )) {
2199
+ switch (fd -> cb -> poll (hfds , 1 , 0 )) {
2195
2200
case 0 :
2196
2201
Write16 (gfds [i ].revents , 0 );
2197
2202
break ;
0 commit comments