Chrooted enviroments that need ptys cannot currently use ptyfs because only one instance of ptyfs at a time is supported. The task is to enhance ptyfs so that it can be mounted multiple times. The problems that need to be solved are:
- The ptyfs code needs to be modified so that the correct path is returned depending on the mount point in the TIOCPTMGET ioctl. There was code there to do this, but it was removed because it was not working properly.
- Since there can be only one instance of each major/minor pty in the system, each mount point should only display the ptys that were created on that mount point and not others.
- ptyfs replaces the handlers for the traditional BSD style ptys when it is mounted and puts them back once it is unmounted. This handler hijacking will not work with multiple mounts. Perhaps a solution is to do it only for the first mount?
This project is implemented all in the kernel and has no documentation requirements.
For extra credit you can investigate if providing continuous numbers on each mount point (without gaps) is feasible without too much recoding, and implement it.