All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Plattner <christoph.plattner@gmx.at>
To: Riley Williams <Riley@Williams.Name>
Cc: Harry Kalogirou <harkal@gmx.net>,
	Linux 8086 <linux-8086@vger.kernel.org>
Subject: Re: SPLINT: sys_open missing a parameter in init/main.c
Date: Mon, 29 Apr 2002 00:32:45 +0200	[thread overview]
Message-ID: <3CCC788D.1775C156@gmx.at> (raw)
In-Reply-To: Pine.LNX.4.21.0204281819010.8763-100000@Consulate.UFP.CX

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


  reply	other threads:[~2002-04-28 22:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-28 21:15 SPLINT: sys_open missing a parameter in init/main.c Riley Williams
2002-04-28 22:32 ` Christoph Plattner [this message]
2002-04-29  0:11 ` Alan Cox
2002-04-29 21:20   ` Riley Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CCC788D.1775C156@gmx.at \
    --to=christoph.plattner@gmx.at \
    --cc=Riley@Williams.Name \
    --cc=harkal@gmx.net \
    --cc=linux-8086@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.