X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com Date: Tue, 12 Jul 2011 08:20:43 -0400 Message-Id: From: Eli Zaretskii To: djgpp AT delorie DOT com In-reply-to: <639f9631-f9d6-42b8-bf70-f943afe5afa8 AT n28g2000vbs DOT googlegroups DOT com> (message from Georg on Tue, 12 Jul 2011 04:30:42 -0700 (PDT)) Subject: Re: Pipe() References: <639f9631-f9d6-42b8-bf70-f943afe5afa8 AT n28g2000vbs DOT googlegroups DOT com> Reply-To: djgpp AT delorie DOT com > From: Georg > 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.