From: utzoo!decvax!harpo!eagle!mhuxt!mhuxi!mhuxj!mhuxv!burl!sb1!ll1!ihldt!ihnp4!ixn5c!inuxc!pur-ee!uiucdcs!emrath Newsgroups: net.unix-wizards Title: Re: Is it true in 4.2 ? - (nf) Article-I.D.: uiucdcs.1334 Posted: Fri Jan 14 06:26:59 1983 Received: Sun Jan 16 04:02:34 1983 #R:seismo:-19600:uiucdcs:13700017:000:1011 uiucdcs!emrath Jan 14 04:35:00 1983 It shouldn't break anything on a vax. C function calls generate a "CALLS" vax instruction which pushes the actual number of arguments on the stack, which is computed by the C compiler. The "RET" instruction automatically pops the correct number of arguments. The kernel must examine this value on the stack (normal C functions can't easily get at it) in order to determine if it is a 2 or 3 argument open call. An assembler routine can also get at the number of args and a C function could do: func(arg1,arg2,...) { int numargs; ... numargs = *((int *)&arg1 - 1); ... which is kind of gross and very machine & implementation dependent. I don't know about other machines and implementations. I imagine there are those where the number of arguments is not a hidden argument to the called function. For these, a possible solution is to allow new modes of say 4,5 & 6 to indicate that a third argument is present (whatever is it). If this is done, very few programs should break (only those that deserve to!).