monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] bug report ver 0.16, on windows


From: Jon Bright
Subject: Re: [Monotone-devel] bug report ver 0.16, on windows
Date: Tue, 22 Feb 2005 12:26:16 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Hi,

Nathaniel Smith wrote:

Hmm; we don't actually need most of lposix.c; all we actually use is
fork, exec, wait, and chmod.  (And, of course, chmod can be a no-op on
Windows).  We were sort of hoping that mingw would just make those
work, but I don't know if anyone has actually confirmed that or not...

It doesn't. To give you an idea, here's what I currently have #ifdef-ed out. With this (and matching changes at the function level, and a few others - I'll get a patch done), it compiles:

#ifndef WIN32
        {"chmod",             Pchmod},
        {"chown",             Pchown},
        {"ctermid",           Pctermid},
        {"fork",              Pfork},
        {"getgroup",          Pgetgroup},
        {"getlogin",          Pgetlogin},
        {"getpasswd",         Pgetpasswd},
        {"getprocessid",      Pgetprocessid},
        {"kill",              Pkill},
        {"link",              Plink},
        {"mkfifo",            Pmkfifo},
        {"pathconf",          Ppathconf},
        {"readlink",          Preadlink},
        {"setgid",            Psetgid},
        {"setuid",            Psetuid},
        {"sleep",             Psleep},
        {"symlink",           Psymlink},
        {"sysconf",           Psysconf},
        {"times",             Ptimes},
        {"ttyname",           Pttyname},
        {"umask",             Pumask},
        {"uname",             Puname},
        {"wait",              Pwait},
#endif

Where are fork() and wait() being used? Should I maybe look at adding a forkandexec() call (which is supported everywhere), since Windows has no fork() ? wait() could then be used with the result of that...

I figured it would be better, security-wise, to just not have chmod() on Windows, causing errors rather than quietly giving unexpected results, but I can easily make it a no-op.

Overall, several of the above functions *could* be made to work broadly analogously on Windows, but my main goal here was getting stuff to compile.

--
Jon Bright
Silicon Circus Ltd.
http://www.siliconcircus.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]