[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1276291932.2154.45.camel@itpsd6lap>
Date: Fri, 11 Jun 2010 23:32:12 +0200
From: Samo Pogacnik <samo_pogacnik@....net>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: linux-embedded <linux-embedded@...r.kernel.org>,
linux kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] detour TTY driver - now ttyprintk
> > +#define TPKRLEV (('e'<<8) | 0) /* Wait for ttyprintk ratelimiting event*/
> > +static int tpk_ioctl(struct tty_struct *tty, struct file *file,
> > + unsigned int cmd, unsigned long arg)
> > +{
> > + struct ttyprintk_port *port;
> > +
> > + port = tty->driver_data;
> > +
> > + if (!port)
> > + return -EINVAL;
> > +
> > + switch (cmd) {
> > + case TPKRLEV:
> > + wait_event_interruptible(ttyprintk_ratelimit_wq,
> > + (ttyprintk_ratelimit_event != 0));
>
> Ok that wasn't quite what I had in mind.
>
> What I was thinking was needed was this
>
> /* Stop TIOCCONS */
> case TIOCCONS:
> return -EOPNOTSUPP;
>
> only it won't work that way. I'll sort that out in tty_io.c once the
> driver is happy. That way anything trying to mis-redirect the console
> will get stopped early which is probably more reliable than a ratelimit ?
>
I'm thinking to leave the ratelimit support in for the time being. I had
in mind cases, when someone does
"cat /proc/kmsg > dev/ttyprintk" or
suppose the console is redirected to ttyprintk (which i would like to be
able to do from user program) and then someone does:
"cat /proc/kmsg > /dev/console"... or
if console is redirected after this command ?
Were you thinking of some other mis-redirection case?
Samo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists