Pipes Again -- a simple test case

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Jan 8 18:44:00 GMT 2016


On Jan  8 17:12, Houder wrote:
> On 2016-01-08 16:19, Corinna Vinschen wrote:
> >On Jan  4 10:24, Houder wrote:
> >>On 2016-01-04 09:52, Marco Atzeri wrote:
> >>>On 04/01/2016 09:03, Houder wrote:
> >>>>Hi Corinna,
> >>>>
> >>>>I have been looking for an STC to show why cmp fails on Cygwin (and to
> >>>>show the
> >>>>difference between Cygwin and Linux).
> >>>>
> >>>>The STC below creates a pipe (pipe() is used), followed by calls to
> >>>>fstat() and
> >>>>stat() for both the read end and the write end of the pipe.
> >>>>
> >>>>(I also tested with popen()/pclose(): same result)
> >>>>
> >>>>Regards,
> >>>>Henri
> >
> >Thanks for the STC.  However, given how this stuff works internally,
> >I have no good solution off the top of my head.  I played with various
> >ideas but to no avail.  I add this to my TODO list, but I probably
> >won't have a quick solution :(
> >
> >
> >Thanks,
> >Corinna
> >
> >
> >P.S: It would be really helpful if you could stick to the original
> >     thread and simply use "reply-to" once a discussion has started.
> >     It's very confusing having to connect the various threads.  Thanks.
> 
> Perhaps David B. can be helped by a Cygwin-specific patching to "cmp"? Eric?
> 
> ... replacing the call to fstat() by a call to stat() ...
> (as shown in https://cygwin.com/ml/cygwin/2015-12/msg00348.html)
> 
> By the way, thank you for reporting back to "us" about this. I already
> feared that a "general" solution would have to wait ... You have already
> too much on your plate.
> 
> As a final point, I also tested FIFOs and (unix domain) sockets.
> 
> FIFOs pass the test, sockets do not.

Yes, that's expected.  The underlying hack^Wmethod is the same for sockets
and pipes, while FIFOs have a real path on a real filesystem and thus have
a real inode number to fetch in stat/fstat.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160108/7b6226a0/attachment.sig>


More information about the Cygwin mailing list