263 lines
6.7 KiB
HTML
263 lines
6.7 KiB
HTML
|
<!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>sigdelset()--Delete Signal from Signal Set</title>
|
||
|
<!-- 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. -->
|
||
|
<!-- Begin Header Records ========================================== -->
|
||
|
<!-- UNIX5 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
|
||
|
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
|
||
|
<!-- Edited by Kersten Feb 02 -->
|
||
|
<!-- This file has undergone html cleanup on 04/29/02 by JET -->
|
||
|
<!--End Header Records -->
|
||
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<a name="Top_Of_Page"></a>
|
||
|
<!-- Java sync-link -->
|
||
|
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
|
||
|
</script>
|
||
|
|
||
|
<h2>sigdelset()--Delete Signal from Signal Set</h2>
|
||
|
|
||
|
<div class="box" style="width: 60%;">
|
||
|
<br>
|
||
|
Syntax<br>
|
||
|
<pre>
|
||
|
#include <signal.h>
|
||
|
|
||
|
int sigdelset( sigset_t <em>*set</em>, int <em>signo</em> );
|
||
|
</pre>
|
||
|
|
||
|
<br>
|
||
|
Service Program Name: QPOSSRV1<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Default Public Authority: *USE<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Threadsafe: Yes<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
</div>
|
||
|
|
||
|
<p>The <strong>sigdelset()</strong> function is part of a family of functions
|
||
|
that manipulate signal sets. <strong>Signal sets</strong> are data objects that
|
||
|
let a thread keep track of groups of signals. For example, a thread might
|
||
|
create a signal set to record which signals it is blocking, and another signal
|
||
|
set to record which signals are pending. Signal sets are used to manipulate
|
||
|
groups of signals used by other functions (such as <strong>
|
||
|
sigprocmask()</strong>) or to examine signal sets returned by other functions
|
||
|
(such as <strong>sigpending()</strong>).</p>
|
||
|
|
||
|
<p><strong>sigdelset()</strong> removes the specified <em>signo</em> from the
|
||
|
list of signals recorded in <em>set</em>.</p>
|
||
|
|
||
|
<br>
|
||
|
<!-- Please NOTE: DO NOT DELETE THIS SECTION if this API has no authorities and locks. -->
|
||
|
<!-- Instead, use the commented out coding below to indicate NONE. -->
|
||
|
<h3>Authorities and Locks</h3>
|
||
|
|
||
|
<!-- Use this if there are no authorities and locks. -->
|
||
|
<p>None.</p>
|
||
|
|
||
|
<br>
|
||
|
<h3>Parameters</h3>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong><em>*set</em></strong></dt>
|
||
|
|
||
|
<dd>(Input) A pointer to a signal set.<br>
|
||
|
<br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong><em>signo</em></strong></dt>
|
||
|
|
||
|
<dd>(Input) A signal from the list defined in <a href="sigactn.htm#TBLSIGTBL1">
|
||
|
Control Signals Table</a>.</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
|
||
|
<h3>Return Value</h3>
|
||
|
|
||
|
<table cellpadding="5">
|
||
|
<!-- cols="5 95" -->
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>0</em></td>
|
||
|
<td align="left" valign="top"><strong>sigdelset()</strong> successfully deleted
|
||
|
from the signal set.</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>-1</em></td>
|
||
|
<td align="left" valign="top"><strong>sigdelset()</strong> was not successful.
|
||
|
The <em>errno</em> variable is set to indicate the error.</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<br>
|
||
|
<br>
|
||
|
<h3>Error Conditions</h3>
|
||
|
|
||
|
<p>If <strong>sigdelset()</strong> is not successful, <em>errno</em> usually
|
||
|
indicates the following error. Under some conditions, <em>errno</em> could
|
||
|
indicate an error other than that listed here.</p>
|
||
|
|
||
|
<dl>
|
||
|
<dt><em>[EINVAL]</em></dt>
|
||
|
|
||
|
<dd>
|
||
|
<p>The value specified for the argument is not correct.</p>
|
||
|
|
||
|
<p>A function was passed incorrect argument values, or an operation was
|
||
|
attempted on an object and the operation specified is not supported for that
|
||
|
type of object.</p>
|
||
|
|
||
|
<p>An argument value is not valid, out of range, or NULL.</p>
|
||
|
|
||
|
<p>The value of <em>signo</em> is not within the range of valid signals or
|
||
|
specifies a signal that is not supported.</p>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
<h3>Related Information</h3>
|
||
|
|
||
|
<ul>
|
||
|
<li>The <<strong>signal.h</strong>> file (see <a href="unix13.htm">Header
|
||
|
Files for UNIX-Type Functions</a>)<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="sigactn.htm">sigaction()</a>--Examine and Change Signal Action<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="sigaset.htm">sigaddset()</a>--Add Signal to Signal Set<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="sigeset.htm">sigemptyset()</a>--Initialize and Empty Signal
|
||
|
Set<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="sigfset.htm">sigfillset()</a>--Initialize and Fill Signal Set<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="sigismbr.htm">sigismember()</a>--Test for Signal in Signal Set<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="sigpmsk.htm">sigprocmask()</a>--Examine and Change Blocked
|
||
|
Signals<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="sigpend.htm">sigpending()</a>--Examine Pending Signals<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="sigsusp.htm">sigsuspend()</a>--Wait for Signal<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="sigtwait.htm">sigtimedwait()</a>--Synchronously Accept a Signal
|
||
|
for Interval of Time<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="sigwait.htm">sigwait()</a>--Synchronously Accept a Signal<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="sigwaiti.htm">sigwaitinfo()</a>--Synchronously Accept a Signal and
|
||
|
Signal Data</li>
|
||
|
</ul>
|
||
|
|
||
|
<br>
|
||
|
<h3>Example</h3>
|
||
|
|
||
|
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
|
||
|
for information pertaining to code examples.</p>
|
||
|
|
||
|
<p>The following example deletes a signal from a set of signals:</p>
|
||
|
|
||
|
<pre>
|
||
|
#include <stdio.h>
|
||
|
#include <unistd.h>
|
||
|
#include <signal.h>
|
||
|
|
||
|
void catcher( int sig ) {
|
||
|
|
||
|
printf( "catcher() has gained control\n" );
|
||
|
}
|
||
|
|
||
|
int main( int argc, char *argv[] ) {
|
||
|
|
||
|
struct sigaction sigact;
|
||
|
sigset_t sigset;
|
||
|
|
||
|
sigemptyset( &sigact.sa_mask );
|
||
|
sigact.sa_flags = 0;
|
||
|
sigact.sa_handler = catcher;
|
||
|
sigaction( SIGUSR1, &sigact, NULL );
|
||
|
|
||
|
/*
|
||
|
* Blocking all signals prevents the blockable
|
||
|
* signals from being delivered until they are
|
||
|
* unblocked, so the catcher will not gain
|
||
|
* control.
|
||
|
*/
|
||
|
|
||
|
sigfillset( &sigset );
|
||
|
sigaddset( &sigset, SIGUSR1 );
|
||
|
sigprocmask( SIG_SETMASK, &,sigset, NULL );
|
||
|
|
||
|
printf( "before kill()\n" );
|
||
|
kill( getpid(), SIGUSR1 );
|
||
|
|
||
|
printf( "before unblocking SIGUSR1\n" );
|
||
|
sigdelset( &sigset, SIGUSR1 );
|
||
|
sigprocmask( SIG_SETMASK, &sigset, NULL );
|
||
|
|
||
|
printf( "after unblocking SIGUSR1\n" );
|
||
|
|
||
|
return( 0 );
|
||
|
}
|
||
|
</pre>
|
||
|
|
||
|
<br>
|
||
|
<h3>Output:</h3>
|
||
|
|
||
|
<pre>
|
||
|
before kill()
|
||
|
before unblocking SIGUSR1
|
||
|
catcher() has gained control
|
||
|
after unblocking SIGUSR1
|
||
|
</pre>
|
||
|
|
||
|
<br>
|
||
|
<hr>
|
||
|
API introduced: V3R6
|
||
|
|
||
|
<hr>
|
||
|
<center>
|
||
|
<table cellpadding="2" cellspacing="2">
|
||
|
<tr align="center">
|
||
|
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
|
||
|
"unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by category</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</center>
|
||
|
</body>
|
||
|
</html>
|
||
|
|