Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 47480 invoked from network); 21 Jul 2006 09:21:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Jul 2006 09:21:35 -0000 Received: (qmail 44744 invoked by uid 500); 21 Jul 2006 09:21:34 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 44732 invoked by uid 500); 21 Jul 2006 09:21:34 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 44721 invoked by uid 99); 21 Jul 2006 09:21:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jul 2006 02:21:34 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [212.82.213.172] (HELO exkiv.kyiv.vdiweb.com) (212.82.213.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jul 2006 02:21:33 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: string methods thread safety Date: Fri, 21 Jul 2006 12:21:28 +0300 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: string methods thread safety Thread-Index: AcasXWsAxt8YuXmkRUGNxI8zcQw5PgALxUKQ From: "Farid Zaripov" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: Martin Sebor [mailto:sebor@roguewave.com]=20 > Sent: Friday, July 21, 2006 3:34 AM > To: stdcxx-dev@incubator.apache.org > Subject: Re: string methods thread safety >=20 > > // returns pid of the created process > > // returns -1 if failed > > // note: argv[0] should be equal to path > > _TEST_EXPORT rw_pid_t=20 > > rw_process_create (const char* path, char* const argv []); >=20 > I'm not sure about the second argument. Is it the most=20 > convenient interface? I just copied the interface from execv function. This interface is useful when execute self copy to prevent unnecessary translation of the array argv[] to the array of char. > Wouldn't something closer to=20 > rw_system() be easier to use? (If so, you might want to move=20 > rw_process_create to the .cpp file and make it static and=20 > call it from the new vararg function). Since rw_process_create just calls execv() after fork() I think that it will be useful create a full set of functions rw_process_createxx similar to a set of functions execxx. Plus the function rw_create_process (without suffixes) with the interface like rw_system(). > > + // the child process > > + execv (path, argv); > > + > > + // the execvp returns only if an error occurs > > + rw_fatal (0, __FILE__, __LINE__, "execvp failed: :=20 > errno =3D %{#m}=20 > > + (%{m})"); > > + > > + exit (1); >=20 > FYI: rw_fatal() doesn't return so there's no need to call exit(). >=20 > I'm not sure rw_fatal() is appropriate, though. The test=20 > might be able to continue with other things after a failure. I think in that case the test shouldn't to continue because after a fork() succeeded it will be a copy of the parent process. What for to continue a child copy? Farid.