X-Spam-Check-By: sourceware.org
Date: Tue, 24 Jan 2006 18:45:28 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: /proc/<pid>/exe points to void
Message-ID: <20060124174528.GA20968@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <uhdjjkyi2.fsf@gnu.org> <20050310220045.GC20798@cygbert.vinschen.de> <u1xamjhtl.fsf@gnu.org> <20050311160956.GB2821@cygbert.vinschen.de> <ufynid99e.fsf@gnu.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ufynid99e.fsf@gnu.org>
User-Agent: Mutt/1.4.2i
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Jan 20 13:50, Sam Steingold wrote:
> >> > On Mar 10 16:00, Sam Steingold wrote:
> >> >> /proc/<pid>/exe points to "foo", not to "foo.exe", so it cannot be
> >> >> opened &c.
> >> >         ^^^^
> >> > 	????
> >> 
> >> how do I find out which file is running if /proc/<pid>/exe cannot be
> >> opened?
> >
> > access(2) or stat(2)
> 
> http://www.opengroup.org/onlinepubs/009695399/functions/access.html
> the above spec of access appears to indicate that if access() succeeds
> then open() must succeed too.
> this is not the case in cygwin: /proc/self/exe cannot be open()ed.

I've just checked in a patch which tacks on the .exe suffix to
/proc/$PID/exe, as well as a patch to realpath which returns the
pathname with .exe suffix, even if the original name has no suffix
given.  We will give this a try.  Please test the next snapshot.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

