Received: by 10.151.157.9 with SMTP id j9cs399592ybo;
        Wed, 10 Mar 2010 04:13:04 -0800 (PST)
Received: by 10.150.214.1 with SMTP id m1mr1111907ybg.215.1268223184361;
        Wed, 10 Mar 2010 04:13:04 -0800 (PST)
Return-Path: <mnecasek@yahoo.com>
Received: from www.openwatcom.org (216-55-181-205.dedicated.abac.net [216.55.181.205])
        by mx.google.com with ESMTP id 16si10019984iwn.19.2010.03.10.04.13.02;
        Wed, 10 Mar 2010 04:13:03 -0800 (PST)
Received-SPF: neutral (google.com: 216.55.181.205 is neither permitted nor denied by domain of mnecasek@yahoo.com) client-ip=216.55.181.205;
Authentication-Results: mx.google.com; spf=neutral (google.com: 216.55.181.205 is neither permitted nor denied by domain of mnecasek@yahoo.com) smtp.mail=mnecasek@yahoo.com; dkim=pass (test mode) header.i=@yahoo.com
Received: (qmail 30636 invoked by uid 110); 10 Mar 2010 04:13:02 -0800
Delivered-To: 1-peter@openwatcom.org
Received: (qmail 30631 invoked from network); 10 Mar 2010 04:13:02 -0800
Received: from web81404.mail.mud.yahoo.com (68.142.199.132)
  by 216-55-181-205.dedicated.abac.net with SMTP; 10 Mar 2010 04:13:02 -0800
Received: (qmail 74905 invoked by uid 60001); 10 Mar 2010 12:12:31 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1268223151; bh=32OrOFFV1nvvnmIjDnkbLMP7LR9QdYztMn9UCZWZmR8=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=KSECPhuFfPKRf91peQUXLT9+n4VieZ95OiAttGif71l/aDCULFY+k7JY2DUVARIpoa6B8BoEohSJ+Xiv5Mreo4hKgfldvsa1qz/YJ/KLWU2yoRFErYkp70oSZVlaQZ1o45HPnt57MjXR/QJrAVeT/5Kx32U6WycROkZvdS4fa0k=
DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type;
  b=11101480bOZp29FsUcPOXe16gtkPqa1P27/FUI8LpfQgxyx5YLmlgjRvDqrv8T6YfWNRgsaFou8YLTCu/8ACMBO0pNen5+ZpdGcUJ2alo8UCj7qrMPvA3lxaZ9LAfSBeQ6uz/DGhKaEs+0YIeWEf2UVg+lCYNjxESx+x2Xts8Rs=;
Message-ID: <514280.70313.qm@web81404.mail.mud.yahoo.com>
X-YMail-OSG: G93ph9AVM1kE4vx5eMS6dU0IUdepse845V4CgsoVlDu9bOK
 C14rjgWyATJHsAd2LYnm7pRww0wnKSa6Tf.Gbkd3uSsGVZRmCrWtF5W1vf0S
 xKQvOOhTkg7nhRMTnMpwVrUom56Y4rLPn5JBfQ4zGpz19Lt7L2x3Z6DAmJr3
 Xl.CrCSUVp5A7rsuND5ylhFjR14GVPhkSYg7TdTeMFGhxj87zOVSXLyrVgj_
 7B3r51IjE.T4ymxFHz9Oy5tMLusSLDSvr4R0vmrMHekYwdbN1Xplz6havGpD
 oMAc_Zh0NftFVYrFIjDh1uqGFknVSBBgYQPl2WYQa7Xdx.8lG2psJX2wQH3g
 xAO2K72BCXNo-
Received: from [192.18.8.1] by web81404.mail.mud.yahoo.com via HTTP; Wed, 10 Mar 2010 04:12:31 PST
X-Mailer: YahooMailRC/300.3 YahooMailWebService/0.8.100.260964
References: <4B95AD0B.40406@vtc.vsc.edu> <526580.37972.qm@web81402.mail.mud.yahoo.com> <4B965315.5010307@openwatcom.org> <16265.40180.qm@web81408.mail.mud.yahoo.com> <4B9703D5.5060806@openwatcom.org> <207030.16169.qm@web81401.mail.mud.yahoo.com> <4B977E6D.8060004@openwatcom.org>
Date: Wed, 10 Mar 2010 04:12:31 -0800 (PST)
From: Michal Necasek <mnecasek@yahoo.com>
Subject: Re: Clib tests.
To: "Peter C. Chapin" <peter@openwatcom.org>
Cc: Leif Ekblad <leif@rdos.net>
In-Reply-To: <4B977E6D.8060004@openwatcom.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii


      Hi Peter,

 The process test is fairly clever, that is true enough. Only one executable is needed to test the parent/child process relationship, which is good.

 But it seems to me that Leif completely misunderstood what exec() does... as you know, the standard UNIX way of spawning child processes is a fork() followed by exec(). That first creates a copy of the parent process (which becomes the child process) and then replaces the copy by a new process image (the actual child).

 The reason why the test was wrong should be pretty clear. Once you exec() another process, the caller goes away. The clib documentation is crystal clear: "If the child process is successfully loaded, it replaces the current process in memory.  No return is made to the original program."

 The test read:

    rc = execve( ProgramName, child_args, child_envp );
    VERIFY( rc == CHILD_RC );
    ...
    printf( "Tests completed (%s).\n", ProgramName );


 The 'completed' message could obviously never be printed. The execve() call starts a child process which takes a different code path; the parent process goes away and does not continue. That is clear from the fact that the test, when calling execve(), no longer prints the message at the end - just try it.

 I hope both you and Leif now understand why the test execve() was wrong and I had to undo it.


         Regards,

              Michal



----- Original Message ----
From: Peter C. Chapin <peter@openwatcom.org>
Subject: Re: Clib tests.

Here's what Leif says in the newsgroups about the exec() business.

Yes, but the proctest is kind of clever. When it does the spawn tests, it spawns itself (and waits for completion). When the program is run with certain parameters, it knows it called itself, and just tests its environment and exits with ok or failure. I can see no reason why it can't exec() itself as well. Exec will return when the program run exists for some reason.

Peter

