Subject: Re: semctl() change last arg to '...'?
To: None <current-users@NetBSD.ORG>
From: Christoph Badura <bad@ora.de>
List: current-users
Date: 11/09/1997 18:52:58
tv@pobox.com (Todd Vierling) writes:
>I'm currently attempting to port Listproc 6.0c to NetBSD 1.3(alpha), and in
>order to make the system interactive, it calls semaphore functions including
>semctl().  However, it calls semctl() with 4 args in some cases, and 3 args
>in others.

The calls with only three args are bogus.  semctl() always takes 4 args.
Although you used get away with sloppy code like this.  Though not, if you
use lint(1).

>Was semctl() orginally designed with variable arguments (that is, the last
>arg was optional when there was no argument to pass)?  If so, would there be
>harm in changing our definition to semctl(int, int, int, ...), making the
>last arg automatically NULL when omitted?

No. semctl() is NOT a variadic function.  And declaring it as such does NOT
make the last arg automatically NULL when omitted.

-- 
Christoph Badura

Now available in print: Lion's Commentary on UNIX 6th Edition, with Source Code
			http://www.peer-to-peer.com/