#include "builtins.h"
#include "garbage.h"
#include "ft_printf.h"
#include "minishell.h"
#include <readline/readline.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Functions | |
void | signal_handler (int sig, siginfo_t *info, void *context) |
Signal handler Ctrl+C = SIGINT -> print "^C" and displays a new prompt on a new line. Ctrl+\ = SIGQUIT -> do nothing. | |
int | signal_init (void) |
Main function for initialising signals. | |
void | reset_signal_default (void) |
Function to reset signals to default. | |
void | ignore_signal (void) |
Function to ignore certain signals. | |
void signal_handler | ( | int | sig, |
siginfo_t * | info, | ||
void * | context ) |
Signal handler Ctrl+C = SIGINT -> print "^C" and displays a new prompt on a new line. Ctrl+\ = SIGQUIT -> do nothing.
Search for now signals : stty -a | grep -Ewoe '(intr|quit|susp|erase|kill|eof|eol|eol2) = [^;]+'; stty -a | grep -Ewoe '(swtch|start|stop|susp) = [^;]+'; stty -a | grep -Ewoe '(rprnt|werase|lnext|discard) = [^;]+';
sig | Signal received. |
info | Information about the signal. |
context | Context of the signal. |