Win32OperatingSystem.st
changeset 16321 6e24f3c5ba96
parent 16315 b08c60b1588d
child 16331 e0db6eac2c1e
equal deleted inserted replaced
16320:dcb66fff0a89 16321:6e24f3c5ba96
 11202                 retArray[numHandles] = i;
 11202                 retArray[numHandles] = i;
 11203                 ++numHandles;
 11203                 ++numHandles;
 11204             } else {
 11204             } else {
 11205                 int canRead = _canReadWithoutBlocking(__intVal(fd));
 11205                 int canRead = _canReadWithoutBlocking(__intVal(fd));
 11206 
 11206 
 11207                 if (canRead > 0 ) {
 11207                 if (canRead > 0) {
 11208                     if (*pcntR < resultSizeReadable) {
 11208                     if (*pcntR < resultSizeReadable) {
 11209                         __arrayVal(readableResultFdArray)[*pcntR] = fd;
 11209                         __arrayVal(readableResultFdArray)[*pcntR] = fd;
 11210                     }
 11210                     }
 11211                     (*pcntR)++; cntAll++;
 11211                     (*pcntR)++; cntAll++;
 11212                 } else {
 11212                 } else if (canRead < 0) {
 11213                     if (canRead < 0 ) {
 11213                     @global(LastErrorNumber) = __mkSmallInteger(EBADF);
 11214                         @global(LastErrorNumber) = __mkSmallInteger(EBADF);
 11214                     RETURN (__mkSmallInteger(-1));
 11215                         RETURN (__mkSmallInteger(-1));
       
 11216                     }
       
 11217                 }
 11215                 }
 11218             }
 11216             }
 11219         }
 11217         }
 11220     }
 11218     }
 11221 
 11219 
 11228                 retArray[numHandles] = i + 10000;
 11226                 retArray[numHandles] = i + 10000;
 11229                 ++numHandles;
 11227                 ++numHandles;
 11230             } else {
 11228             } else {
 11231                 int canWrite = _canWriteWithoutBlocking(__intVal(fd));
 11229                 int canWrite = _canWriteWithoutBlocking(__intVal(fd));
 11232 
 11230 
 11233                 if (canWrite > 0 ) {
 11231                 if (canWrite > 0) {
 11234                     if (*pcntW < resultSizeWritable) {
 11232                     if (*pcntW < resultSizeWritable) {
 11235                         __arrayVal(writableResultFdArray)[*pcntW] = fd;
 11233                         __arrayVal(writableResultFdArray)[*pcntW] = fd;
 11236                     }
 11234                     }
 11237                     (*pcntW)++; cntAll++;
 11235                     (*pcntW)++; cntAll++;
 11238                 } else {
 11236                 } else if (canWrite < 0) {
 11239                     if (canWrite < 0 ) {
 11237                     @global(LastErrorNumber) = __mkSmallInteger(EBADF);
 11240                         @global(LastErrorNumber) = __mkSmallInteger(EBADF);
 11238                     RETURN (__mkSmallInteger(-1));
 11241                         RETURN (__mkSmallInteger(-1));
       
 11242                     }
       
 11243                 }
 11239                 }
 11244             }
 11240             }
 11245         }
 11241         }
 11246     }
 11242     }
 11247 
 11243 
 11366     for (i=0; i < readCount; i++) {
 11362     for (i=0; i < readCount; i++) {
 11367         fd = __arrayVal(readFdArray)[i];
 11363         fd = __arrayVal(readFdArray)[i];
 11368         if (__isSmallInteger(fd)) {
 11364         if (__isSmallInteger(fd)) {
 11369             int canRead = _canReadWithoutBlocking (__intVal(fd));
 11365             int canRead = _canReadWithoutBlocking (__intVal(fd));
 11370 
 11366 
 11371             if (canRead > 0 ) {
 11367             if (canRead > 0) {
 11372                 if (*pcntR < resultSizeReadable) {
 11368                 if (*pcntR < resultSizeReadable) {
 11373                     __arrayVal(readableResultFdArray)[*pcntR] = fd;
 11369                     __arrayVal(readableResultFdArray)[*pcntR] = fd;
 11374                 }
 11370                 }
 11375                 (*pcntR)++; cntAll++;
 11371                 (*pcntR)++; cntAll++;
 11376             } else {
 11372             } else if (canRead < 0) {
 11377                 if (canRead < 0 ) {
 11373                 @global(LastErrorNumber) = __mkSmallInteger(EBADF);
 11378                     @global(LastErrorNumber) = __mkSmallInteger(EBADF);
 11374                 RETURN (__mkSmallInteger(-1));
 11379                     RETURN (__mkSmallInteger(-1));
       
 11380                 }
       
 11381             }
 11375             }
 11382         }
 11376         }
 11383     }
 11377     }
 11384 
 11378 
 11385     for (i=0; i < writeCount; i++) {
 11379     for (i=0; i < writeCount; i++) {
 11386         fd = __arrayVal(writeFdArray)[i];
 11380         fd = __arrayVal(writeFdArray)[i];
 11387         if (__isSmallInteger(fd)) {
 11381         if (__isSmallInteger(fd)) {
 11388             int canWrite = _canWriteWithoutBlocking (__intVal(fd));
 11382             int canWrite = _canWriteWithoutBlocking (__intVal(fd));
 11389 
 11383 
 11390             if (canWrite > 0 ) {
 11384             if (canWrite > 0) {
 11391                 if (*pcntW < resultSizeWritable) {
 11385                 if (*pcntW < resultSizeWritable) {
 11392                     __arrayVal(writableResultFdArray)[*pcntW] = __mkSmallInteger(i);
 11386                     __arrayVal(writableResultFdArray)[*pcntW] = __mkSmallInteger(i);
 11393                 }
 11387                 }
 11394                 (*pcntW)++; cntAll++;
 11388                 (*pcntW)++; cntAll++;
 11395             } else {
 11389             } else if (canWrite < 0) {
 11396                 if (canWrite < 0 ) {
 11390                 @global(LastErrorNumber) = __mkSmallInteger(EBADF);
 11397                     @global(LastErrorNumber) = __mkSmallInteger(EBADF);
 11391                 RETURN (__mkSmallInteger(-1));
 11398                     RETURN (__mkSmallInteger(-1));
       
 11399                 }
       
 11400             }
 11392             }
 11401         }
 11393         }
 11402     }
 11394     }
 11403 
 11395 
 11404 done:
 11396 done:
 17624 ! !
 17616 ! !
 17625 
 17617 
 17626 !Win32OperatingSystem class methodsFor:'documentation'!
 17618 !Win32OperatingSystem class methodsFor:'documentation'!
 17627 
 17619 
 17628 version
 17620 version
 17629     ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.496 2014-04-10 15:38:13 stefan Exp $'
 17621     ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.497 2014-04-11 08:29:03 stefan Exp $'
 17630 !
 17622 !
 17631 
 17623 
 17632 version_CVS
 17624 version_CVS
 17633     ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.496 2014-04-10 15:38:13 stefan Exp $'
 17625     ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.497 2014-04-11 08:29:03 stefan Exp $'
 17634 !
 17626 !
 17635 
 17627 
 17636 version_SVN
 17628 version_SVN
 17637     ^ '$Id: Win32OperatingSystem.st,v 1.496 2014-04-10 15:38:13 stefan Exp $'
 17629     ^ '$Id: Win32OperatingSystem.st,v 1.497 2014-04-11 08:29:03 stefan Exp $'
 17638 
 17630 
 17639 ! !
 17631 ! !
 17640 
 17632 
 17641 
 17633 
 17642 Win32OperatingSystem initialize!
 17634 Win32OperatingSystem initialize!