summaryrefslogtreecommitdiff
path: root/Kernel/SlavePTY.cpp
AgeCommit message (Collapse)Author
2019-02-25Kernel: Make syscalls that take a buffer size use ssize_t instead of size_t.Andreas Kling
Dealing with the unsigned overflow propagation here just seems unreasonably error prone. Let's limit ourselves to 2GB buffer sizes instead.
2019-02-17Kernel: Have devices automagically register themselves with the VFS.Andreas Kling
2019-02-16Kernel: Add Device base class for CharacterDevice.Andreas Kling
..to prepare for adding a BlockDevice class.
2019-02-05Kernel: Writing to a slave PTY should yield EIO if the master is closed.Andreas Kling
2019-02-05Kernel: Reading from a slave PTY should give EOF if master PTY is closed.Andreas Kling
2019-01-31Add uid and gid to CharacterDevices.Andreas Kling
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.
2019-01-30Let the slave PTY keep the master PTY alive.Andreas Kling
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.
2019-01-30Deallocate PTY's when they close.Andreas Kling
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.
2019-01-30Add a String::format() and use that in place of ksprintf() in the Kernel.Andreas Kling
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. :^)
2019-01-30Add a /dev/pts filesystem and make PTY allocation dynamic.Andreas Kling
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.
2019-01-25PTY: Disallow infinite writing to slaves.Andreas Kling
This way we don't buffer ungodly amounts of output in the kernel when doing e.g "cat /dev/random" on a PTY.
2019-01-16Let each MasterPTY create its slave.Andreas Kling
2019-01-15Allow character devices to block write attempts until there is more space.Andreas Kling
2019-01-15Make it possible for a process to switch controlling terminals.Andreas Kling
Via the TIOCSCTTY and TIOCNOTTY ioctls.
2019-01-15Add basic PTY support.Andreas Kling
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.