> * Corinna Vinschen <[EMAIL PROTECTED]> [2006-01-18 19:10:27 +0100]: > > On Jan 18 12:27, Sam Steingold wrote: >> > * Christopher Faylor <[EMAIL PROTECTED]> [2006-01-16 22:36:19 -0500]: >> > >> > corinna: Emulate linux version of realpath >> >> now when I have a file "foo.exe", >> realpath("foo") returns "foo" instead of "foo.exe" >> also: >> $ ls -l /proc/self/exe >> 0 lrwxrwxrwx 1 sds mkgroup-l-d 0 Jan 18 2006 /proc/self/exe -> /usr/bin/ls* >> >> instead of ls.exe, so /proc/self/exe cannot be open() for input. >> >> so, now I must add the "exe" suffix myself?! > > Funny that you mention it. The realpath change to "emulate linux" > has nothing to do with what you're talking about. The "emulate linux" > change is something about how to behave if the second argument is a > NULL pointer. Linux returns a malloced buffer in this case, which > Cygwin didn't so far. > > Now, talking about the .exe suffix... the realpath change is this: > > Before: realpath("foo", ...) = NULL (ENOENT) > After: realpath("foo", ...) = "foo". > > So, instead of returning ENOENT it returns a path that the file exists > which is equivalent to how stat behaves, which it wasn't before.
I see, thanks. > As for removing the .exe from /proc/$PID/exe(name), AFAICS this hasn't > changed since at least 2004-01-01, which was the date when I gave up > looking for a change in the code. maybe this is an old bug, I just noticed it again. > So, well, I don't see why you "now" would have to change something > exactly in relation to this. here is a simple test case: int main (int argc, char *argv[]) { char executable[MAXPATHLEN]; realpath(argv[0],executable); if (open(executable,O_RDONLY|O_BINARY,0644) < 0) return 1; else return 0; } it worked (returned 0) before and it works on Linux. it does not work now. thanks. -- Sam Steingold (http://www.podval.org/~sds) running w2k http://www.honestreporting.com http://www.savegushkatif.org http://www.iris.org.il http://www.camera.org http://www.palestinefacts.org Don't use force -- get a bigger hammer. -- 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/