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

Re: Meaning of sysread()

Thread Previous | Thread Next
Nick Ing-Simmons
May 22, 2003 00:31
Re: Meaning of sysread()
Message ID:
Nick Ing-Simmons <> writes:
>I am begining to wonder if the sysxxx() things should call something 
>PerlIO *sys = PerlIO_syslayer(PerlIO *top);
>And then 
>  sysread() calls PerlIO_read(sys,...)
>  syswrite() calls PerlIO_write(sys,...)
>Then UNIX'es PerlIO_syslayer would return :unix layer and sysread() would
>call read(2) via the table. Win32's PerlIO_syslayer could return :crlf

I tried that last night. It isn't that simple (is it ever?).
That does not work right because when perl's sysread() ends up 
calling PerlIOUnix_read(), that isn't a raw read(2) either.
In particular PerlIOUnix_read() restarts on EINTR and sysread() isn't 
supposed to. (The socketpair test found this by hanging.)

Apart from there were two other fails:
  warnings.t failed to get one warning it was expecting (mystery).
  lib/open.t failed the test that sysread() handles chars on :utf8 (expected!)

Nick Ing-Simmons

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About