question about execv
Chris Sutcliffe <[email protected]> Tue, 15 Jun 2010 14:45:36 -0400
| Newsgroups | gmane.comp.gnu.mingw.msys |
|---|---|
| Message-ID | <[email protected]> |
Hi All,
I'm working with Andy Koppe to port mintty to MSYS and I've hit a bit
of snag. One of the features of mintty is to spawn a new terminal
window from within itself. To that end, for Cygwin, mintty uses:
execv("/proc/self/exe", argv);
Since MSYS doesn't have the /proc filesystem, what I've come up with is:
char path[MAX_PATH];
realpath(argv[0], path);
execv(path, argv);
Which works well if mintty is spawned from within an MSYS console.
The problem is that if mintty is run directly from within Windows
(i.e. via a 'Run' dialogue), execv fails. I assume because it doesn't
like the path:
C:/msys/1.0/bin/mintty.exe
Is there an internal MSYS function to convert the path to a 'native' MSYS path?
Thank you,
Chris
--
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo