public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* mapping root directory to SystemDrive / CurrentDrive
@ 2004-08-02 12:52 Gernot Hillier
  2004-08-03 10:51 ` Corinna Vinschen
  0 siblings, 1 reply; 9+ messages in thread
From: Gernot Hillier @ 2004-08-02 12:52 UTC (permalink / raw)
  To: cygwin

Hi!

We use some Cygwin tools without Cygwin mounts. The reason for this is (was) 
that we use several Cygwin versions from different network shares in parallel 
(i.e. we have different \Cygwin trees on different drives on our Windows 
hosts).

With earlier Cygwin versions, this worked without any problem as Cygwin always 
mapped "/" to the CurrentDrive (not the SystemDrive, as it is documented in 
http://www.cygwin.com/cygwin-ug-net/using.html). With the current Cygwin 
version, this seems to be mixed: the open() call seems to map "/" to the 
SystemDrive while stat() maps "/" to the current drive.

I can certainly understand that it was our fault to rely on something which 
was not documented. Nevertheless, this was a real nice workaround for us to 
be able to use different Cygwin tools based on different Cygwin trees easily 
(it was even possible to let them run in parallel).

And anyway, I assume that it is a bug that both system calls behave different, 
right?

But - for us - even more important: is there any way to revert to the old 
behaviour (mapping / to CurrentDrive)? 

For the sake of completeness, here are our test cases for interested parties: 
save a.c and b.c to the root of any Windows drive, compile them to different 
binaries. Place a file \test\test.cpp in this drive. Umount / and start both. 
a.c should output an error, b.c not.

----------------- a.c ------------------------------
#include <stdio.h>

int main(void)
{
        int fd;
        fd = open("/test/test.cpp", "rt");
        if (fd == -1) {
                perror("open");
                exit(2);
        }
        return 0;
}
----------------- /a.c ------------------------------


----------------- b.c ------------------------------
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>

int main(void)
{
        struct stat s;
        if (stat("/test/test.cpp", &s) == -1) {
                perror("stat");
                exit(2);
        }
        return 0;
}
----------------- /b.c ------------------------------

-- 
Bye,

Gernot Hillier
CT SE 2
Siemens AG, Mch P

--
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/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-12-28  0:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-02 12:52 mapping root directory to SystemDrive / CurrentDrive Gernot Hillier
2004-08-03 10:51 ` Corinna Vinschen
2004-08-03 11:17   ` Gernot Hillier
2004-08-03 11:50     ` Corinna Vinschen
2004-08-03 12:00       ` Gernot Hillier
2004-08-03 13:45         ` mapping root directory to SystemDrive / CurrentDrive (documentation change needed) Christopher Faylor
2004-12-27 18:09           ` Joshua Daniel Franklin
2004-12-27 21:08             ` Pierre A. Humblet
2004-12-28  0:13               ` Joshua Daniel Franklin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).