develooper Front page | perl.perl5.porters | Postings from November 2000

Re: [ID 20001109.006] [MAILER-DAEMON@tmtowtdi.perl.org: failure notice]

Thread Previous
From:
Nick Ing-Simmons
Date:
November 10, 2000 02:17
Subject:
Re: [ID 20001109.006] [MAILER-DAEMON@tmtowtdi.perl.org: failure notice]
Message ID:
200011101017.KAA17947@mikado.tiuk.ti.com
Jens Hamisch <jens@Strawberry.COM> writes:
>Sun Forte C 6.0  compiler ...
>The problem is present on Sparc with 64 bit enabled. I cannot
>reproduce the problem on Intel 32 bit Solaris using the same
>version of that compiler! Unfortunatelly my SOCKS lib is 64 bit
>only, so i cannot try Perl + Socks + 32bit on Sparc.
>SOCKS uses the real getc for non-socket operations and read(2) for
>sockets. So if everything is ANSI, read(2) also should take care
>of things put back to the stream using ungetc, right?

Wrong. read() knows nothing at all about stdio level.

You can fake 'ungetc' at the unix read level if you can lseek
the stream (which is what PerlIO_unix attempts) but you cannot seek a 
socket. One may be able to do something clever with STREAMS module 
ioctl().

The "plan" (as yet unimplemented) for perlio is to have a temporary
"layer" with the un-gotten chars push itself into the stack - which is 
a better fix for this case.

-- 
Nick Ing-Simmons <nik@tiuk.ti.com>
Via, but not speaking for: Texas Instruments Ltd.


Thread Previous


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