It looks like your C-runtime libraries or Perl implementation is broken(1).
I cannot reproduce your results on my platform:
The only logical thing for CLONE to do for an open filehandle is dup() or dup2(), and according to the man pages for those calls:
They share locks, file position pointers and flags; for example, if the file position is modified by using lseek on one of the descriptors, the position is also changed for the other.NAME dup, dup2 - duplicate a file descriptor SYNOPSIS #include <unistd.h> int dup(int oldfd); int dup2(int oldfd, int newfd); DESCRIPTION dup and dup2 create a copy of the file descriptor oldfd. After successful return of dup or dup2, the old and new descrip +tors may be used interchangeably.The two descriptors do not share the close-on-exec flag, howeve +r.
1. That is, your platform is exhibiting unspecified--thought clearly defined--behaviour.
In reply to Re^3: Threads: How to share a FileHandle to Write
by BrowserUk
in thread Threads: How to share a FileHandle to Write
by gulden
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |