pseudo-terminal masters

Bruce Dawson jbd at codemeta.com
Tue Jan 13 17:21:36 EST 2009


You can look at the modification date/time of (for example) /dev/pts/9
if you want to know when the last activity occurred.

--Bruce

Bill McGonigle wrote:
> Hi, all,
>
> Anybody familiar with the pseudoterminal setup on linux?
>
> I've got some scripts which look for idle time on connections.  They're 
> currently using the output of 'w' which I see now is really just 
> reporting the last modified date of /dev/pts/x, so I can throw out the 
> 'w' parsing.
>
> However, /dev/pts/x's modification date depends on data written to the 
> terminal by the system (for lack of better terms).  What I actually want 
> is to figure out idle time based on input by the user.
>
> On some other unixes there are /dev/ptm/x which represents this, but in 
> linux, apparently you open /dev/ptmx which returns to you a filehandle 
> for a new ptm, but I'm not sure how to find that from userspace.
>
> If I knew what I was looking for I wouldn't mind implementing a wrapper 
> in c, but I'm not sure where to look.
>
> Thanks,
> -Bill
>
>   



More information about the gnhlug-discuss mailing list