Article View: rec.arts.sf.written
Article #751Re: โThe end of software secrecy is almost upon
From: Dan Cross
Date: Fri, 30 Oct 2026 02:22
Date: Fri, 30 Oct 2026 02:22
114 lines
4677 bytes
4677 bytes
In article <20261030005434.00005458@yahoo.com>,
Michael S <already5chosen@yahoo.com> wrote:
>On Thu, 29 Oct 2026 22:26:40 GMT
>scott@slp53.sl.home (Scott Lurndal) wrote:
>
>> Michael S <already5chosen@yahoo.com> writes:
>> >On Thu, 29 Oct 2026 16:20:39 -0000 (UTC)
>> >boltar@caprica.universe wrote:
>> >
>> >> On Wed, 28 Oct 2026 14:09:32 -0700
>> >> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
>> >> >On 10/28/2026 2:06 AM, boltar@caprica.universe wrote:
>> >> >> On Mon, 26 Oct 2026 22:04:33 +0200
>> >> >> Michael S <already5chosen@yahoo.com> gabbled:
>> >> >>> On Mon, 26 Oct 2026 09:51:51 -0000 (UTC)
>> >> >>> boltar@caprica.universe wrote:
>> >> >>>> Go ahead and remain clueless.
>> >> >>>>
>> >> >>>
>> >> >>>
>> >> >>> system() can do most of the same things as spawn() family.
>> >> >>
>> >> >> Rubbish, you clearly didn't bother to spend 2 mins googling.
>> >> >>
>> >> >>> The problem with system() is not that. Often not even an
>> >> >>> efficiency. The problem with system() identified most easily if
>> >> >>> we ask ourself "Why do we want xyz in standard library?"
>> >> >>
>> >> >> The problem with system is its fire and forget - all you can do
>> >> >> with it is collect its exit code when its done. You can't
>> >> >> communicate with it via pipes, you can't control it via signals
>> >> >> (well, not easily), you can't set its
>> >> >
>> >> >> process group, tty and on and on. Oh, and it also fires up the
>> >> >> default shell
>> >> >to
>> >> >> do the actual execution making it hideously inefficient. No
>> >> >> serious unix dev uses system() unless thay have absolutely no
>> >> >> choice or it really is a case of
>> >> >
>> >> >> "go run this, I don't care what happens".
>> >> >>
>> >> >>
>> >> >
>> >> >Right. std::system, at least when I use it, makes the caller block
>> >> >until the process is done.
>> >>
>> >> Thats true. Its been so long since I used it I'd forgotten about
>> >> that. Makes it even less useful.
>> >>
>> >
>> >Does it block when your command processor is bash and your command
>> >string is "my_subprocess &"?
>>
>> You might need to do 'nohup my_subprocess &' if my_subprocess
>> doesn't intercept SIGHUP.
>
>
>You are likely right. Otherwise OS will kill my_subprocess at about the
>same time the caller of system() gets control back.
>I would not figure it out myself.
Only if you intended to close the TTY the programs were started
on. Otherwise, I don't see why it would be necessary:
```
term% cat a.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
int
main(void)
{
struct tm *t;
time_t now = time(NULL);
printf("Starting child, time is %s", asctime(gmtime(&now)));
sleep(5);
now = time(NULL);
printf("Bye bye, now is %s", asctime(gmtime(&now)));
}
term% cat b.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
int
main(void)
{
time_t now = time(NULL);
printf("Parent starting, time is %s", asctime(gmtime(&now)));
system("./a &");
printf("./a started in background\n");
sleep(2);
now = time(NULL);
printf("Ahhh!!! time is %s", asctime(gmtime(&now)));
return 0;
}
term% make a
cc -O2 -pipe -o a a.c
term% make b
cc -O2 -pipe -o b b.c
term% ./b
Parent starting, time is Fri Oct 30 02:21:06 2026
./a started in background
Starting child, time is Fri Oct 30 02:21:06 2026
Ahhh!!! time is Fri Oct 30 02:21:08 2026
term% Bye bye, now is Fri Oct 30 02:21:11 2026
```
- Dan C.
Technical Details
Message-ID:
<11c0v1j$her$1@reader2.panix.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!panix!.POSTED.spitfire.i.gajendra.net!not-for-mailReferences:
<11amvre$15far$1@dont-email.me> <20261029230758.0000262c@yahoo.com> <AKPES.62186$BaS5.8822@fx35.iad> <20261030005434.00005458@yahoo.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail From: cross@spitfire.i.gajendra.net (Dan Cross) Newsgroups: rec.arts.sf.written,comp.lang.fortran,comp.lang.c++,alt.comp.lang.rust,alt.folklore.computers Subject: Re: โThe end of software secrecy is almost upon Date: Fri, 30 Oct 2026 02:22:43 -0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Message-ID: <11c0v1j$her$1@reader2.panix.com> References: <11amvre$15far$1@dont-email.me> <20261029230758.0000262c@yahoo.com> <AKPES.62186$BaS5.8822@fx35.iad> <20261030005434.00005458@yahoo.com> Injection-Date: Fri, 30 Oct 2026 02:22:43 -0000 (UTC) Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80"; logging-data="17883"; mail-complaints-to="abuse@panix.com" X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Originator: cross@spitfire.i.gajendra.net (Dan Cross)