This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 4.3 target deprecation proposals
On Wed, Jan 23, 2008 at 07:28:23PM -0500, DJ Delorie wrote:
>
> > You can't cross-test, with DejaGnu running elsewhere?
>
> I've tried. The problem is communication between the DOS system (or
> emulator) and the host system. DOS isn't kind to networking,
> semaphores, or anything else that hints at multiprocessing.
Under Linux with DOSEMU, it should be fairly simple.
Create a named pipe.
On the DOS side, use a shell script to read one line from the pipe.
On the Linux side, prepare a DOS shell script or batch for the DOS side
to execute. (Remember the carriage returns where appropriate.) Then,
echo a crlf into the named pipe.
The read on the DOS side will now finish. Go execute the job. Then echo
your return code into a file, read another line from the named pipe, and
loop.
On the Linux side, echo another crlf into the named pipe; this waits for
the DOS side. Then read the return code from the file.
You might (with a sufficiently modern bash on the Linux side) write your
script with something like
#! /bin/bash
printf "%q " "$0" "$@" > script
echo -e '\r' > thepipe
echo Waiting for return code
echo -e '\r' > thepipe
read rc < rc
exit $rc
and link this to every command name you want to be able to execute.
On the DOS side,
:
while true
do
echo Waiting for command
read dummy < thepipe
sh script
echo $? > rc
read dummy < thepipe
done
Disclaimer: I haven't really done more than a quick test of named pipe
reading. I'm sure there are some subtilities here.