Minishell
 
Loading...
Searching...
No Matches
signals.c File Reference
#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>
Include dependency graph for signals.c:

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.
 

Function Documentation

◆ signal_handler()

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) = [^;]+';

Parameters
sigSignal received.
infoInformation about the signal.
contextContext of the signal.