Skip to content
Tcl Source Code Artifact [d9c1e7d551]
Login

Artifact [d9c1e7d551]

Artifact d9c1e7d5514feefda1556b5e8aec512a16a1d1ed:

Ticket change [d9c1e7d551] - Ticket [558932ffffffffff|558932ffff] <i>read one byte: fconfigure -buffersize 1</i> status still Open with 4 other changes by nobody on 2002-05-23 07:14:22.
D 2002-05-23T07:14:22
J icomment Logged\sIn:\sNO\s\n\nI\sunderstand\sread(2)'s\sbehaviour\sis\sdependent\son\sthe\stype\sof\nfile\ndescriptor\syou\sare\sreading\s(file,\spipe,\setc.)\sand,\sfor\sthat\nmatter,\nthe\sOS,\stoo.\n\nHowever,\sthere\sare\ssitutations\swhere\sa\sreal\sread(2)\sof\sone\nbyte\sis\nrequired\sand,\sanyway,\sit's\spretty\sodd\snot\sbeing\sable\sto\sdo\nit.\n\n>\sI\shave\sto\sadmit\sit\swas/is\smy\sbelief\stoo\sthat\s[read]\swith\nan\sexplicit\n>\ssize\sallocates\sa\sbuffer\swith\sthat\ssize\sand\sreads\sit\sin\sas\nless\n>\siterations\sas\spossible.\sSeems\sthat\sI\shave\sto\srecheck\sthis.\n\nTry\sthis\swhile\srunning\sstrace\son\stclsh:\n\nset\sc\s[open\s/dev/zero]\nfconfigure\s$c\s-buffersize\s10\s-buffering\snone\nread\s$c\s1\n\nand\syou\swill\ssee\sa\sread(fd,\sbuf,\s10)\sbeing\sissued.\n\nNow\sdo\sthe\ssame\swith:\n\nset\sc\s[open\s/dev/zero]\nfconfigure\s$c\s-buffersize\s1\s-buffering\snone\nread\s$c\s1\n\nand\sno\sread(2)\sgets\sexecuted\sat\sall!\s\sNow\sthat's\skind\sof\sok\nbecause\nit\sexplicitly\ssays\sthe\ssmallest\sbuffersize\sis\s10.\n\nI\sbelieve\sthere\sshould\sbe\sno\sbounds\son\sbuffersize.\s\sI\scould\naccept\nbegrudgingly\san\supper\slimit\sbut\sa\srandom\slower\slimit\sof\s10\nis\nreally\swierd.\n\nregards,\njohn\n
J login nobody
J mimetype text/plain
J username nobody
K 558932ffffffffffffffffffffffffffffffffff
U nobody
Z 3b489c0c09a90421d8d97466400e9ace