From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Plattner Subject: Re: SPLINT: sys_open missing a parameter in init/main.c Date: Mon, 29 Apr 2002 00:32:45 +0200 Sender: linux-8086-owner@vger.kernel.org Message-ID: <3CCC788D.1775C156@gmx.at> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: List-Id: Content-Type: text/plain; charset="us-ascii" To: Riley Williams Cc: Harry Kalogirou , Linux 8086 In the standard the "mode" argument is optional. It is only used together with O_CREAT as flag to define the file mode (see UNIX command chmod, etc). It is not a "beautiful" way, but this usage works. The third parameter is not defined at call, and if O_CREAT is not used, this argument with the not define value is not read. A correct implementation is done by using the va_args ! A C-method to pass variable amount of arguments. See for example printf(), how it is implemented ! With friendly regards Christoph P. Riley Williams wrote: > > Hi Harry. > > The funtion sys_open is defined with three parameters... > > int sys_open(char *filename, int flags, int mode); > > ...but in init/main.c it is called with only two parameters... > > #ifdef CONFIG_CONSOLE_SERIAL > num = sys_open("/dev/ttyS0", 2); > #else > num = sys_open("/dev/tty1", 2); > #endif > > ...and I haven't the foggiest how to correct this. Can somebody rather > more knowledgable than I am advise regarding this please? > > Best wishes from Riley. > > - > To unsubscribe from this list: send the line "unsubscribe linux-8086" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- ------------------------------------------------------- private: christoph.plattner@gmx.at company: christoph.plattner@alcatel.at