lkml.org 
[lkml]   [2012]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] tty: Add get- ioctls to fetch tty status
On Sat, Sep 22, 2012 at 01:07:31PM -0700, Greg Kroah-Hartman wrote:
> > drivers/tty/pty.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-
> > 1 file changed, 44 insertions(+), 1 deletion(-)
> >
> > Index: tty.git/drivers/tty/pty.c
> > ===================================================================
> > --- tty.git.orig/drivers/tty/pty.c
> > +++ tty.git/drivers/tty/pty.c
> > @@ -283,6 +283,46 @@ done:
> > return 0;
> > }
> >
> > +static ssize_t pty_show_state(struct device *dev,
> > + struct device_attribute *attr,
> > + char *buf)
> > +{
> > + struct tty_struct *tty = dev_get_drvdata(dev);
> > + int locked, exclusive, packet;
> > +
> > + tty_lock(tty);
> > + locked = test_bit(TTY_PTY_LOCK, &tty->flags);
> > + exclusive = test_bit(TTY_EXCLUSIVE, &tty->flags);
> > + packet = tty->packet;
> > + tty_unlock(tty);
> > +
> > + return snprintf(buf, PAGE_SIZE, "locked: %d exclusive: %d packet: %d\n",
> > + locked, exclusive, packet);
> > +}
>
> Sysfs is one value per file, you have three values here, please make 3
> files.
>
> And document them in Documentation/ABI/.

Hmm, sure Greg, I'll update. Thanks!


\
 
 \ /
  Last update: 2012-09-22 22:41    [W:0.229 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site