🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.unix
Article #732

Is there a standard prototype for `execvp'?

#732
From: Donn Terry
Date: Fri, 01 Feb 1991 17:45
53 lines
2471 bytes
Submitted-by: donn@hpfcrn.fc.hp.com (Donn Terry)

>Submitted-by: rfg@lupine.uucp (Ron Guilmette)

>Reading that book, it seems that the POSIX committee didn't want to
>use ANSI C function prototypes for their specification of the C language
>binding because prototypes were too "new-fangled".  Specifically, they
>apparently choose not to express the binding in terms of prototypes because:

>	"... the Working Group was aware that some vendors would wish
>	to implement POSIX in terms of a binding to an historical
>	variant of the C language..."

That was appropriate at the time.  The -1990 version uses ANSI C
prototypes (now that ANSI C is approved, and implementations are
available).  

>In addition to avoiding prototypes, the POSIX folks also (apparently)
>decided to avoid the use of ANSI C type qualifiers (i.e. "const" and
>"volatile") in the C binding.

Avoided for the same reasons.

>Now even thought I don't really keep up on such things, I assume that
>some progress has been made since 1988.  Is there now also an ANSI C
>binding for POSIX?  If so, please tell me the exact name of *that*
>document so that I can go buy a copy.

Specifically IEEE Std. 1003.1-1990
a.k.a. ISO/IEC JTC-1 IS 9945-1:1990
(Available from IEEE at the same place you got your -1988 version.)

>For example, my intuition tells me that a "proper" prototype for `execvp'
>should look like:

>	extern int execvp (const char *, const char *const *);

The new standard has the declaration as:

	int execvp (const char *file, char *const argv[]);

It was generally agreed during balloting that what really was wanted
was "const char * const argv[]".  However, ANSI C disagrees: that's
a syntax error!

(There's a bunch of rationale about why the specific declaration was
chosen, I won't repeat it here, but the bottom line is that given
that you can't have both const's, this is the best choice remaining.)

Donn Terry
Speaking only for myself.

Volume-Number: Volume 22, Number 98
Technical Details
Message-ID: <17574@cs.utexas.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!jsq
References: <17528@cs.utexas.edu> <17573@cs.utexas.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!jsq
From: donn@hpfcrn.fc.hp.com (Donn Terry)
Newsgroups: comp.std.unix
Subject: Is there a standard prototype for `execvp'?
Message-ID: <17574@cs.utexas.edu>
Date: 1 Feb 91 17:45:53 GMT
References: <17528@cs.utexas.edu> <17573@cs.utexas.edu>
Sender: jsq@cs.utexas.edu
Lines: 53
Approved: jsq@cs.utexas.edu (Moderator, John S. Quarterman)
X-Submissions: std-unix@uunet.uu.net