ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/pase_signals.htm

94 lines
4.2 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>i5/OS PASE Signal Handling</title><!-- Begin Header Records -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- Created by V2DCIJB on 23 Nov 1999 -->
<!-- Edited by Kersten Jan 02 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>i5/OS PASE Signal Handling</h2>
<h3>i5/OS PASE Signals and ILE Signals</h3>
<p>OS/PASE signals and POSIX/ILE signals are independent, so it is not possible
to directly call a handler for one signal type by raising the other type of
signal. However, the <a href="qp2signalpase.htm">Post an i5/OS PASE Signal</a>
(Qp2SignalPase) API can be used as the handler for any ILE signal to post a
corresponding i5/OS PASE signal. An i5/OS PASE program can also define
handlers for i5/OS PASE signals that call ILE procedures to post equivalent
ILE signals. Program <strong>QP2SHELL</strong> and the i5/OS PASE
<strong>fork</strong> function always setup handlers to map every ILE signal to
a corresponding i5/OS PASE signal.</p>
<br>
<h3>i5/OS Messages and i5/OS PASE Programs</h3>
<p>Many i5/OS applications and system functions report errors with exception
messages sent to program call message queues. See <a href="term.htm">Message
Handling Terms and Concepts</a> for information about exception messages and
program call message queues.</p>
<p>The system only creates program call message queues for ILE procedures and
OMI programs. Any machine exception caused by an operation inside an i5/OS
PASE program (such as MCH0601 for a storage reference error) is sent to the
program call message queue for an (internal) ILE procedure in service program
QP2USER. This ILE procedure is also the apparent caller of any ILE procedure
the i5/OS PASE program calls directly (using _ILECALLX or _ILECALL), so any
i5/OS message the called procedure sends to its caller goes to the same
message queue used for machine exceptions.</p>
<br>
<h3>i5/OS Exceptions and i5/OS PASE Signals</h3>
<p>The ILE procedure in service program QP2USER that runs i5/OS PASE programs
handles any exception and converts it to an i5/OS PASE signal, the same way
POSIX/ILE C runtime converts exceptions to ILE signals. The specific signal
used depends on the i5/OS message identifier for the exception. i5/OS PASE
and ILE use different signal numbers, but both map any specific message
identifier to the same signal name (such as SIGSEGV). See the
<a href="../books/sc092712.pdf" target="_blank">WebSphere Development
Studio: ILE C/C++ Programmer's Guide</a><IMG SRC="wbpdf.gif" ALT="Link to PDF">
for details.</p>
<p>An i5/OS PASE signal handler
can determine whether a signal is associated with an exception message by
inspecting field <em>msgkey</em> in the ucontext_t_os400 structure (declared in
header file as400_types.h) that is passed as an argument to the handler. A non-zero value is the message
reference key for the i5/OS message that caused the signal. Zero indicates the
signal is not associated with an i5/OS message (which is always true for
asynchronous signals). The i5/OS PASE program can use the message reference
key to receive the exception message (see <a href="pase_qmhrcvpm.htm">Receive
Program Message for i5/OS PASE</a>) for more details about the error.</p>
<br>
<br>
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"pase1.htm">i5/OS PASE APIs</a> | <a href="aplist.htm">APIs by category</a>
</td>
</tr>
</table>
</center>
</body>
</html>