Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!think!ames!ucbcad!ucbvax!decvax!ima!haddock!karl From: karl@haddock.UUCP (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Function prototypes versus open() Message-ID: <514@haddock.UUCP> Date: Fri, 5-Jun-87 18:49:50 EDT Article-I.D.: haddock.514 Posted: Fri Jun 5 18:49:50 1987 Date-Received: Wed, 10-Jun-87 01:11:45 EDT References: <18346@ucbvax.BERKELEY.EDU> <8042@utzoo.UUCP> <2210@hoptoad.uucp> <5927@brl-smoke.ARPA> <2242@hoptoad.uucp> Reply-To: karl@haddock.ISC.COM.UUCP (Karl Heuer) Organization: Interactive Systems, Boston Lines: 27 Summary: open shouldn't have been changed In article <2242@hoptoad.uucp> gnu@hoptoad.uucp (John Gilmore) writes: >Let's suppose that someone writes a compiler such that [varargs functions >must be declared with ellipses]. If such a compiler was ever used to compile >a Unix program, [with no #include and with open() not explicitly declared,] >trouble would arise. Well, an ANSI compiler is not even obliged to provide an open() function, so there's no problem. :-) Instead of answering your question, I'd just like to mention that I think the addition of a third argument to open() was a really dumb move by AT&T. This causes open() to be weakly variadic without need, and creates nonportable code since neither BSD nor Research UNIX has implemented this, to the best of my knowledge. Now, I'll grant that it's useful to have some of the features of creat() and open() available in one system call. I only disagree with the implementation. I would've made a new system call, cropen(path, mode|flags); powerful enough to supersede both creat() and open() (which could then be moved into section 3 and/or marked as deprecated). Other systems could have a SysV emulation library that defines cropen(3) in terms of open(2) and creat(2), where possible. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint (Note "mode|flags" implies the Read/Write/RdWr option would be higher bits. Alternately, they could be separate arguments.) Brought to you by Super Global Mega Corp .com