aio.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.
*/
/*
* The POSIX async. I/O functionality is
* implemented in libaio/common/posix_aio.c
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "c_synonyms.h"
#include <aio.h>
#include <errno.h>
#include <stdlib.h>
#include "pos4.h"
#include "sigev_thread.h"
extern int _libaio_close(int fd);
/*
* There is but one spawner for all aio operations.
*/
int sigev_aio_busy = 0;
static int
{
int port;
int rc = 0;
(void) mutex_lock(&sigev_aio_lock);
while (sigev_aio_busy)
else {
sigev_aio_busy = 1;
(void) mutex_unlock(&sigev_aio_lock);
port = -1;
rc = -1;
} else if (launch_spawner(tcdp) != 0) {
port = -1;
rc = -1;
} else {
}
(void) mutex_lock(&sigev_aio_lock);
sigev_aio_busy = 0;
(void) cond_broadcast(&sigev_aio_cv);
}
(void) mutex_unlock(&sigev_aio_lock);
return (rc);
}
static int
{
return (__sigev_thread_init(sigevp));
}
return (0);
}
#if !defined(_LP64)
static int
{
return (__sigev_thread_init(sigevp));
}
return (0);
}
#endif
int
__posix_aio_close(int fd)
{
return (_libaio_close(fd));
}
int
{
}
#if !defined(_LP64)
int
{
}
#endif
int
{
return (__aio_error(aiocbp));
}
#if !defined(_LP64)
int
{
return (__aio_error64(aiocbp));
}
#endif
int
{
int rc;
return (rc);
}
#if !defined(_LP64)
int
{
int rc;
return (rc);
}
#endif
int
{
int rc;
return (rc);
}
#if !defined(_LP64)
int
{
int rc;
return (rc);
}
#endif
{
return (__aio_return(aiocbp));
}
#if !defined(_LP64)
{
return (__aio_return64(aiocbp));
}
#endif
int
const timespec_t *timeout)
{
}
#if !defined(_LP64)
int
const timespec_t *timeout)
{
}
#endif
int
{
int rc;
return (rc);
}
#if !defined(_LP64)
int
{
int rc;
return (rc);
}
#endif
int
lio_listio(int mode,
{
int i;
for (i = 0; i < nent; i++) {
__posix_sigev_thread(aiocbp) != 0)
return (-1);
}
__sigev_thread_init(sigevp) != 0)
return (-1);
}
#if !defined(_LP64)
int
lio_listio64(int mode,
{
int i;
for (i = 0; i < nent; i++) {
__posix_sigev_thread64(aiocbp) != 0)
return (-1);
}
__sigev_thread_init(sigevp) != 0)
return (-1);
}
#endif
int
const timespec_t *timeout)
{
}
#if !defined(_LP64)
int
const timespec_t *timeout)
{
}
#endif