Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. In computing and
operating systems, a trap, also known as an exception or a fault, is
typically a type of synchronous interrupt typically caused by an
exceptional condition. A trap usually results in a switch to kernel
mode, wherein the operating system performs some action before returning
control to the originating process. A trap in a system process is more
serious than a trap in a user process, and in some systems is fatal. In
some usages, the term trap refers specifically to an interrupt intended
to initiate a context switch to a monitor program or debugger.