On Mon, Feb 27, 2017 at 12:00:30PM -0700, Theo de Raadt wrote: > > I think putting these in libutil is a good idea. tmux could use > > them. I'd like to have openptmfd() as you suggest as well - it'd be nice > > to hide PATH_PTMDEV as well as the PTMGET. > > > > Life would be a lot easier for portable if there was fdforkpty() as > > well. > > I agree. > > Are the -portable versions of such an interface trivial?
For tmux, yes. I already have portable forkpty() for all platforms so if we have fdforkpty() I can make openptmfd() a no-op and fdforkpty() call forkpty(). If we only had fdopenpty() and not fdforkpty() it would work but it would be more changes and I'd need to add some extra stuff for AIX. I don't think there are non-BSD platforms where openptmfd() would not be a no-op, on most you open /dev/ptmx or /dev/ptc to get a new pty master directly.