Re: persistent ptys

From: H. Peter Anvin
Date: Thu Sep 16 2004 - 17:37:54 EST


Followup to: <4139F3FA.1070107@xxxxxxxxxxx>
By author: Steve Underwood <steveu@xxxxxxxxxxx>
In newsgroup: linux.dev.kernel
>
> Hi,
>
> It seems BSD style ptys are on the way out, and most systems will soon
> have just Unix98 style ptys. This makes me want to move something to
> Unix98 ptys, but I'm not sure of the appropriate way. The issue is that
> things like HylaFAX expect to work with well known, persistent, names
> for modem ports. A 100% soft modem in user space can easily provide that
> with BSD ptys. With Unix98 ptys it is not so obvious what to do. Most
> commercial soft modems don't have this issue, as they are part kernel
> space/part user space designs. Obviously creating a link to a
> dynamically generated pty with a well known name, and various other
> things could be done. However, I assume other people have had to do
> similar persistent pty things, and there is a well defined common
> practice for it. Can anyone tell me what it is? :-\
>

Two options: either continue to use BSD ptys (the kinds of stuff you
describe above is actually the one case where BSD ptys is a better
choice than Unix98 ptys) *or* create symlinks -- or if that doesn't
work for you, device nodes -- dynamically.

I.e. have a program which opens /dev/ptmx, gets a slave pty with a
specific ptsname(), then does a symlink() into a suitable directory.
The symlink is your persistent name.

-hpa

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/