CMPSC 311 - Introduction to Systems Programming Signals

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/52

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering key terms from the lecture notes on UNIX signals and process control.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

53 Terms

1
New cards

Control flow

The sequence of instructions a CPU reads and executes from startup to shutdown.

2
New cards

Exceptional control flow

Mechanisms that allow a system to react to events, enabling exception processing.

3
New cards

Exception

An event that disrupts normal execution and requires handling.

4
New cards

Exception processing

The handling of an exception when control flow is diverted from its normal path.

5
New cards

Exception return

Optional mechanism to resume normal execution after an exception is handled.

6
New cards

Interrupt

A low‑level mechanism that interrupts CPU execution to handle hardware/software events.

7
New cards

Trap

A software-generated exception used to transfer control to the operating system.

8
New cards

Fault

An error condition that causes abnormal program behavior and requires handling.

9
New cards

Abort

An unrecoverable error leading to process termination.

10
New cards

Process context switch

High‑level OS/hardware mechanism to switch CPU context between processes.

11
New cards

Signals

Asynchronous notifications sent by the OS to a process to notify events, handled by a signal handler.

12
New cards

Nonlocal jumps (setjmp/longjmp)

C runtime facility to transfer control nonlocally between function calls.

13
New cards

UNIX signal definition

A signal is a special message sent through the OS to tell a process of a command or event.

14
New cards

Signal

A message delivered by the OS to a process to notify an event and trigger a handler.

15
New cards

Signal handler

Function executed when a signal is delivered.

16
New cards

SIGHUP

Hangup signal (POSIX).

17
New cards

SIGINT

Interrupt signal (ANSI).

18
New cards

SIGQUIT

Quit signal (POSIX).

19
New cards

SIGABRT

Abort signal (ANSI).

20
New cards

SIGFPE

Floating-point exception signal (ANSI).

21
New cards

SIGKILL

Kill signal (unblockable in POSIX).

22
New cards

SIGSEGV

Segmentation fault signal (ANSI).

23
New cards

SIGTERM

Termination signal (ANSI).

24
New cards

SIGSTKFLT

Stack fault signal.

25
New cards

SIGCHLD

Child status has changed signal (POSIX).

26
New cards

SIGCONT

Continue signal (POSIX).

27
New cards

SIGSYS

Bad system call signal (ANSI).

28
New cards

SIGILL

Illegal instruction signal (ANSI).

29
New cards

SIGTRAP

Trace trap signal (POSIX).

30
New cards

SIGIOT

IOT trap (4.2 BSD).

31
New cards

SIGBUS

BUS error signal (4.2 BSD).

32
New cards

SIGUSR1

User-defined signal 1 (POSIX).

33
New cards

SIGUSR2

User-defined signal 2 (POSIX).

34
New cards

SIGSTOP

Stop, unblockable signal (POSIX).

35
New cards

SIGCONT (again)

Continue signal (POSIX).

36
New cards

SIGSYS (again)

Bad system call signal (ANSI).

37
New cards

PID

Process ID; a unique identifier for a running process.

38
New cards

ps

Process status utility; lists PIDs and related process information.

39
New cards

kill

Program that sends signals to processes; defaults to SIGTERM if no signal is given.

40
New cards

killall

Program that sends signals to all instances of a named program.

41
New cards

raise

System call for a process to send a signal to itself.

42
New cards

User-defined signal handlers

Custom functions that handle specific signals instead of the default handler.

43
New cards

signal

Legacy API to set a signal handler.

44
New cards

sighandler_t

Type of a signal handler function pointer.

45
New cards

signal handler

The function invoked when a specified signal is delivered.

46
New cards

Function pointer

A pointer that can refer to a function, be passed as an argument, and be invoked.

47
New cards

sigaction

System call to specify signal handling with greater control than signal.

48
New cards

SA_NODEFER

Flag to prevent blocking of the signal while its handler runs.

49
New cards

SA_ONSTACK

Flag to use an alternate signal stack for the handler.

50
New cards

SA_RESETHAND

Flag to restore the default action after the handler is invoked.

51
New cards

struct sigaction

Data structure used by sigaction to define the handler and options.

52
New cards

Graceful shutdown

Proper shutdown with resource cleanup and synchronization to storage.

53
New cards

Signal vs. sigaction

sigaction provides more control (blocking, stacks, reset behavior) than the basic signal API.