summaryrefslogtreecommitdiff
path: root/Userland/cat.cpp
AgeCommit message (Collapse)Author
2019-06-07Userland: Run clang-format on everything.Andreas Kling
2019-06-06cat: Fix some oversights in error handling.Andreas Kling
Error messages should go to stderr so they don't get mixed in with the program's output. Also added a check for the return value of write().
2019-04-25cat: Just use fd 0 when no arguments are passed.Andreas Kling
I'm not sure why it seemed necessary at some point to open /dev/stdin rather than simply using the already-open fd 0.
2019-02-03Add /dev/{stdin,stdout,stderr} as symlinks to /proc/self/fd/{0,1,2}Andreas Kling
Also change /bin/cat to open /dev/stdin if no arguments are provided.
2018-11-17Various stubs while trying to get an old coreutils to build.Andreas Kling
2018-11-08Add some simple write buffering to LibC's stdio.Andreas Kling
Plumb it all the way to the VirtualConsole. Also fix /bin/cat to write() the whole chunks we get from read() directly to stdout.
2018-11-06Add some basic signal support.Andreas Kling
It only works for sending a signal to a process that's in userspace code. We implement reception by synthesizing a PUSHA+PUSHF in the receiving process (operating on values in the TSS.) The TSS CS:EIP is then rerouted to the signal handler and a tiny return trampoline is constructed in a dedicated region in the receiving process. Also hacked up /bin/kill to be able to send arbitrary signals (kill -N PID)
2018-11-03Fix some bugs in execve() and make sh use it for process launching.Andreas Kling
Interrupting children of sh now always works with ^C :^)
2018-11-02Basic ^C interrupt implementation.Andreas Kling
For testing, I made cat put itself into a new process group. This should eventually be done by sh between fork() and exec().
2018-10-28Add basic symlink support.Andreas Kling
- sys$readlink + readlink() - Add a /proc/PID/exe symlink to the process's executable. - Print symlink contents in ls output. - Some work on plumbing options into VFS::open().
2018-10-27Greatly improve /proc/PID/stack by tracing the ebp frame chain.Andreas Kling
I also added a generator cache to FileHandle. This way, multiple reads to a generated file (i.e in a synthfs) can transparently handle multiple calls to read() without the contents changing between calls. The cache is discarded at EOF (or when the FileHandle is destroyed.)
2018-10-26Add a very hackish /proc/PID/stack.Andreas Kling
It walks the stack and identifies anything that looks like a kernel symbol. This could be a lot more sophisticated.
2018-10-26Implement argc/argv support for spawned tasks.Andreas Kling
Celebrate the new functionality with a simple /bin/cat implementation. :^)