Messages in this thread | | | Date | Sun, 23 Sep 2012 00:11:44 +0400 | From | Cyrill Gorcunov <> | Subject | Re: [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!
| |