Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a7876072f7703321d52754e3cb5af9521059d263
Ticket: 1095909fffffffffffffffffffffffffffffffff
Do not use readdir_r
User & Date: jenglish on 2005-01-05 03:28:06
Changes

  1. icomment:
    Logged In: YES 
    user_id=68433
    
    More notes:
    
    In the current codebase, TclpReaddir() calls
    readdir/readdir_r/readdir64/readdir64_r, depending on -D
    flags determined at configure-time.  TclpReaddir() appears
    in the internal unix-specific stubs table, but is not
    referenced directly in the current codebase.  Instead,
    tclUnixFile.c and tclUnixFCmd.c call TclOSreaddir(), which
    is #defined as one of: TclpReaddir() (if TCL_THREADS
    defined), readdir64() (if TCL_THREADS undefined and
    HAVE_STRUCT_DIRENT64 defined), or readdir (if both symbols
    are undefined).
    
    In addition, unix/tclUnixPort.h has #define readdir(x)
    TclpReaddir(x) if TCL_THREADS is defined.   The only place
    "readdir" appears literally in the current codebase is in
    the implementation of TclpReaddir (which must take care to
    #undefine it first).
    
    Proposed simplification:  don't re-#define readdir at all,
    and only use TclOSreaddir to select readdir() / readdir64()
     (IOW, -DTCL_THREADS makes no difference).  TclpReaddir
    still appears in the internal stubs table, but is never
    referenced (directly or indirectly) by anything else in the
    core.
    
    
  2. login: "jenglish"
  3. mimetype: "text/plain"
  4. username: "jenglish"