develooper Front page | perl.perl5.porters | Postings from May 2003

Re: Meaning of sysread()

Thread Previous | Thread Next
From:
Mark Mielke
Date:
May 21, 2003 07:07
Subject:
Re: Meaning of sysread()
Message ID:
20030521141357.GA25222@mark.mielke.cc
On Wed, May 21, 2003 at 11:52:15AM +0100, Nick Ing-Simmons wrote:
> Nick Ing-Simmons <nick.ing-simmons@elixent.com> writes:
> >Gurusamy Sarathy <gsar@ActiveState.com> writes:
> >>Given sysread() is supposed to read characters, not bytes, 
> >But that is/was not "given" - I see it says that in perlfunc.pod now
> >but it does not say it in Camel-III. (and I don't think the 
> >code-as-a-whole does that - it is true for read() but not sysread()).
> >Unix does not do characters that way. To get characters
> >you need something like :encoding() layer - which is there for perls read()
> >but not UNIX read() - and hence sysread() in Camel-III "spec".
> ...

I expect Perl sysread() to call C read() without any buffering, which
therefore means the level at which the system call returns
units. Specifically I don't want select() to ever block where
sysread() would return data.

In practice, I suppose this wouldn't happen even if read() read characters,
since the first byte of a multi-byte character is only useful with the rest
of the characters, however, this is a supposition that makes me uncomfortable.

Cheers!
mark

-- 
mark@mielke.cc/markm@ncf.ca/markm@nortelnetworks.com __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada

  One ring to rule them all, one ring to find them, one ring to bring them all
                       and in the darkness bind them...

                           http://mark.mielke.cc/


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About