@@ -18,6 +18,8 @@ public:
void print(const char* str);
size_t read(char* buf, size_t buf_size, size_t n);
+ void clear_read_buf(void);
+
constexpr void set_pgrp(pid_t pgid)
{
fg_pgroup = pgid;
@@ -144,6 +144,12 @@ public:
return end - start + 1 - count;
}
+ constexpr void clear(void)
+ {
+ count = 0;
+ head = base;
+ }
};
} // namespace types
@@ -452,8 +452,11 @@ void check_signal()
switch (current_process->signals.pop()) {
case kernel::SIGINT:
case kernel::SIGQUIT:
- case kernel::SIGPIPE:
case kernel::SIGSTOP:
+ procs->get_ctrl_tty(current_process->pid)->clear_read_buf();
+ kill_current(-1);
+ break;
+ case kernel::SIGPIPE:
kill_current(-1);
break;
case 0:
@@ -142,3 +142,8 @@ void serial_tty::recvchar(char c)
+void tty::clear_read_buf(void)
+{
+ this->buf.clear();
+}