Sujet : Re: Running an editor from ANSI C
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 08. Jun 2024, 01:36:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240607173327.865@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-06-07, Malcolm McLean <
malcolm.arthur.mclean@gmail.com> wrote:
On 07/06/2024 21:04, Scott Lurndal wrote:
How does your pure "C" shell
spawn a new process without using posix or other OS-specific
APIs?
>
It can call "system".
1. System is an interface to someone else's existing shell1
2. To do process coordination using "system", you will have to
rely on implementation-specific syntax, like POSIX.
For instance system("command1 | command2 > file").
As soon as you rely on any specific command syntax in
system(), your program is no longer maximally portable ISO C;
it is a mixed-language program.
3. A conforming C implementation need not provide a command
interpreter, in which case system(NULL) returns zero.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca