delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/24/03:20:23

Date: Tue, 24 Nov 1998 10:20:31 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Scott Guilbeaux <guilbeau AT tisd DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: getting started
In-Reply-To: <365A155D.3DB@tisd.net>
Message-ID: <Pine.SUN.3.91.981124102012.29648J-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Mon, 23 Nov 1998, Scott Guilbeaux wrote:

> Here's a little program that will spawn another program
> 
> #include <unistd.h>
> 
> int main(void)
> {
>    execlp("progname", "progname", "param1", "param2", "param3", 0);
> }

The `exec*' family of functions is not for spawning subsidiary
programs, it is for *replacing* the current program with another one.
In other words, after the call like above, the calling program will
never get control back!

The original poster didn't have that in mind when he asked his
question, I think.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019