Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4f6c94c6ed3f886829e54bf9aad1795d431412e3
Ticket: 1901828fffffffffffffffffffffffffffffffff
Unix portability - cruft removal
User & Date: jenglish on 2008-02-26 10:39:07
Changes

  1. icomment:
    Logged In: YES 
    user_id=68433
    Originator: YES
    
    generic/tclIOUtil.c has:
    
    #if defined(O_NDELAY) || defined(O_NONBLOCK)
    #   ifdef O_NONBLOCK
                mode |= O_NONBLOCK;
    #   else
                mode |= O_NDELAY;
    #   endif
    
    #else
                if (interp != NULL) {
                    Tcl_AppendResult(interp, "access mode \"", flag,
                            "\" not supported by this system", NULL);
                }
                ckfree((char *) modeArgv);
                return -1;
    #endif
    
    However, tclUnixPort.h (included by tclPort.h, included by tclInt.h,
    included by tclIOUtil.c) has:
        
            /*
             * NeXT doesn't define O_NONBLOCK, so #define it here if necessary.
             */
        
            #ifndef O_NONBLOCK
            #   define O_NONBLOCK 0x80
            #endif
    
    
    So O_NONBLOCK is always defined, and the other #if branches are never used.
    
    History:
    
    The sequence:
    
    | #ifdef O_NONBLOCK
    |             mode |= O_NONBLOCK;
    | #else
    |             mode |= O_NDELAY;
    | #endif
    
    was present in Tcl 7.0 (Sep 1993) through Tcl 7.4 (Jun 1995).  I did not check any earlier than Tcl 7.0.
    
    An #else clause was introduced in Tcl 7.5 (Apr 1996) to account for the possibility that neither O_NONBLOCK nor O_NDELAY are defined:
    
    | #if defined(O_NDELAY) || defined(O_NONBLOCK)
    ... {as above} ...
    | #else
    |             if (interp != (Tcl_Interp *) NULL) {
    |                 Tcl_AppendResult(interp, "access mode \"", flag,
    |                         "\" not supported by this system", (char *) NULL);
    |             }
    |             ckfree((char *) modeArgv);
    |             return -1;
    | #endif
    
    The O_NONBLOCK definition in unix/tclUnixPort.h was added in the same release; so it would appear that the 'access mode "NONBLOCK" not supported by this system' message has been effectively #ifdef'ed out since its introduction.
    
    
    
  2. login: "jenglish"
  3. mimetype: "text/plain"
  4. username: "jenglish"