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

Re: [perl #29883] Closing file seems to cause a seek operation

Thread Previous | Thread Next
Dave Mitchell
May 28, 2004 17:06
Re: [perl #29883] Closing file seems to cause a seek operation
Message ID:
On Fri, May 28, 2004 at 11:26:51AM +0200, LAUN Wolfgang wrote:
> According to a colleague who has looked into this, it is not clear
> whether it is in the standard io library or buried deep in fork
> handling. It should be reported to Sun, and we'd like to cooperate on
> this with you. 

Judging by a truss on a Solaris machine, the child process (which still
has the file open), does, just before exiting:

9041:   llseek(3, 0xFFFFFFFFFFFFFFE4, SEEK_CUR)         = 10
9041:   close(3)                                        = 0

ie its diddling with the current tell position, which is shared between
parent and child. This then confuses the parent. Why the first child is
subtracting 28 from the position I do not know. Looks a bit like it's
trying to undo the stuff read into the buffer but not yet read by the

Given that perl doesn't use the OS's stdio library, I'm not sure we can
entirely rule Perl out of the equation yet. But I'm tired and am going to
bed now....

Red sky at night - gerroff my land!
Red sky at morning - gerroff my land!
    -- old farmers' sayings #14

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