lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120922201144.GD11610@moon>
Date:	Sun, 23 Sep 2012 00:11:44 +0400
From:	Cyrill Gorcunov <gorcunov@...nvz.org>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Alan Cox <alan@...rguk.ukuu.org.uk>,
	LKML <linux-kernel@...r.kernel.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	Pavel Emelyanov <xemul@...allels.com>,
	Jiri Slaby <jslaby@...e.cz>
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!
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ