bug-bash
[Top][All Lists]
Advanced

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

Re: Bash for Windows


From: Hector Chu
Subject: Re: Bash for Windows
Date: Sat, 23 Aug 2008 00:36:02 +0100

This port uses mingw32 to build, producing a so called native build of
bash. The existing code paths are retained (unlike earlier ports),
increasing maintainability.

Most attempts have difficulty with reconciling the use of fork and
exec in the execute code paths. Windows only has a CreateProcess
function which allows a fresh child process loaded from an executable
to be spawned. The simplest solution I adopted is to copy the data
from the parent bash to the child bash over a pipe. This means
variables, history etc. The location to jump to is also sent across,
so the child can start executing after the 'fork'.

To deal with the possibility of the child exec'ing, the parent shell
waits for the child to do the exec. The child execs by spawning the
new process, piping the PID back to the parent, and then exiting. The
parent now has the real PID and can wait on it if needed.

In terms of code impact, there is a 1800 line new file, and ifdef'ed
code scattered around the other various files. Each change in existing
files is very small, around 1-10 lines in each place. 38 files were
changed. 2 added.

2008/8/23 Chet Ramey <address@hidden>:
> Hector Chu wrote:
>>
>> I've ported bash to Windows and would like my changes to be part of
>> the main codebase. Would there be any interest in doing this?
>
> Tell me more.  What makes your port different from the existing ones?
>
> Chet
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>
> Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/
>




reply via email to

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