Skip to content
Tcl Source Code History Of Ticket 558932ffffffffff
Login

History Of Ticket 558932ffffffffff

Artifacts Associated With Ticket 558932ffffffffff

  1. Ticket change [1921aec0a4] (rid 122767) by nobody on 2002-05-22 00:14:20:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Allow read(n) to read one byte, i.e. a system call of read(2)
      asks for one byte.  At the moment fconfigure(n) accepts
      a -buffersize argument but it has a minimum size of 10,
      perhaps this minimun could be 1 instead.
      
      It seems really bad not being able to do a read(fd, buf, 1)
      in tcl.
      
      If you do a "read $chan 1" a system call read is
      performed with the "buffersize" specified in fconfigure
      or some default (4k on Linux).  So, if you do
      
      fconfigure $chan -buffersize 10
      read $chan 1
      
      a
      read(fd, buf, 10)
      
      system call is issued.  So far, so good.  However,
      you cannot specify a -buffersize of less than 10.
      Actually, fconfigure accepts it but no reads are
      ever issued.
      
      regards,
      john
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "25. Channel System"
    10. title initialized to: "read one byte: fconfigure -buffersize 1"
    11. type initialized to: "RFE"
  2. Ticket change [402ee9c06d] (rid 121591) by hobbs on 2002-05-22 09:03:14:

    1. assignee changed to: "andreas_kupries"
    2. icomment:
      Logged In: YES 
      user_id=72656
      
      I don't see why we need a minimum buffersize (well, at least 
      1 I guess).
      
      
    3. login: "hobbs"
    4. mimetype: "text/plain"
    5. username: "hobbs"
  3. Ticket change [794e9f61f9] (rid 90104) by dkf on 2002-05-22 20:03:12:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      read(2) isn't required to completely fill the buffer it is
      passed.  Check the return code to the syscall to see how
      much was actually read in...
      
      This only matters when Tcl and some other software not
      sharing Tcl's I/O layer are competing for a channel that is
      producing more than each piece of software wants to read at
      a time.  I think...
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  4. Ticket change [827ab58e5f] (rid 117243) by dgp on 2002-05-22 22:02:46:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Note there's a documented max limit on -buffersize
      of one million as well.
      
      What is the origin/purpose of these limits?  How
      were these values chosen?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [d9c1e7d551] (rid 107666) by nobody on 2002-05-23 07:14:22:

    1. icomment:
      Logged In: NO 
      
      I understand read(2)'s behaviour is dependent on the type of
      file
      descriptor you are reading (file, pipe, etc.) and, for that
      matter,
      the OS, too.
      
      However, there are situtations where a real read(2) of one
      byte is
      required and, anyway, it's pretty odd not being able to do
      it.
      
      > I have to admit it was/is my belief too that [read] with
      an explicit
      > size allocates a buffer with that size and reads it in as
      less
      > iterations as possible. Seems that I have to recheck this.
      
      Try this while running strace on tclsh:
      
      set c [open /dev/zero]
      fconfigure $c -buffersize 10 -buffering none
      read $c 1
      
      and you will see a read(fd, buf, 10) being issued.
      
      Now do the same with:
      
      set c [open /dev/zero]
      fconfigure $c -buffersize 1 -buffering none
      read $c 1
      
      and no read(2) gets executed at all!  Now that's kind of ok
      because
      it explicitly says the smallest buffersize is 10.
      
      I believe there should be no bounds on buffersize.  I could
      accept
      begrudgingly an upper limit but a random lower limit of 10
      is
      really wierd.
      
      regards,
      john
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  6. Ticket change [9bb3a529ef] (rid 148452) by dgp on 2016-08-24 12:15:49:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2457625.01099422"
    3. closer changed to: "dgp"
    4. comment changed to:
      Allow read(n) to read one byte, i.e. a system call of read(2)
      asks for one byte.  At the moment fconfigure(n) accepts
      a -buffersize argument but it has a minimum size of 10,
      perhaps this minimun could be 1 instead.
      
      It seems really bad not being able to do a read(fd, buf, 1)
      in tcl.
      
      If you do a "read $chan 1" a system call read is
      performed with the "buffersize" specified in fconfigure
      or some default (4k on Linux).  So, if you do
      
      fconfigure $chan -buffersize 10
      read $chan 1
      
      a
      read(fd, buf, 10)
      
      system call is issued.  So far, so good.  However,
      you cannot specify a -buffersize of less than 10.
      Actually, fconfigure accepts it but no reads are
      ever issued.
      
      regards,
      john
      
    5. icomment:
      
      This was fixed in 2005.
      
    6. login: "dgp"
    7. mimetype: "text/plain"
    8. resolution changed to: "Out of Date"
    9. severity changed to: "Minor"
    10. status changed to: "Closed"