summaryrefslogtreecommitdiffstats
path: root/Cargo.lock
Commit message (Collapse)AuthorAgeFilesLines
* Replace ctrlc with signal-hooksignalRory Dudley2024-02-241-89/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced the 'ctrlc' crate with 'signal-hook' for handling of SIGINT. The 'signal_hook::low_level::register' function is actually unsafe. However, according to https://docs.rs/signal-hook/latest/signal_hook/low_level/fn.register.html, it is only unsafe in the case of multithreaded applications. There are some race conditions as well. For instance, it appears that even when we fork to a child process, SIGINT is captured on both that process, as well as the shell. Notes: The replacement was motivated by the fact that 'ctrlc' appears to use a separate thread to handle interrupts. This is evident if you run: ps aux | grep dwvsh USER PID %CPU %MEM VSZ RSS TTY STAT START COMMAND user pid 0.0 0.0 71500 3072 term Sl+ 20:08 target/debug/dwvsh Further reading in 'man ps' under 'PROCESS STATE CODES', reveals that 'l' is a process state referring to multithreaded applications. Given the nature of interupts, this seems unnecessary. The issue where SIGINT is captured by both the shell, and child process will have to be addressed.
* Capture SIGINTRory Dudley2024-02-161-0/+108
| | | | | | Added logic to capture the interrupt signal. Using a rust crate called 'ctrlc' to do the heavy lifting. Program will simply reprint the prompt on a new line if the interrup signal is detected.
* Initial commitRory Dudley2024-02-161-0/+7
An extremely miniamal shell. It is capable of forking processes, and passing arguments to them, but that's pretty much it. Notes: This is pretty much a prototype, to see how easily something like a shell could be implemented in Rust.