problem with readonly pinfo?

Pierre A. Humblet
Wed Sep 17 22:19:00 GMT 2003

Christopher Faylor wrote:

> >>"The winpids code first tries to open the shared region with RW and
> >>then drops back to read-only if it fails."
> >
> >I know you wrote that and I wondered why.  I may be really confused but
> >I don't see how handler_process::fill_filebuf () uses winpids.  It
> >deals with pinfo's directly.  kill_pgrp uses winpids.  You fixed both
> >the same night (late)...
> Oops.  Right.  Sorry.  I got the two confused.  And it doesn't actually
> make any difference for kill_pgrp.  So, yes, I think your proposal to do
> this in pinfo::init makes sense.

Yes, but I was backing away from it. In all cases I have seen (outside of
winpids, see below) the creator of a pinfo knows if write access is
Isn't it true even for winpids? Both kill_pgrp and talktome require write
access to work, so opening read only does not help them (and requires
more work).

If we go that way (my original proposal) then we could go all the way,
get rid of PID_MAP_RW altogether and always try to open RW then RO.
Not that I recommend it, now that all the spots requiring RW are 
finally identified!

A slight edit in handler_process::fill_filebuf is all that's required.
We might also comment out the "drops back to read-only" in pinfo.h
if it's really unneeded. 


More information about the Cygwin-developers mailing list