Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1689133
| From | Greg KH <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH RESEND] pty: show associative slave of ptmx in fdinfo |
| Date | 2017-07-17 16:50 +0200 |
| Message-ID | <u4fvs-6kS-9@gated-at.bofh.it> (permalink) |
| References | <u2vEm-3VV-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Jul 13, 2017 at 04:34:37AM +0900, Masatake YAMATO wrote: > This patch adds "tty-index" field to /proc/PID/fdinfo/N if N > specifies /dev/ptmx. The field shows the index of associative > slave pts. > > Though a minor number is given for each pts instance, ptmx is not. > It means there is no way in user-space to know the association between > file descriptors for pts/n and ptmx. (n = 0, 1, ...) > > This is different from pipe. About pipe such association can be solved > by inode of pipefs. > > Providing the way to know the association between pts/n and ptmx helps > users understand the status of running system. lsof can utilize this field. > > Signed-off-by: Masatake YAMATO <yamato@redhat.com> > --- > drivers/tty/pty.c | 12 +++++++++++- > drivers/tty/tty_io.c | 15 +++++++++++++++ > include/linux/tty_driver.h | 5 +++++ > 3 files changed, 31 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c > index 6579957..9357c6a 100644 > --- a/drivers/tty/pty.c > +++ b/drivers/tty/pty.c > @@ -669,6 +669,13 @@ static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty) > } > } > > +#ifdef CONFIG_PROC_FS There is no real need for all of the #ifdef everywhere here, if PROC_FS is not enabled, the functions will just not be called, right? Can you fix this up and resend a new version? thanks, greg k-h
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH RESEND] pty: show associative slave of ptmx in fdinfo Masatake YAMATO <yamato@redhat.com> - 2017-07-12 21:40 +0200 Re: [PATCH RESEND] pty: show associative slave of ptmx in fdinfo Greg KH <gregkh@linuxfoundation.org> - 2017-07-17 16:50 +0200
csiph-web