This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] AmigaOS 4 port contribution
"Zack Weinberg" <zack@codesourcery.com> writes:
> Can you tell me if system() invokes a command line interpreter? (in
> other words, can you write complex commands involving shell variables
> etc. and feed them to system()? What about popen()?) If so, is there
> a lower level interface that avoids that?
system() is implemented using SystemTagList() with the SYS_UserShell
tag set to TRUE. This means that it will use the full shell
interpreter. If you use SystemTagList() directly, you can set it to
FALSE, but that just means that the more restricted boot shell will be
used, so it will only disable some CLI features. There is a very low
level function RunCommand() which avoids the shell altogether, but that
requires you to load the program manually using LoadSeg(), which also
means you have to locate it in the path manually. Also, RunCommand()
does not do some other stuff like set the program name and directory.
It's possible to use it, but not without adding a lot of extra
house-keeping.
// Marcus