Age | Commit message (Collapse) | Author |
|
Dealing with the unsigned overflow propagation here just seems unreasonably
error prone. Let's limit ourselves to 2GB buffer sizes instead.
|
|
|
|
..to prepare for adding a BlockDevice class.
|
|
|
|
|
|
The vast majority of them will be owned by 0:0 (the default.)
However, PTY pairs will now be owned by the uid:gid of the opening process.
|
|
This ownership model is a bit confusing. There's a retain cycle between
MasterPTY and SlavePTY, but it's broken when the SlavePTY is closed, meaning
that there are no more FileDescriptors referring to it.
|
|
This required a fair bit of plumbing. The CharacterDevice::close() virtual
will now be closed by ~FileDescriptor(), allowing device implementations to
do custom cleanup at that point.
One big problem remains: if the master PTY is closed before the slave PTY,
we go into crashy land.
|
|
You're never gonna be right 100% of the time when guessing how much buffer
space you need. This avoids having to make that type of decision in a bunch
of cases. :^)
|
|
You can now open as many PTY pairs as you like. Well, it's actually capped
at 8 for now, but it's just a constant and trivial to change.
Unregistering a PTY pair is untested because I didn't want to start
mucking with that in Terminal right now.
|
|
This way we don't buffer ungodly amounts of output in the kernel when doing
e.g "cat /dev/random" on a PTY.
|
|
|
|
|
|
Via the TIOCSCTTY and TIOCNOTTY ioctls.
|
|
For now, there are four hard-coded PTYs: /dev/pt{m,s}[0123]
Use this in the Terminal to open a pty pair and spawn a shell.
|