[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] system module?

From: Bruno Haible
Subject: Re: [bug-gnulib] system module?
Date: Fri, 23 Jun 2006 18:59:58 +0200
User-agent: KMail/1.9.1

Eric Blake wrote:
> What should m4 do in its syscmd() macro, then?  POSIX is clear; if m4
> is POSIX-compliant, then it executes the command using the POSIX
> sh (not necessarily /bin/sh, but that serves as a close approximation).
> But on non-POSIX platforms, such as mingw or OS/2, should syscmd
> still expect the user to have /bin/sh available, rather than passing the
> string to the native shell with all its non-portable quoting?

This is a question that you (the m4 maintainers) have to answer.

If you want m4 on mingw to call cmd.exe, then continue using the system()
function, but please also document in the m4 documentation, node "Syscmd",
that the argument on non-POSIX platforms is not a shell command.

If you want m4 on mingw to call sh.exe, then you can use gnulib's
'execute' module, or contribute a posix_system() function that
implements an invocation of "sh" including the POSIX-specified
signal handling and return value.

> I thought one of gnulib's goals was to provide useful POSIX semantics atop
> non-POSIX systems, where possible.

Yes. The particular point here is that not everyone will want posix_system().
There are valid uses of the system's system() function.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]