Skip to content
Snippets Groups Projects
Commit 17db2741 authored by 임영수's avatar 임영수
Browse files

/* signal handling complete */

parent 98fbc382
No related branches found
No related tags found
No related merge requests found
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include "commands.h"
#include "built_in.h"
#include "utils.h"
#include "signal_handlers.h"
int main()
{
char buf[8096];
while (1) {
/* buf reset to all '0' */
memset(buf, 0, 8096);
/* signal handling */
signal(SIGINT, (void*)catch_sigint);
signal(SIGTSTP, (void*)catch_sigtstp);
fgets(buf, 8096, stdin);
struct single_command commands[512];
......
#include "signal_handlers.h"
#include <signal.h>
void catch_sigint(int signalNo)
{
// TODO: File this!
// Ctrl + C
signal(SIGINT, catch_sigint);
}
void catch_sigtstp(int signalNo)
{
// TODO: File this!
// Ctrl + Z
signal(SIGTSTP, catch_sigtstp);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment