sig.c revision 3470957343f37ed9baa957980891dbbe4c2d7092
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "libaio.h"
void
{
_sigoff();
(void) mutex_lock(mp);
}
void
{
(void) mutex_unlock(mp);
_sigon();
}
int
{
int error;
_sigoff();
_sigon();
return (error);
}
/*
* sig_cond_wait() is a cancellation point.
*/
int
{
int error;
/* take the deferred signal here */
}
return (error);
}
/*
* sig_cond_reltimedwait() is a cancellation point.
*/
int
{
int error;
/* take the deferred signal here */
}
return (error);
}
int
{
int *aio_workerscnt;
void *(*func)(void *);
int error;
/*
* Put the new worker thread in the right queue.
*/
switch (mode) {
case AIOREAD:
case AIOWRITE:
case AIOAREAD:
case AIOAWRITE:
#if !defined(_LP64)
case AIOAREAD64:
case AIOAWRITE64:
#endif
workers = &__workers_rw;
break;
case AIONOTIFY:
workers = &__workers_no;
break;
default:
_aiopanic("_aio_create_worker: invalid mode");
break;
}
return (-1);
if (reqp) {
}
if (error) {
if (reqp) {
}
return (-1);
}
(*aio_workerscnt)++;
*nextworker = aiowp;
} else {
}
return (0);
}
/*
* This is the application's AIOSIGCANCEL sigaction setting.
*/
/*
* This is our AIOSIGCANCEL handler.
* If the signal is not meant for us, call the application's handler.
*/
void
{
/*
* Only aio worker threads get here (with aiowp != NULL).
*/
/*
* Call the application signal handler.
*/
}
/*
* SIGLWP is ignored by default.
*/
}
/* consolidation private interface in libc */
int
{
/*
* We detect SIGIO just to set the _sigio_enabled flag.
*/
/*
* We interpose on SIGAIOCANCEL (aka SIGLWP). Although SIGLWP
* is a 'reserved' signal that no application should be using, we
* honor the application's handler (see aiosigcancelhndlr(), above).
*/
if (sig == SIGAIOCANCEL) {
} else {
}
return (-1);
}
}
if (oact)
return (0);
}
/*
* Everything else, just call the real sigaction().
*/
}
void
init_signals(void)
{
/*
* See if the application has set up a handler for SIGIO.
*/
/*
* Arrange to catch SIGAIOCANCEL (SIGLWP).
* If the application has already set up a handler, preserve it.
*/
} else {
}
}