Mail Archives: djgpp/2011/07/12/08:53:00
> From: Georg <dosusb AT googlemail DOT com>
> Newsgroups: comp.os.msdos.djgpp
> Date: Tue, 12 Jul 2011 04:30:42 -0700 (PDT)
>
> I am trying to port a Linux program to DOS using DJGPP. This program
> uses pipe() to spawn another program in a new daemon which listens on
> the tcp/ip socket for commands from the main program.(using the local
> ip address of the PC)
>
> The pipe() function of GCC/DJGPP tells the main program that the
> daemon has been started OK.
That's not true. The DJGPP implementation of `pipe' is just this:
int
pipe(int _fildes[2])
{
errno = EACCES;
return -1;
}
So it actually tells the main program that the daemon failed to
start. Perhaps the main program doesn't bother to check the return
value or errno, but then it's a bug in that program.
> I guess this is caused since both programs are not running at the same
> time when run with DOS.
>
> Is there a way to get this to run with DJGPP somehow?
`pipe' is a function that establishes 2-way communications between 2
programs running simultaneously on the same machine. DOS does not
support such multi-programming, so `pipe' cannot work on DOS.
So there's no easy way of getting that Linux program ported to DJGPP.
You could try converting the daemon into a TSR, but that's hardly a
simple project.
Sorry.
- Raw text -