Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a07ab844c3d699f997f8172cf507a9b97e51494f
Ticket: 1602208fffffffffffffffffffffffffffffffff
select() on wrong fd
User & Date: jfontain on 2006-11-28 13:20:20
Changes

  1. icomment:
    Logged In: YES 
    user_id=376942
    Originator: YES
    
    Unfortunately, that is not quite enough:
    
    int main(){
        int fd;
        int index;
        fd_mask bit;
        fd = 52;
        index = fd/(NBBY*sizeof(fd_mask));
        bit = 1 << (fd%(NBBY*sizeof(fd_mask)));
        printf("%d,%d,%ld,%lu\n", fd, index, bit, sizeof(fd_mask));
        return 0;
    }
    still gives: 52,0,1048576,8 (bit=2**20)
    
        bit = 1L << (fd%(NBBY*sizeof(fd_mask)));
    
    or maybe better, if compatible with all compilers:
    
        bit = (fd_mask)1 << (fd%(NBBY*sizeof(fd_mask)));
    
    solves the problem.
    
    
  2. login: "jfontain"
  3. mimetype: "text/plain"
  4. status changed to: "Open"
  5. username: "jfontain"