Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!mit-eddie!genrad!decvax!decwrl!pyramid!prls!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.c Subject: Re: Function prototypes versus open() Message-ID: <821@mcgill-vision.UUCP> Date: Mon, 22-Jun-87 23:26:01 EDT Article-I.D.: mcgill-v.821 Posted: Mon Jun 22 23:26:01 1987 Date-Received: Sat, 27-Jun-87 04:48:29 EDT References: <18346@ucbvax.BERKELEY.EDU> <8042@utzoo.UUCP> <2210@hoptoad.uucp> <1125@copper.TEK.COM> Organization: McGill University, Montreal Lines: 30 In article <1125@copper.TEK.COM>, stevesu@copper.TEK.COM (Steve Summit) writes: > In article <514@haddock.UUCP>, karl@haddock.UUCP (Karl Heuer) writes: >> I think the addition of a third argument to open() was a really dumb >> move by AT&T. [...] since neither BSD nor Research UNIX has >> implemented this, to the best of my knowledge. As both stevesu and someone else (Chris Torek I think?) point out, BSD 4.2 and 4.3 both have three-argument open(). > I really like the new, optional third argument to open(). It is one > of the few cases I know of in the Unix world in which a truly new > feature was added to an existing call in a backwards-compatible way. > I first came across it in 4.xBSD (which does have it, by the way) and > was astonished that Berkeley had done something that clever, since > backwards-incompatibility is usually their battle cry. (I now know > that it was implemented first at AT&T, and emulated in BSD.) Well, I don't know about the AT&T implementation, but the BSD open() most emphatically does not have an optional third argument! It has three, exactly three, arguments. It just happens that on most BSD machines, you can get away with passing fewer arguments that the routine wants provided it ignores the extra ones. This means that you can get away with pretending it's optional, but that doesn't make it optional at all. Wait for the day you have to port to a machine whose compiler treats optional arguments differently - it'll be the day this burns you. der Mouse (mouse@mcgill-vision.uucp) Brought to you by Super Global Mega Corp .com