Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 90853c04163d368e3d7dab7eb162eb0990d398a7
Ticket: 1602208fffffffffffffffffffffffffffffffff
select() on wrong fd
User & Date: dkf on 2006-11-24 18:11:53
Changes

  1. assignee changed to: "kennykb"
  2. icomment:
    Logged In: YES 
    user_id=79902
    Originator: NO
    
    Assuming that 'fd_mask' is a 32-bit type, it works just fine, and it allows up to MASK_SIZE*NBBY*sizeof(fd_mask) descriptors, which will usually be 256 or more (if my understanding of tclUnixPort.h is right).
    
    The bit variable is the mask to use within a value of type fd_mask, and the index variable indexes into an array (actually three arrays concatenated) of them.
            if (mask & TCL_READABLE) {
                readyMasks[index] |= bit;
            }
            if (mask & TCL_WRITABLE) {
                (readyMasks+MASK_SIZE)[index] |= bit;
            }
            if (mask & TCL_EXCEPTION) {
                (readyMasks+2*(MASK_SIZE))[index] |= bit;
            }
    
    Thus, suppose we're talking about fd=35. In that case (with normal constant sizes) bit==3 and index==1.
    
    (It probably ought to be rewritten to use the same code as tclUnixNotfy.c uses though. That's more "officially correct". Assigning to the person who did that change for their comments.)
    
    
  3. login: "dkf"
  4. mimetype: "text/plain"
  5. username: "dkf"